From 7c8ddd36fba51ce259be86703b13290021a0d217 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Mon, 1 May 2023 14:16:23 +0200 Subject: Build pak128 completely from source --- tw/packages/games.scm | 74 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 25 deletions(-) (limited to 'tw/packages') diff --git a/tw/packages/games.scm b/tw/packages/games.scm index 22883318..cb4000f9 100644 --- a/tw/packages/games.scm +++ b/tw/packages/games.scm @@ -26,6 +26,7 @@ #:use-module (gnu packages serialization) #:use-module (gnu packages textutils) #:use-module (gnu packages tls) + #:use-module (gnu packages version-control) #:use-module (gnu packages xorg) #:use-module (guix build utils) #:use-module (guix build-system copy) @@ -44,31 +45,6 @@ ;; Simutrans -(define-public simutrans-pak128 - ;; Install paks as propagated-inputs of simutrans, so they go in - ;; Simutrans' data directory, where Simutrans expects them. - (package - (name "simutrans-pak128") ; note: needs simutrans >= 123 - (version "2.8.2") - (source (origin - (method url-fetch) - (uri (string-append - "mirror://sourceforge/simutrans/pak128/" - "pak128%202.8.2%20for%20ST%20123up/simupak128-2.8.2-for123.zip")) - (sha256 (base32 "0hzpb6bh1lh0fdcpxlbfw5j74xz65gxl8yx5094rqf5zflvz10py")))) - (native-inputs (list unzip)) ; shouldn't copy-build-system / origin handle this? - (build-system copy-build-system) - (arguments '(#:install-plan '(("pak128" "share/games/simutrans/pak128")))) - (home-page "https://forum.simutrans.com/index.php?board=26.0") - (synopsis "Graphical pak set for Simutrans, 128x128 tile size") - (description - (string-append - "When Simutrans could only support 64px size graphics, pak128 already started. " - "First pak to feature a complex economy and have a very wide variety of objects. " - "It contains roughly 7 times more graphic data than pak64 and thus requires by far " - "the largest amount of RAM and processing power of all Simutrans sets.")) - (license license:artistic2.0))) - (define-public simutrans ;; Based off the Arch Linux package: ;; https://github.com/archlinux/svntogit-community/blob/packages/simutrans/trunk/PKGBUILD @@ -170,6 +146,54 @@ Install a @code{simutrans-with-pak*} package instead.") (description "@code{makeobj} compiles images and configuration files into addons for the Simutrans game, as @code{.pak} files."))) +(define-public simutrans-pak128 + (let ((version "2.8.2") ; last tagged version + (revision "39") ; number of commits since last tagged version + (commit "02ff45afdd3003c258c45aeb3d28b3b25f10172e")) ; latest as of 2023-04-30 + (package + (name "simutrans-pak128-from-source") ; note: needs simutrans >= 123 + (version (git-version version revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/simutrans/pak128") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 (base32 "0jg5yc769xrn22wn29ch0nz414xv518cdwkpk6makb14kh6zpdz4")))) + (native-inputs (list simutrans-makeobj zip git)) + (build-system gnu-build-system) + (arguments + `(#:make-flags '("all") ; the "all" target builds the pak and installs it + #:parallel-build? #f ; don't run "rm" in parallel with builds + #:phases + ,#~(modify-phases %standard-phases + (delete 'bootstrap) + (delete 'configure) + (replace 'build + (lambda* (#:key inputs outputs (make-flags '()) (parallel-build? #t) + #:allow-other-keys) + (let ((makeobj (search-input-file inputs "bin/makeobj")) + (out (assoc-ref outputs "out"))) + ((assoc-ref %standard-phases 'build) + #:make-flags + (cons* (string-append "MAKEOBJ=" makeobj) + ;; Makefile adds /pak128 to DESTDIR. + (string-append "DESTDIR=" out "/share/games/simutrans") + (string-append "PAKID=pak128 " #$version " for " #$(package-version simutrans)) + make-flags) + #:parallel-build? parallel-build?)))) + (delete 'check) + (delete 'install)))) + (home-page "https://forum.simutrans.com/index.php?board=26.0") + (synopsis "Graphical pak set for Simutrans, 128x128 tile size") + (description + (string-append + "When Simutrans could only support 64px size graphics, pak128 already started. " + "First pak to feature a complex economy and have a very wide variety of objects. " + "It contains roughly 7 times more graphic data than pak64 and thus requires by far " + "the largest amount of RAM and processing power of all Simutrans sets.")) + (license license:artistic2.0)))) + ;; See also: `sdl-union' in (gnu packages sdl). (define* (simutrans-pak-union name #:optional (paksets (list simutrans-pak128)) (base-game simutrans)) -- cgit v1.2.3