From 0048a70ed05f704e2d620c5033bbb0799d025afc Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Fri, 15 Feb 2019 05:26:34 +0100
Subject: [PATCH 01/25] gnu: yamagi-quake2: Update to 7.40.
* gnu/packages/games.scm (yamagi-quake2): Update to 7.40.
[arguments]: Drop removed DLOPEN_OPENAL from #:make-flags and add a new
'embed-library-path' phase to link it by hand.
[inputs]: Add curl.
---
gnu/packages/games.scm | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
@@ -5023,36 +5023,43 @@ some graphical niceities, and numerous bug-fixes and other improvements.")
(define-public yamagi-quake2
(package
(name "yamagi-quake2")
- (version "7.10")
+ (version "7.40")
(source
(origin
(method url-fetch)
(uri (string-append "https://deponie.yamagi.org/quake2/quake2-"
version ".tar.xz"))
(sha256
- (base32
- "0psinbg25mysd58k99s1n34w31w5hj1vppb39gdjb0zqi6sl6cps"))))
+ (base32 "0aci73r15m1wbkrhpysxzdg77a294ywxfkd141gi5qgc2lwbsbqw"))))
(build-system gnu-build-system)
(arguments
`(#:tests? #f
#:make-flags
(list "CC=gcc"
- ;; link openAL instead of using dlopen at runtime
- "DLOPEN_OPENAL=\"no\""
- ;; an optional directory where it will look for quake2 data files
- ;; in addition to the current working directory
+ ;; An optional directory where it will look for quake2 data files
+ ;; in addition to the current working directory.
"WITH_SYSTEMWIDE=yes"
"WITH_SYSTEMDIR=\"/opt/quake2\"")
#:phases
(modify-phases %standard-phases
- (delete 'configure)
+ (delete 'configure) ; no configure script
+ (add-after 'unpack 'embed-library-path
+ ;; The option (DLOPEN_OPENAL=no) to link the OpenAL library at
+ ;; compile time was removed. Pass an absolute file name to
+ ;; Sys_LoadLibrary to emulate it.
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((openal (assoc-ref inputs "openal")))
+ (substitute* "Makefile"
+ (("libopenal\\.so\\.[^\"]*" name)
+ (string-append openal "/lib/" name)))
+ #t)))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(mkdir-p (string-append out "/lib"))
(mkdir-p (string-append out "/bin"))
;; The yamagi-quake2 binary must be in the same directory
- ;; as it's engine libraries, but symlinking it to /bin is okay
+ ;; as its engine libraries, but symlinking it to /bin is okay.
;; https://github.com/yquake2/yquake2/blob/master/stuff/packaging.md
(copy-recursively "release"
(string-append out "/lib/yamagi-quake2"))
@@ -5060,7 +5067,8 @@ some graphical niceities, and numerous bug-fixes and other improvements.")
(string-append out "/bin/yamagi-quake2"))
(symlink (string-append out "/lib/yamagi-quake2/q2ded")
(string-append out "/bin/yamagi-q2ded"))))))))
- (inputs `(("sdl2" ,sdl2)
+ (inputs `(("curl" ,curl)
+ ("sdl2" ,sdl2)
("mesa" ,mesa)
("libvorbis" ,libvorbis)
("zlib" ,zlib)
--
2.20.1
nee wrote: > Subject: [PATCH] gnu: yamagi-quake2: Update to 7.40. It's unfortunately not that simple. :-( This version completely changes how it loads OpenAL. The attached patch keeps everything working, but embeds an absolute store reference in the user's configuration file after the first run: λ grep /gnu/store ~/.yq2/baseq2/config.cfg set al_driver "/gnu/store/…-openal-1.19.1/lib/libopenal.so.1" Any ideas, anyone? T G-R