diff --git a/nongnu/packages/game-development.scm b/nongnu/packages/game-development.scm index 068fe833..aeee49b3 100644 --- a/nongnu/packages/game-development.scm +++ b/nongnu/packages/game-development.scm @@ -20,6 +20,7 @@ #:use-module ((guix licenses) :prefix license:) #:use-module (gnu packages audio) #:use-module (gnu packages base) + #:use-module (gnu packages compression) #:use-module (gnu packages gcc) #:use-module (gnu packages gl) #:use-module (gnu packages gtk) @@ -272,6 +273,43 @@ improvements, that works (mostly) hassle-free on multiple platforms.") (license:nonfree "https://raw.githubusercontent.com/alexbatalov/fallout1-ce/main/LICENSE.md")))) +(define-public fallout2-ce + (package + (name "fallout2-ce") + (version "1.3.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/alexbatalov/fallout2-ce") + (commit (string-append "v" version)))) + (patches (nongnu-patches "fallout2-ce-unbundle-fpattern.patch")) + (sha256 + (base32 "15b30i2ixq0w01qxrymd1qs1awj8kijbqzac8wvfrpm85fdnfnmg")))) + (build-system cmake-build-system) + (arguments + (list + #:tests? #f + #:phases #~(modify-phases %standard-phases + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (mkdir-p bin) + (copy-file "fallout2-ce" + (string-append bin "/fallout2-ce")))))))) + (inputs (list sdl2 fpattern zlib)) + (home-page "https://github.com/alexbatalov/fallout2-ce") + (synopsis + "Fallout 2 Community Edition is an engine rewrite for modern OS") + (description + "Fallout 2 Community Edition is a fully working re-implementation of +Fallout 2, with the same original gameplay, engine bugfixes, and some quality of +life improvements, that works (mostly) hassle-free on multiple platforms.") + (license + (license:nonfree + "https://raw.githubusercontent.com/alexbatalov/fallout2-ce/main/LICENSE.md")))) + (define-public fpattern (package (name "fpattern") diff --git a/nongnu/packages/patches/fallout2-ce-unbundle-fpattern.patch b/nongnu/packages/patches/fallout2-ce-unbundle-fpattern.patch new file mode 100644 index 00000000..bf26192b --- /dev/null +++ b/nongnu/packages/patches/fallout2-ce-unbundle-fpattern.patch @@ -0,0 +1,17 @@ +Originally fallout2-ce has the fpattern library bundled in the repo. +This patch unbundles it. + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2de2af1..f6c6ace 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -360,7 +360,8 @@ if(APPLE) + set(MACOSX_BUNDLE_BUNDLE_VERSION "1.3.0") + endif() + +-add_subdirectory("third_party/fpattern") ++find_library(FPATTERN_LIBRARY libfpattern.so) ++find_path(FPATTERN_INCLUDE_DIR fpattern.h) + target_link_libraries(${EXECUTABLE_NAME} ${FPATTERN_LIBRARY}) + target_include_directories(${EXECUTABLE_NAME} PRIVATE ${FPATTERN_INCLUDE_DIR}) +