Merge branch 'master' into 'master'

nongnu: Add fallout1-ce and fallout2-ce.

See merge request nonguix/nonguix!511
This commit is contained in:
Rodion Goritskov 2025-02-15 22:41:14 +00:00
commit 24a4bc2f96
3 changed files with 142 additions and 1 deletions

View File

@ -9,6 +9,8 @@
#:use-module ((nonguix licenses) :prefix license:)
#:use-module (guix packages)
#:use-module (nonguix build-system binary)
#:use-module (guix build-system cmake)
#:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
#:use-module (guix download)
#:use-module (guix gexp)
@ -17,6 +19,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)
@ -232,6 +235,109 @@ with game files or or put @file{.grp} game files manually in
(list license:gpl2
(license:nonfree "file://package/common/buildlic.txt")))))
(define-public fallout1-ce
(package
(name "fallout1-ce")
(version "1.1.0")
(build-system cmake-build-system)
(home-page "https://github.com/alexbatalov/fallout1-ce")
(inputs (list sdl2 fpattern))
(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 "fallout-ce"
(string-append bin "/fallout1-ce"))))))))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/alexbatalov/fallout1-ce")
(commit (string-append "v" version))))
(patches `(,(local-file "./patches/fallout1-ce-fpattern.patch")))
(sha256
(base32 "0c11zbvja42s0z8zqfm6gf981m0v2vwxvhqas46lplwbfhbnh836"))))
(license (license:nonfree
"https://raw.githubusercontent.com/alexbatalov/fallout1-ce/main/LICENSE.md"))
(description
"Fallout Community Edition is a fully working re-implementation of Fallout,
with the same original gameplay, engine bugfixes, and some quality of life improvements,
that works (mostly) hassle-free on multiple platforms.")
(synopsis
"Fallout Community Edition is an engine rewrite for modern operating systems")))
(define-public fallout2-ce
(package
(name "fallout2-ce")
(version "1.3.0")
(build-system cmake-build-system)
(home-page "https://github.com/alexbatalov/fallout2-ce")
(inputs (list sdl2 fpattern zlib))
(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"))))))))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/alexbatalov/fallout2-ce")
(commit (string-append "v" version))))
(patches `(,(local-file "./patches/fallout2-ce-fpattern.patch")))
(sha256
(base32 "15b30i2ixq0w01qxrymd1qs1awj8kijbqzac8wvfrpm85fdnfnmg"))))
(license (license:nonfree
"https://raw.githubusercontent.com/alexbatalov/fallout2-ce/main/LICENSE.md"))
(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.")
(synopsis
"Fallout 2 Community Edition is the Fallout 2 engine rewrite for modern operating systems")))
(define-public fpattern
(package
(name "fpattern")
(version "1.9")
(build-system copy-build-system)
(home-page "https://github.com/Loadmaster/fpattern")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/Loadmaster/fpattern")
(commit (string-append "v" version))))
(sha256
(base32 "0lm5afk18a6m4wib4xvslik9zz00r36zvdrrgjbwd8d8550cq2zx"))))
(arguments
(list #:phases
#~(modify-phases %standard-phases
(add-before 'install 'build-library
(lambda* (#:key inputs #:allow-other-keys)
(invoke "gcc" "-c" "-Wall" "-fpic" "fpattern.c")
(invoke "gcc" "-shared" "-o" "libfpattern.so" "fpattern.o"))))
#:install-plan ''(("libfpattern.so" "lib/")
("fpattern.h" "include/"))))
(license license:expat)
(description "Filename pattern matching library functions")
(synopsis "Filename pattern matching library functions for DOS, Windows, and Unix.
Functions for matching filename patterns to filenames. Written in C. Provided as an object file (fpattern.so) and a header include source file (fpattern.h).
Filename patterns are composed of regular (printable) characters which may comprise a filename, as well as special pattern matching characters. A filename patterns is a special kind of regular expression, except that it is not as general and is designed to match only file and directory names instead of arbitrary text strings. The syntax is borrowed from Unix, and is a superset of the MS-DOS and Windows syntax.")))
(define-public fury
(package/inherit eduke32
(name "fury")
@ -249,7 +355,7 @@ with game files or or put @file{.grp} game files manually in
(lambda _
(install-file "fury" (string-append #$output "/bin"))))))))
(inputs
(alist-delete "libvpx" (package-inputs eduke32)))
(alist-delete "libvpx" (package-inputs eduke32)))
(synopsis "Game engine for the first-person shooter Ion Fury")
(description
"This is the @code{eduke32} engine built with support for the Ion Fury

View File

@ -0,0 +1,18 @@
Originally fallout1-ce has the fpattern library bundled in the repo.
This patch unbundles it.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd50a9e..afdb04c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -353,7 +353,9 @@ else()
find_package(SDL2)
endif()
-add_subdirectory("third_party/fpattern")
+find_path(FPATTERN_INCLUDE_DIR fpattern.h)
+find_library(FPATTERN_LIBRARY libfpattern.so)
+
target_link_libraries(${EXECUTABLE_NAME} ${FPATTERN_LIBRARY})
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${FPATTERN_INCLUDE_DIR})

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