diff --git a/recipes/games/opentyrian/manifest b/recipes/games/opentyrian/manifest new file mode 100644 index 0000000000000000000000000000000000000000..bcda89e35cadb0cd89218be49b07285a3171776b --- /dev/null +++ b/recipes/games/opentyrian/manifest @@ -0,0 +1,4 @@ +name=OpenTyrian +category=Games +binary=/usr/games/opentyrian +icon=/ui/icons/apps/opentyrian.png diff --git a/recipes/games/opentyrian/recipe.toml b/recipes/games/opentyrian/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..be33f98408f743b557cee973ac29f0d53937b101 --- /dev/null +++ b/recipes/games/opentyrian/recipe.toml @@ -0,0 +1,50 @@ +# Version date: 02-August-2024 +# +# Notes: +# As Tyrian is an ancient, sprite based game, the code isn't updated +# super frequently. So instead of just pinning the version to the last +# official release in 2022, I'm pulling from main because it's unlikely +# anything will break. The last two commits were small fixes, one in 2023 +# and one in 2024. + +[source] +git = "https://github.com/opentyrian/opentyrian" +patches = [ "redox.patch" ] + +[build] +template = "custom" +dependencies = [ + "llvm18", + "liborbital", + "mesa", + "sdl2", + "zlib", + # "sdl2-net" +] +script = """ +# Build system is only a standalone Makefile +COOKBOOK_CONFIGURE="true" +COOKBOOK_CONFIGURE_FLAGS="" + +# See Makefile for variables to override +export PKG_CONFIG="${TARGET}-pkg-config" +ASSETSDIR="${COOKBOOK_STAGE}/usr/share/games/tyrian" +export WITH_NETWORK=false +export REDOX_OVERRIDE=true +export prefix="/usr" +export bindir="${prefix}/games" +export icondir="/ui/icons/apps" +export gamesdir="${prefix}/share/games" + +# Prepare the sources and download Tyrian (freeware) +rsync -av --delete "${COOKBOOK_SOURCE}/" "${COOKBOOK_RECIPE}/tyrian21.zip.sha" ./ +mkdir -p "${ASSETSDIR}" +curl -OL https://camanis.net/tyrian/tyrian21.zip +sha256sum -c tyrian21.zip.sha +unzip -jd "${ASSETSDIR}" tyrian21.zip + +# The build system doesn't automatically apply patches to cloned repositories +git apply "${COOKBOOK_RECIPE}/redox.patch" + +cookbook_configure +""" diff --git a/recipes/games/opentyrian/redox.patch b/recipes/games/opentyrian/redox.patch new file mode 100644 index 0000000000000000000000000000000000000000..e0de2aec7f772f88230047b358aa2d1faaa1e870 --- /dev/null +++ b/recipes/games/opentyrian/redox.patch @@ -0,0 +1,60 @@ +Binary files source/.git/index and source-new/.git/index differ +diff '--color=auto' -rupwN source/Makefile source-new/Makefile +--- source/Makefile 2024-10-21 02:46:06.720225834 -0400 ++++ source-new/Makefile 2024-10-25 01:03:37.283351544 -0400 +@@ -5,10 +5,11 @@ ifneq ($(filter Msys Cygwin, $(shell una + TYRIAN_DIR = C:\\TYRIAN + else + PLATFORM := UNIX +- TYRIAN_DIR = $(gamesdir)/tyrian ++ TYRIAN_DIR ?= $(gamesdir)/tyrian + endif + +-WITH_NETWORK := true ++WITH_NETWORK ?= true ++REDOX_OVERRIDE ?= false + + ################################################################################ + +@@ -114,11 +115,15 @@ installdirs : + mkdir -p $(DESTDIR)$(docdir) + mkdir -p $(DESTDIR)$(man6dir) + mkdir -p $(DESTDIR)$(desktopdir) +- mkdir -p $(DESTDIR)$(icondir)/hicolor/22x22/apps +- mkdir -p $(DESTDIR)$(icondir)/hicolor/24x24/apps +- mkdir -p $(DESTDIR)$(icondir)/hicolor/32x32/apps +- mkdir -p $(DESTDIR)$(icondir)/hicolor/48x48/apps +- mkdir -p $(DESTDIR)$(icondir)/hicolor/128x128/apps ++ if [ "$(REDOX_OVERRIDE)" = "true" ]; then\ ++ mkdir -p $(DESTDIR)$(icondir);\ ++ else\ ++ mkdir -p $(DESTDIR)$(icondir)/hicolor/22x22/apps;\ ++ mkdir -p $(DESTDIR)$(icondir)/hicolor/24x24/apps;\ ++ mkdir -p $(DESTDIR)$(icondir)/hicolor/32x32/apps;\ ++ mkdir -p $(DESTDIR)$(icondir)/hicolor/48x48/apps;\ ++ mkdir -p $(DESTDIR)$(icondir)/hicolor/128x128/apps;\ ++ fi;\ + + .PHONY : install + install : $(TARGET) installdirs +@@ -126,11 +131,15 @@ install : $(TARGET) installdirs + $(INSTALL_DATA) NEWS README $(DESTDIR)$(docdir)/ + $(INSTALL_DATA) linux/man/opentyrian.6 $(DESTDIR)$(man6dir)/opentyrian$(man6ext) + $(INSTALL_DATA) linux/opentyrian.desktop $(DESTDIR)$(desktopdir)/ +- $(INSTALL_DATA) linux/icons/tyrian-22.png $(DESTDIR)$(icondir)/hicolor/22x22/apps/opentyrian.png +- $(INSTALL_DATA) linux/icons/tyrian-24.png $(DESTDIR)$(icondir)/hicolor/24x24/apps/opentyrian.png +- $(INSTALL_DATA) linux/icons/tyrian-32.png $(DESTDIR)$(icondir)/hicolor/32x32/apps/opentyrian.png +- $(INSTALL_DATA) linux/icons/tyrian-48.png $(DESTDIR)$(icondir)/hicolor/48x48/apps/opentyrian.png +- $(INSTALL_DATA) linux/icons/tyrian-128.png $(DESTDIR)$(icondir)/hicolor/128x128/apps/opentyrian.png ++ if [ "$(REDOX_OVERRIDE)" = "true" ]; then\ ++ $(INSTALL_DATA) linux/icons/tyrian-32.png $(DESTDIR)$(icondir)/opentyrian.png;\ ++ else\ ++ $(INSTALL_DATA) linux/icons/tyrian-22.png $(DESTDIR)$(icondir)/hicolor/22x22/apps/opentyrian.png;\ ++ $(INSTALL_DATA) linux/icons/tyrian-24.png $(DESTDIR)$(icondir)/hicolor/24x24/apps/opentyrian.png;\ ++ $(INSTALL_DATA) linux/icons/tyrian-32.png $(DESTDIR)$(icondir)/hicolor/32x32/apps/opentyrian.png;\ ++ $(INSTALL_DATA) linux/icons/tyrian-48.png $(DESTDIR)$(icondir)/hicolor/48x48/apps/opentyrian.png;\ ++ $(INSTALL_DATA) linux/icons/tyrian-128.png $(DESTDIR)$(icondir)/hicolor/128x128/apps/opentyrian.png;\ ++ fi;\ + + .PHONY : uninstall + uninstall : diff --git a/recipes/games/opentyrian/tyrian21.zip.sha b/recipes/games/opentyrian/tyrian21.zip.sha new file mode 100644 index 0000000000000000000000000000000000000000..a57cd4a9e88cb2f9e78bc94f769a9e3189d176a6 --- /dev/null +++ b/recipes/games/opentyrian/tyrian21.zip.sha @@ -0,0 +1 @@ +7790d09a2a3addcd33c66ef063d5900eb81cc9c342f4807eb8356364dd1d9277 tyrian21.zip