gnu: yamagi-quake2: Patch dynamically loaded libraries.
* gnu/packages/games.scm (yamagi-quake2) [arguments]{make-flags}: Remove the DLOPEN_OPENAL=no make flag, which was not working as intended. [phases]{patch-libraries}: New phase. Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
parent
f8f096d1e8
commit
c64c49b152
1 changed files with 15 additions and 4 deletions
|
@ -7209,15 +7209,26 @@ some graphical niceities, and numerous bug-fixes and other improvements.")
|
||||||
`(#:tests? #f
|
`(#:tests? #f
|
||||||
#:make-flags
|
#:make-flags
|
||||||
(list "CC=gcc"
|
(list "CC=gcc"
|
||||||
;; link openAL instead of using dlopen at runtime
|
;; An optional directory where it will look for quake2 data files
|
||||||
"DLOPEN_OPENAL=\"no\""
|
;; 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_SYSTEMWIDE=yes"
|
||||||
"WITH_SYSTEMDIR=\"/opt/quake2\"")
|
"WITH_SYSTEMDIR=\"/opt/quake2\"")
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
(delete 'configure)
|
(delete 'configure)
|
||||||
|
(add-before 'build 'patch-libraries
|
||||||
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
|
;; The game writes paths to openal.so and curl.so to ~/.yq2/...
|
||||||
|
;; Workaround: hard-code the compiled paths where it loads them;
|
||||||
|
;; this prevents loading old or garbage collected libraries.
|
||||||
|
(substitute* "src/client/sound/qal.c"
|
||||||
|
(("al_driver->string")
|
||||||
|
(string-append "\"" (assoc-ref inputs "openal")
|
||||||
|
"/lib/libopenal.so\"")))
|
||||||
|
(substitute* "src/client/curl/qcurl.c"
|
||||||
|
(("cl_libcurl->string")
|
||||||
|
(string-append "\"" (assoc-ref inputs "curl")
|
||||||
|
"/lib/libcurl.so\"")))))
|
||||||
(replace 'install
|
(replace 'install
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(let ((out (assoc-ref outputs "out")))
|
(let ((out (assoc-ref outputs "out")))
|
||||||
|
|
Reference in a new issue