diff options
| author | orahcio <orahcio@gmail.com> | 2026-05-12 14:53:50 -0300 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2026-05-31 08:30:02 +0200 |
| commit | 5cee86d9c7b0eafa90baae5d596326e520f31bb7 (patch) | |
| tree | 09c0d87fbb1da38884a500ccfc4894f5fb2a5ff6 | |
| parent | fe0f4e337468ca25f57457485f89c63f8a0c8857 (diff) | |
gnu: Add maelstrom.
* gnu/packages/games.scm (maelstrom): New variable.
* gnu/packages/patches/maelstrom-use-system-physfs.patch: New file.
* gnu/local.mk (dist_patch_DATA): Reference it here.
Change-Id: Iee41dc552edb639047278392ea57a41112c04fd8
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/games.scm | 66 | ||||
| -rw-r--r-- | gnu/packages/patches/maelstrom-use-system-physfs.patch | 39 |
3 files changed, 106 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 60919446efc..bbf5399649b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -1889,6 +1889,7 @@ dist_patch_DATA = \ | |||
| 1889 | %D%/packages/patches/lxsession-potfiles-ignore.patch \ | 1889 | %D%/packages/patches/lxsession-potfiles-ignore.patch \ |
| 1890 | %D%/packages/patches/mate-common-honor-aclocal.patch \ | 1890 | %D%/packages/patches/mate-common-honor-aclocal.patch \ |
| 1891 | %D%/packages/patches/mactelnet-remove-init.patch \ | 1891 | %D%/packages/patches/mactelnet-remove-init.patch \ |
| 1892 | %D%/packages/patches/maelstrom-use-system-physfs.patch \ | ||
| 1892 | %D%/packages/patches/mailutils-variable-lookup.patch \ | 1893 | %D%/packages/patches/mailutils-variable-lookup.patch \ |
| 1893 | %D%/packages/patches/mandoc-support-zstd-compression.patch \ | 1894 | %D%/packages/patches/mandoc-support-zstd-compression.patch \ |
| 1894 | %D%/packages/patches/mantid-openmp-cleanup.patch \ | 1895 | %D%/packages/patches/mantid-openmp-cleanup.patch \ |
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 15d3b7732e6..5ebbf0fdf77 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm | |||
| @@ -4825,6 +4825,72 @@ match, cannon keep, and grave-itation pit.") | |||
| 4825 | (license (list license:gpl3+ | 4825 | (license (list license:gpl3+ |
| 4826 | license:cc-by-sa3.0))))) ;/data/audio/music | 4826 | license:cc-by-sa3.0))))) ;/data/audio/music |
| 4827 | 4827 | ||
| 4828 | (define-public maelstrom | ||
| 4829 | (package | ||
| 4830 | (name "maelstrom") | ||
| 4831 | (version "4.0.1") | ||
| 4832 | (source | ||
| 4833 | (origin | ||
| 4834 | (method git-fetch) | ||
| 4835 | (uri (git-reference | ||
| 4836 | (url "https://github.com/libsdl-org/Maelstrom") | ||
| 4837 | (commit (string-append "release-" version)))) | ||
| 4838 | (sha256 | ||
| 4839 | (base32 "1vry9vqb8sijyl10b7cbyxlx1sadykw3zgvg28lz92qk4p406jpy")) | ||
| 4840 | (file-name (git-file-name name version)) | ||
| 4841 | (snippet | ||
| 4842 | #~(begin | ||
| 4843 | (use-modules (guix build utils)) | ||
| 4844 | (substitute* '("game/mods.cpp" "utils/files.c") | ||
| 4845 | (("\"[^\"]*/physfssdl3.h\"") "\"physfssdl3.h\"")) | ||
| 4846 | (substitute* "CMakeLists.txt" | ||
| 4847 | (("set\\(original_BUILD_SHARED_LIBS.*\n") "") | ||
| 4848 | (("set\\(BUILD_SHARED_LIBS OFF\\)\n") "") | ||
| 4849 | (("add_subdirectory\\(external/SDL_net.*") | ||
| 4850 | (string-append "find_package(SDL3_net REQUIRED)\n" | ||
| 4851 | "include(CheckCSourceCompiles)\n" | ||
| 4852 | "include(CMakeDependentOption)\n")) | ||
| 4853 | (((string-append "set\\(BUILD_SHARED_LIBS \"\\$\\{" | ||
| 4854 | "original_BUILD_SHARED_LIBS\\}\"\\)\n")) "") | ||
| 4855 | (("add_subdirectory\\(macres\\)\n") "") | ||
| 4856 | (("miniz/miniz\\.c\n") "") | ||
| 4857 | (("find_package\\(SDL3_net (REQUIRED)\\)\n" all first) | ||
| 4858 | (string-append all "pkg_check_modules(MINIZ " first | ||
| 4859 | " IMPORTED_TARGET miniz)\n")) | ||
| 4860 | (("(target_link_libraries\\(Maelstrom PRIVATE )SDLmac\\)" all first) | ||
| 4861 | (string-append all "\n" first "PkgConfig::MINIZ)"))) | ||
| 4862 | (for-each delete-file-recursively | ||
| 4863 | (list "macres" | ||
| 4864 | "miniz" | ||
| 4865 | "Xcode")))) | ||
| 4866 | (patches (search-patches "maelstrom-use-system-physfs.patch")))) | ||
| 4867 | (build-system cmake-build-system) | ||
| 4868 | (arguments | ||
| 4869 | (list | ||
| 4870 | #:configure-flags | ||
| 4871 | #~(list "-DSTEAM=OFF" | ||
| 4872 | "-DUSE_VENDORED_SDL=OFF" | ||
| 4873 | "-DSTANDALONE_INSTALL=OFF") | ||
| 4874 | #:tests? #f)) ;no testes | ||
| 4875 | (native-inputs (list pkg-config)) | ||
| 4876 | (inputs (list miniz physfs physfs-sdl3 sdl3 sdl3-net)) | ||
| 4877 | (home-page "https://github.com/libsdl-org/Maelstrom") | ||
| 4878 | (synopsis "Asteroids game") | ||
| 4879 | (description | ||
| 4880 | "You pilot your ship through the dreaded \"Maelstrom\" asteroid belt | ||
| 4881 | -- suddenly your best friend thrusts towards you and fires, directly at your | ||
| 4882 | cockpit. You raise your shields just in time, and the battle is joined. | ||
| 4883 | |||
| 4884 | Maelstrom is a free software port of the original shareware game for the | ||
| 4885 | Macintosh by Ambrosia Software, Inc. It is a fast-action, asteroids-like game, | ||
| 4886 | with classic pixel graphics and original sounds. | ||
| 4887 | |||
| 4888 | In addition to being a faithful reproduction of the original game, this version | ||
| 4889 | adds game controller support, mobile touch controls, and both cooperative and | ||
| 4890 | competitive multiplayer action.") | ||
| 4891 | (license (list license:zlib ;game code | ||
| 4892 | license:cc-by3.0)))) ;sprites, sounds, etc. | ||
| 4893 | |||
| 4828 | (define-public alienblaster | 4894 | (define-public alienblaster |
| 4829 | (package | 4895 | (package |
| 4830 | (name "alienblaster") | 4896 | (name "alienblaster") |
diff --git a/gnu/packages/patches/maelstrom-use-system-physfs.patch b/gnu/packages/patches/maelstrom-use-system-physfs.patch new file mode 100644 index 00000000000..12f02076111 --- /dev/null +++ b/gnu/packages/patches/maelstrom-use-system-physfs.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | Use system physfs and physfs-sdl3 instead of the vendored copy. | ||
| 2 | |||
| 3 | This patch switches Maelstrom from using bundled physfs and physfssdl3 | ||
| 4 | to using the system packages found via pkg-config. | ||
| 5 | |||
| 6 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 7 | --- a/CMakeLists.txt 2026-05-20 09:21:15.747350351 -0300 | ||
| 8 | +++ b/CMakeLists.txt 2026-05-20 09:25:32.336090395 -0300 | ||
| 9 | @@ -26,9 +26,9 @@ | ||
| 10 | set(SDL_EMSCRIPTEN_PERSISTENT_PATH /storage) | ||
| 11 | endif() | ||
| 12 | |||
| 13 | -set(PHYSFS_BUILD_SHARED OFF) | ||
| 14 | -set(PHYSFS_BUILD_TEST OFF) | ||
| 15 | -add_subdirectory(external/physfs EXCLUDE_FROM_ALL) | ||
| 16 | +find_package(PkgConfig REQUIRED) | ||
| 17 | +pkg_check_modules(PHYSFS REQUIRED IMPORTED_TARGET physfs) | ||
| 18 | +pkg_check_modules(PHYSFSSDL3 REQUIRED IMPORTED_TARGET physfs-sdl3) | ||
| 19 | |||
| 20 | option(USE_VENDORED_SDL "Use the vendored version of SDL" TRUE) | ||
| 21 | if (USE_VENDORED_SDL) | ||
| 22 | @@ -163,8 +163,6 @@ | ||
| 23 | utils/rapidxml.h | ||
| 24 | utils/rapidxml.hpp | ||
| 25 | |||
| 26 | - external/physfs/extras/physfssdl3.c | ||
| 27 | - | ||
| 28 | miniz/miniz.c | ||
| 29 | |||
| 30 | Maelstrom.rc | ||
| 31 | @@ -224,7 +222,8 @@ | ||
| 32 | endif() | ||
| 33 | |||
| 34 | target_link_libraries(Maelstrom PRIVATE SDLmac) | ||
| 35 | -target_link_libraries(Maelstrom PRIVATE physfs-static) | ||
| 36 | +target_link_libraries(Maelstrom PRIVATE PkgConfig::PHYSFS) | ||
| 37 | +target_link_libraries(Maelstrom PRIVATE PkgConfig::PHYSFSSDL3) | ||
| 38 | target_link_libraries(Maelstrom PRIVATE SDL3_net::SDL3_net) | ||
| 39 | target_link_libraries(Maelstrom PRIVATE SDL3::SDL3) \ No newline at end of file | ||
