diff --git a/recipes/games/quakespasm/manifest b/recipes/games/quakespasm/manifest new file mode 100644 index 0000000000000000000000000000000000000000..814d6b06e3e471f9217d27b0c99a2bf6c20f178c --- /dev/null +++ b/recipes/games/quakespasm/manifest @@ -0,0 +1,4 @@ +name=QuakeSpasm +category=Games +binary=/usr/games/quakespasm +icon=/ui/icons/apps/quakespasm.png diff --git a/recipes/games/quakespasm/recipe.toml b/recipes/games/quakespasm/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..1d5d069e6c4cc99297d85314db45425d07e953e9 --- /dev/null +++ b/recipes/games/quakespasm/recipe.toml @@ -0,0 +1,48 @@ +# TODO: Promote + +# Version: 0.96.3 +# Version date: 31-July-2024 + +[source] +git = "https://github.com/sezero/quakespasm" +rev = "cc32abe09ed417ce3be10af300d2dc2f686349ba" +patches = ["redox.patch"] + +[build] +template = "custom" +dependencies = [ + "llvm18", + "libiconv", + "libogg", + "liborbital", + "libvorbis", + "mesa", + # "sdl1", + "sdl2", + "zlib", +] +script = """ +# Skip configuring because QuakeSpasm uses a custom build system +COOKBOOK_CONFIGURE="true" +COOKBOOK_CONFIGURE_FLAGS="" + +# Ensure the build system is aware of Redox +# The build system uses sdl-config for Unix, but SDL recommends using pkg-config +export HOST_OS="redox" +export PKG_CONFIG="${TARGET}-pkg-config" + +# Config options for the Makefile. Set as necessary (see Makefile). +# MP3 is disabled because libmad doesn't compile at the moment +# Other options weren't tested, but SDL and SDL2 both compile fine +export USE_SDL2=1 +export USE_CODEC_MP3=0 +export DO_USERDIRS=1 + +# Source is in Quake/ and icons are in Misc/ +rsync -av --delete "${COOKBOOK_SOURCE}/Quake/" "${COOKBOOK_SOURCE}/Misc" ./ + +# According to frantic grepping, the Redox build system doesn't apply patches to git +git apply "${COOKBOOK_RECIPE}/redox.patch" + +cookbook_configure +""" diff --git a/recipes/games/quakespasm/redox.patch b/recipes/games/quakespasm/redox.patch new file mode 100644 index 0000000000000000000000000000000000000000..c3ff6a46eec313ae1f4c5dddb40bb881820107f5 --- /dev/null +++ b/recipes/games/quakespasm/redox.patch @@ -0,0 +1,110 @@ +diff '--color=auto' -rupwN source/Makefile source-new/Makefile +--- source/Makefile 2024-10-15 21:21:14.824589882 -0400 ++++ source-new/Makefile 2024-10-16 00:42:27.651948743 -0400 +@@ -4,28 +4,34 @@ + # "make SDL_CONFIG=/path/to/sdl-config" for unusual SDL installations. + # "make DO_USERDIRS=1" to enable user directories support + ++# Base install directory ++DESTDIR ?= "/" ++INSTALLDIR = "${DESTDIR}/usr/games/" ++DATADIR = "${DESTDIR}/usr/share/games/quake1/id1/" ++ICODIR = "${DESTDIR}/ui/icons/apps/" ++ + # Enable/Disable user directories support +-DO_USERDIRS=0 ++DO_USERDIRS ?= 0 + + ### Enable/Disable SDL2 +-USE_SDL2=0 ++USE_SDL2 ?= 0 + + ### Enable/Disable codecs for streaming music support +-USE_CODEC_WAVE=1 +-USE_CODEC_FLAC=0 +-USE_CODEC_MP3=1 +-USE_CODEC_VORBIS=1 +-USE_CODEC_OPUS=0 ++USE_CODEC_WAVE ?= 1 ++USE_CODEC_FLAC ?= 0 ++USE_CODEC_MP3 ?= 1 ++USE_CODEC_VORBIS ?= 1 ++USE_CODEC_OPUS ?= 0 + # either xmp or mikmod (or modplug) +-USE_CODEC_MIKMOD=0 +-USE_CODEC_XMP=0 +-USE_CODEC_MODPLUG=0 +-USE_CODEC_UMX=0 ++USE_CODEC_MIKMOD ?= 0 ++USE_CODEC_XMP ?= 0 ++USE_CODEC_MODPLUG ?= 0 ++USE_CODEC_UMX ?= 0 + + # which library to use for mp3 decoding: mad or mpg123 +-MP3LIB=mad ++MP3LIB ?= mad + # which library to use for ogg decoding: vorbis or tremor +-VORBISLIB=vorbis ++VORBISLIB ?= vorbis + + # --------------------------- + # Helper functions +@@ -35,7 +41,7 @@ check_gcc = $(shell if echo | $(CC) $(1) + + # --------------------------- + +-HOST_OS = $(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]') ++HOST_OS ?= $(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]') + + DEBUG ?= 0 + +@@ -49,7 +55,7 @@ LINKER = $(CC) + STRIP ?= strip + PKG_CONFIG ?= pkg-config + +-CPUFLAGS= ++CPUFLAGS ?= + LDFLAGS?= + DFLAGS ?= + CFLAGS ?= -Wall -Wno-trigraphs -MMD +@@ -81,11 +87,19 @@ endif + + ifeq ($(USE_SDL2),1) + SDL_CONFIG ?= sdl2-config ++SDL_VERSION = sdl2 + else + SDL_CONFIG ?= sdl-config ++SDL_VERSION = sdl + endif ++ ++ifeq ($(HOST_OS),redox) ++SDL_CFLAGS = $(shell $(PKG_CONFIG) --cflags $(SDL_VERSION)) ++SDL_LIBS = $(shell $(PKG_CONFIG) --libs $(SDL_VERSION)) ++else + SDL_CFLAGS = $(shell $(SDL_CONFIG) --cflags) + SDL_LIBS = $(shell $(SDL_CONFIG) --libs) ++endif + + NET_LIBS = + ifeq ($(HOST_OS),sunos) +@@ -164,6 +178,8 @@ endif + + ifeq ($(HOST_OS),haiku) + COMMON_LIBS= -lGL ++else ifeq ($(HOST_OS),redox) ++COMMON_LIBS= -lorbital $(shell $(PKG_CONFIG) --libs osmesa zlib) + else + COMMON_LIBS= -lGL -lm + endif +@@ -290,7 +306,10 @@ install: quakespasm + cp quakespasm.pak $(QS_APP_DIR) + else + install: quakespasm +- cp quakespasm /usr/local/games/quake ++ mkdir -p "${INSTALLDIR}" "${DATADIR}" "${ICODIR}" ++ cp quakespasm "${INSTALLDIR}/quakespasm" ++ # xxx Probably requires resizing ++ cp Misc/QuakeSpasm_512.png "${ICODIR}/quakespasm.png" + endif + + sinclude $(OBJS:.o=.d) diff --git a/recipes/wip/games/fps/quake1-shareware/manifest b/recipes/wip/games/fps/quake1-shareware/manifest new file mode 100644 index 0000000000000000000000000000000000000000..008df9c03e3896f197034dd5196ecfd68f41220d --- /dev/null +++ b/recipes/wip/games/fps/quake1-shareware/manifest @@ -0,0 +1,3 @@ +name=Quake shareware +category=Games +binary=/usr/games/quakespasm -basedir /use/share/games/quake/ diff --git a/recipes/wip/games/fps/quake1-shareware/pak0.pak.sha b/recipes/wip/games/fps/quake1-shareware/pak0.pak.sha new file mode 100644 index 0000000000000000000000000000000000000000..036550110ec9aa3a7a7d5a76dd6f53083c24f7c2 --- /dev/null +++ b/recipes/wip/games/fps/quake1-shareware/pak0.pak.sha @@ -0,0 +1 @@ +35a9c55e5e5a284a159ad2a62e0e8def23d829561fe2f54eb402dbc0a9a946af /mnt/games1/home/steam_games/steamapps/common/Quake/id1/PAK0.PAK diff --git a/recipes/wip/games/fps/quake1-shareware/quake106.zip.sha b/recipes/wip/games/fps/quake1-shareware/quake106.zip.sha new file mode 100644 index 0000000000000000000000000000000000000000..e7df387ba7208b6220d2a17542c3c6f68f034cfb --- /dev/null +++ b/recipes/wip/games/fps/quake1-shareware/quake106.zip.sha @@ -0,0 +1 @@ +ec6c9d34b1ae0252ac0066045b6611a7919c2a0d78a3a66d9387a8f597553239 quake106.zip diff --git a/recipes/wip/games/fps/quake1-shareware/recipe.toml b/recipes/wip/games/fps/quake1-shareware/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..f721529c1b0a004ce94ed0c963a3de046f0ddba4 --- /dev/null +++ b/recipes/wip/games/fps/quake1-shareware/recipe.toml @@ -0,0 +1,24 @@ +# TODO: +# * Requires unarchivers + +[build] +template = "custom" +dependencies = ["lhasa", "unzrip"] +script = """ +curl -O "https://github.com/Jason2Brownlee/QuakeOfficialArchive/raw/refs/heads/main/bin/quake106.zip" +sha256sum -c quake106.zip.sha + +# The zip file contains a DOS installer which we don't need +# The actual demo content is within another archive +7z x quake106.zip + +# Actual game contents +lha xv resource.1 +sha256sum -c pak0.pak.sha + +# Now, the ID1 folder contains PAK0, the demo file +# Non-Windows/non-DOS systems expect the directory and file to be lowercased +OUT_DIR = "${COOKBOOK_STAGE}/usr/share/games/quake/id1/" +mkdir -p "${OUT_DIR}" +cp -v ID1/PAK0.PAK "${OUT_DIR}/pak0.pak" +"""