gnu: adanaxisgpl: Build from Git.

* gnu/packages/games.scm (adanaxisgpl-mush): Remove variable.
(adanaxisgpl)[source]: Fetch from Git.  In the snippet, create missing
directories, arrange to create missing files, and don't explicitly
return #t.
[arguments]: Add an 'unpack-inputs phase, replace the default
'bootstrap, and remove 'install-data.
[native-inputs]: Remove adanaxis-mush.  Add adanaxis-data,
adanaxis-mushruby, autoconf, automake, and perl.
This commit is contained in:
Tobias Geerinckx-Rice 2023-07-16 02:00:01 +02:00
parent d133ad7645
commit f43794e573
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79

View File

@ -24,7 +24,7 @@
;;; Copyright © 2016 Steve Webber <webber.sl@gmail.com> ;;; Copyright © 2016 Steve Webber <webber.sl@gmail.com>
;;; Copyright © 2017 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@hyperbola.info> ;;; Copyright © 2017 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@hyperbola.info>
;;; Copyright © 2017, 2018, 2020 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2017, 2018, 2020 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 20172022 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 20172023 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017, 2019 nee <nee-git@hidamari.blue> ;;; Copyright © 2017, 2019 nee <nee-git@hidamari.blue>
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2017, 2019, 2020 Marius Bakke <mbakke@fastmail.com> ;;; Copyright © 2017, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
@ -303,27 +303,23 @@ platform-jumping, key-collecting, ancient pyramid exploring game, vaguely in
the style of similar games for the Commodore+4.") the style of similar games for the Commodore+4.")
(license license:gpl2+))) (license license:gpl2+)))
;; Data package for adanaxisgpl.
(define adanaxis-mush
(let ((version "1.1.0"))
(origin
(method url-fetch)
(uri (string-append "http://www.mushware.com/files/adanaxis-mush-"
version ".tar.gz"))
(sha256
(base32 "0mk9ibis5nkdcalcg1lkgnsdxxbw4g5w2i3icjzy667hqirsng03")))))
(define-public adanaxisgpl (define-public adanaxisgpl
(let* ((version "1.2.5")
(commit (string-append "ADANAXIS_"
(string-join (string-split version #\.) "_")
"_RELEASE_X11")))
(package (package
(name "adanaxisgpl") (name "adanaxisgpl")
(version "1.2.5") (version version)
(source (source
(origin (origin
(method url-fetch) (method git-fetch)
(uri (string-append "http://www.mushware.com/files/adanaxisgpl-" (uri (git-reference
version ".tar.gz")) (url "https://github.com/mushware/adanaxis")
(commit commit)))
(file-name (git-file-name name version))
(sha256 (sha256
(base32 "0jkn637jaabvlhd6hpvzb57vvjph94l6fbf7qxbjlw9zpr19dw1f")) (base32 "1vbg17lzbm0xl9yy9qymd1vgpz6f7fbr2hffl2ap0nm4zg0mnafm"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin '(begin
@ -334,24 +330,51 @@ the style of similar games for the Commodore+4.")
;; Avoid an "invalid conversion from const char* to char*" error. ;; Avoid an "invalid conversion from const char* to char*" error.
(substitute* "src/Platform/X11/PlatformMiscUtils.cpp" (substitute* "src/Platform/X11/PlatformMiscUtils.cpp"
(("char \\*end, \\*result;") (("char \\*end, \\*result;")
(string-append "const char *end;" (string-append "const char *end;\n"
"\n"
"char *result;"))) "char *result;")))
#t)))) ;; autogen.pl will throw misleading errors if these don't exist.
(for-each mkdir-p '("src/MushSecret" "data-adanaxis"))
;; Create these missing files at the right later moment.
(substitute* "autogen.pl"
(("automake")
"automake --add-missing"))))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:tests? #f ; no check target `(#:tests? #f ; no check target
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'install 'install-data (add-after 'unpack 'unpack-inputs
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((data (assoc-ref inputs "adanaxis-mush")) (copy-recursively (assoc-ref inputs "adanaxis-data")
(share (string-append (assoc-ref outputs "out") "data-adanaxis")
"/share/" ,name "-" ,version))) (copy-recursively (assoc-ref inputs "adanaxis-mushruby")
(mkdir-p share) "data-adanaxis/mushruby")))
(invoke "tar" "xvf" data "-C" share))))))) (replace 'bootstrap
(lambda _
(invoke "perl" "autogen.pl" "adanaxis"
"--type=gpl" "--dist=debian"))))))
(native-inputs (native-inputs
`(("adanaxis-mush" ,adanaxis-mush))) ; game data `(("adanaxis-data"
,(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/mushware/adanaxis-data")
(commit commit)))
(file-name (git-file-name "adanaxis-data" version))
(sha256
(base32 "1xkn0ap5kfqd306ac072406ajihwwllaczc2v2hxiadlxd191dgx"))))
("adanaxis-mushruby"
,(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/mushware/adanaxis-mushruby")
(commit commit)))
(file-name (git-file-name "adanaxis-mushruby" version))
(sha256
(base32 "0pzcvchysjj37420rpvarky580gi5d6pfv93kwa91rg6m5r1zwks"))))
("autoconf" ,autoconf)
("automake" ,automake)
("perl" ,perl)))
(inputs (inputs
`(("expat" ,expat) `(("expat" ,expat)
("freeglut" ,freeglut) ("freeglut" ,freeglut)
@ -375,7 +398,7 @@ six planes of rotation. Initially the game explains the 4D control system via
a graphical sequence, before moving on to 30 levels of gameplay with numerous a graphical sequence, before moving on to 30 levels of gameplay with numerous
enemy, ally, weapon and mission types. Features include simulated 4D texturing, enemy, ally, weapon and mission types. Features include simulated 4D texturing,
mouse and joystick control, and original music.") mouse and joystick control, and original music.")
(license license:gpl2))) (license license:gpl2))))
(define-public alex4 (define-public alex4
(package (package