From 01b58d81f324daa716f18140f2be1f7ec79bb8d8 Mon Sep 17 00:00:00 2001 From: Rodion Goritskov Date: Mon, 13 May 2024 22:22:28 +0400 Subject: gnu: Add fallout2-ce. * rodion/packages/fpattern.patch (fallout2-ce): New variable. --- rodion/packages/fpattern.patch | 15 ---------- rodion/packages/games.scm | 35 +++++++++++++++++++++- .../patches/0001-fallout-ce-fpattern.patch | 15 ++++++++++ .../patches/0001-fallout2-ce-fpattern.patch | 14 +++++++++ 4 files changed, 63 insertions(+), 16 deletions(-) delete mode 100644 rodion/packages/fpattern.patch create mode 100644 rodion/packages/patches/0001-fallout-ce-fpattern.patch create mode 100644 rodion/packages/patches/0001-fallout2-ce-fpattern.patch (limited to 'rodion') diff --git a/rodion/packages/fpattern.patch b/rodion/packages/fpattern.patch deleted file mode 100644 index d2772c5..0000000 --- a/rodion/packages/fpattern.patch +++ /dev/null @@ -1,15 +0,0 @@ -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}) - diff --git a/rodion/packages/games.scm b/rodion/packages/games.scm index 749806f..e81fe26 100644 --- a/rodion/packages/games.scm +++ b/rodion/packages/games.scm @@ -5,6 +5,7 @@ #:use-module (guix git-download) #:use-module (guix gexp) #:use-module (gnu packages sdl) + #:use-module (gnu packages compression) #:use-module ((guix licenses) #:prefix license:)) (define-public fpattern @@ -62,9 +63,41 @@ Filename patterns are composed of regular (printable) characters which may compr (uri (git-reference (url "https://github.com/alexbatalov/fallout1-ce") (commit (string-append "v" version)))) - (patches `(,(local-file "./fpattern.patch"))) + (patches `(,(local-file "./patches/0001-fallout-ce-fpattern.patch"))) (sha256 (base32 "0c11zbvja42s0z8zqfm6gf981m0v2vwxvhqas46lplwbfhbnh836")))) (license license:expat) (description "Fallout") (synopsis "Fallout"))) + +(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/0001-fallout2-ce-fpattern.patch"))) + (sha256 + (base32 "15b30i2ixq0w01qxrymd1qs1awj8kijbqzac8wvfrpm85fdnfnmg")))) + (license license:expat) + (description "Fallout") + (synopsis "Fallout"))) diff --git a/rodion/packages/patches/0001-fallout-ce-fpattern.patch b/rodion/packages/patches/0001-fallout-ce-fpattern.patch new file mode 100644 index 0000000..d2772c5 --- /dev/null +++ b/rodion/packages/patches/0001-fallout-ce-fpattern.patch @@ -0,0 +1,15 @@ +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}) + diff --git a/rodion/packages/patches/0001-fallout2-ce-fpattern.patch b/rodion/packages/patches/0001-fallout2-ce-fpattern.patch new file mode 100644 index 0000000..6c58e7e --- /dev/null +++ b/rodion/packages/patches/0001-fallout2-ce-fpattern.patch @@ -0,0 +1,14 @@ +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}) + -- cgit v1.2.3