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 © 2017 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@hyperbola.info>
;;; 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 Clément Lassieur <clement@lassieur.org>
;;; 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.")
(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
(let* ((version "1.2.5")
(commit (string-append "ADANAXIS_"
(string-join (string-split version #\.) "_")
"_RELEASE_X11")))
(package
(name "adanaxisgpl")
(version "1.2.5")
(version version)
(source
(origin
(method url-fetch)
(uri (string-append "http://www.mushware.com/files/adanaxisgpl-"
version ".tar.gz"))
(method git-fetch)
(uri (git-reference
(url "https://github.com/mushware/adanaxis")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32 "0jkn637jaabvlhd6hpvzb57vvjph94l6fbf7qxbjlw9zpr19dw1f"))
(base32 "1vbg17lzbm0xl9yy9qymd1vgpz6f7fbr2hffl2ap0nm4zg0mnafm"))
(modules '((guix build utils)))
(snippet
'(begin
@ -334,24 +330,51 @@ the style of similar games for the Commodore+4.")
;; Avoid an "invalid conversion from const char* to char*" error.
(substitute* "src/Platform/X11/PlatformMiscUtils.cpp"
(("char \\*end, \\*result;")
(string-append "const char *end;"
"\n"
(string-append "const char *end;\n"
"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)
(arguments
`(#:tests? #f ; no check target
#:phases
(modify-phases %standard-phases
(add-after 'install 'install-data
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((data (assoc-ref inputs "adanaxis-mush"))
(share (string-append (assoc-ref outputs "out")
"/share/" ,name "-" ,version)))
(mkdir-p share)
(invoke "tar" "xvf" data "-C" share)))))))
(add-after 'unpack 'unpack-inputs
(lambda* (#:key inputs #:allow-other-keys)
(copy-recursively (assoc-ref inputs "adanaxis-data")
"data-adanaxis")
(copy-recursively (assoc-ref inputs "adanaxis-mushruby")
"data-adanaxis/mushruby")))
(replace 'bootstrap
(lambda _
(invoke "perl" "autogen.pl" "adanaxis"
"--type=gpl" "--dist=debian"))))))
(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
`(("expat" ,expat)
("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
enemy, ally, weapon and mission types. Features include simulated 4D texturing,
mouse and joystick control, and original music.")
(license license:gpl2)))
(license license:gpl2))))
(define-public alex4
(package