nongnu: Add fallout2-ce.

* nongnu/packages/game-development.scm (fallout2-ce): New variable.
This commit is contained in:
Rodion Goritskov 2025-04-01 22:15:34 +02:00
parent b456314d9f
commit 007be48174
No known key found for this signature in database
GPG key ID: 3A071A952839DB19
2 changed files with 55 additions and 0 deletions

View file

@ -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")

View file

@ -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})