* [bug#34879] [PATCH] gnu: yamagi-quake2: Update to 7.40.
@ 2019-03-15 23:19 nee
2019-03-16 5:09 ` Tobias Geerinckx-Rice
0 siblings, 1 reply; 4+ messages in thread
From: nee @ 2019-03-15 23:19 UTC (permalink / raw)
To: 34879
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-yamagi-quake2-Update-to-7.40.patch --]
[-- Type: text/x-patch; name="0001-gnu-yamagi-quake2-Update-to-7.40.patch", Size: 1604 bytes --]
From 5e4226b938a4a1af2db3dcc9db0f637ed1dbd4cd Mon Sep 17 00:00:00 2001
From: nee <nee-git@hidamari.blue>
Date: Fri, 15 Mar 2019 20:56:47 +0100
Subject: [PATCH] gnu: yamagi-quake2: Update to 7.40.
* gnu/packages/games.scm (yamagi-quake2): Update to 7.40.
[inputs]: Add curl.
---
gnu/packages/games.scm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 46b58e352c..2ad9cebf50 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -5023,7 +5023,7 @@ 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)
@@ -5031,7 +5031,7 @@ some graphical niceities, and numerous bug-fixes and other improvements.")
version ".tar.xz"))
(sha256
(base32
- "0psinbg25mysd58k99s1n34w31w5hj1vppb39gdjb0zqi6sl6cps"))))
+ "0aci73r15m1wbkrhpysxzdg77a294ywxfkd141gi5qgc2lwbsbqw"))))
(build-system gnu-build-system)
(arguments
`(#:tests? #f
@@ -5064,6 +5064,7 @@ some graphical niceities, and numerous bug-fixes and other improvements.")
("mesa" ,mesa)
("libvorbis" ,libvorbis)
("zlib" ,zlib)
+ ("curl" ,curl)
("openal" ,openal)))
(native-inputs `(("pkg-config" ,pkg-config)))
(synopsis "First person shooter engine based on quake2")
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [bug#34879] [PATCH] gnu: yamagi-quake2: Update to 7.40.
2019-03-15 23:19 [bug#34879] [PATCH] gnu: yamagi-quake2: Update to 7.40 nee
@ 2019-03-16 5:09 ` Tobias Geerinckx-Rice
2019-04-01 21:15 ` nee
0 siblings, 1 reply; 4+ messages in thread
From: Tobias Geerinckx-Rice @ 2019-03-16 5:09 UTC (permalink / raw)
To: nee; +Cc: 34879
[-- Attachment #1: Type: text/plain, Size: 461 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-yamagi-quake2-Update-to-7.40.patch --]
[-- Type: text/x-patch, Size: 3696 bytes --]
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(-)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 46b58e352c..e7102a0403 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [bug#34879] [PATCH] gnu: yamagi-quake2: Update to 7.40.
2019-03-16 5:09 ` Tobias Geerinckx-Rice
@ 2019-04-01 21:15 ` nee
2021-08-06 4:04 ` bug#34879: " Maxim Cournoyer
0 siblings, 1 reply; 4+ messages in thread
From: nee @ 2019-04-01 21:15 UTC (permalink / raw)
To: me, 34879
[-- Attachment #1: Type: text/plain, Size: 1336 bytes --]
Hello, thank you for the review!
Am 16.03.19 um 06:09 schrieb Tobias Geerinckx-Rice:
> 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"
Good job spotting that, how do you get it to generate that though? I
thought I didn't have it, because I had an old config, but now I moved
mine and it still doesn't appear.
Anyway, I looked at the code and curl seems to load the same way.
>
> Any ideas, anyone?
>
I think it's the best to just hard-code the path where it loads those
libraries. That prevents it from loading outdated or garbage collected
ones before the compiled one. Also curl doesn't have a default fallback
in the Makefile.
Try the new patch and do this to the config:
echo 'set al_driver "/tmp/non-existing-garbage-collected-library"' >>
~/.yq2/baseq2/config.cfg
echo 'set cl_libcurl "/tmp/non-existing-garbage-collected-library"' >>
~/.yq2/baseq2/config.cfg
I tested this new patch and the old patch, and the new one works while
the old one logs to stdout that failed to load curl and openal with that
config and falls back to sdl-audio.
Happy hacking!
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-yamagi-quake2-Update-to-7.40.patch --]
[-- Type: text/x-patch; name="0001-gnu-yamagi-quake2-Update-to-7.40.patch", Size: 4257 bytes --]
From a268a6d5390e562f4ed5cc28784f7d83a2eb6f9d Mon Sep 17 00:00:00 2001
From: nee <nee-git@hidamari.blue>
Date: Fri, 15 Mar 2019 20:56:47 +0100
Subject: [PATCH] gnu: yamagi-quake2: Update to 7.40.
* gnu/packages/games.scm (yamagi-quake2): Update to 7.40.
[arguments](phases): Add 'hard-code-dynamicly-loaded-libs phase.
[inputs]: Add curl.
---
gnu/packages/games.scm | 34 +++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 11 deletions(-)
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 46b58e352c..69e259f044 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -5023,7 +5023,7 @@ 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)
@@ -5031,28 +5031,39 @@ some graphical niceities, and numerous bug-fixes and other improvements.")
version ".tar.xz"))
(sha256
(base32
- "0psinbg25mysd58k99s1n34w31w5hj1vppb39gdjb0zqi6sl6cps"))))
+ "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)
+ (add-before 'build 'hard-code-dynamicly-loaded-libs
+ (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 load them,
+ ;; this prevents loading old or a 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
(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,11 +5071,12 @@ 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)
- ("mesa" ,mesa)
+ (inputs `(("curl" ,curl)
("libvorbis" ,libvorbis)
- ("zlib" ,zlib)
- ("openal" ,openal)))
+ ("mesa" ,mesa)
+ ("openal" ,openal)
+ ("sdl2" ,sdl2)
+ ("zlib" ,zlib)))
(native-inputs `(("pkg-config" ,pkg-config)))
(synopsis "First person shooter engine based on quake2")
(description "Yamagi Quake II is an enhanced client for id Software's Quake II.
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#34879: [PATCH] gnu: yamagi-quake2: Update to 7.40.
2019-04-01 21:15 ` nee
@ 2021-08-06 4:04 ` Maxim Cournoyer
0 siblings, 0 replies; 4+ messages in thread
From: Maxim Cournoyer @ 2021-08-06 4:04 UTC (permalink / raw)
To: nee; +Cc: 34879-done, me
Hi!
nee <nee-git@hidamari.blue> writes:
[...]
> I think it's the best to just hard-code the path where it loads those
> libraries. That prevents it from loading outdated or garbage collected
> ones before the compiled one. Also curl doesn't have a default fallback
> in the Makefile.
>
> Try the new patch and do this to the config:
> echo 'set al_driver "/tmp/non-existing-garbage-collected-library"' >>
> ~/.yq2/baseq2/config.cfg
> echo 'set cl_libcurl "/tmp/non-existing-garbage-collected-library"' >>
> ~/.yq2/baseq2/config.cfg
>
> I tested this new patch and the old patch, and the new one works while
> the old one logs to stdout that failed to load curl and openal with that
> config and falls back to sdl-audio.
>
> Happy hacking!
>
> From a268a6d5390e562f4ed5cc28784f7d83a2eb6f9d Mon Sep 17 00:00:00 2001
> From: nee <nee-git@hidamari.blue>
> Date: Fri, 15 Mar 2019 20:56:47 +0100
> Subject: [PATCH] gnu: yamagi-quake2: Update to 7.40.
>
> * gnu/packages/games.scm (yamagi-quake2): Update to 7.40.
> [arguments](phases): Add 'hard-code-dynamicly-loaded-libs phase.
> [inputs]: Add curl.
> ---
> gnu/packages/games.scm | 34 +++++++++++++++++++++++-----------
> 1 file changed, 23 insertions(+), 11 deletions(-)
>
> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index 46b58e352c..69e259f044 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -5023,7 +5023,7 @@ some graphical niceities, and numerous bug-fixes and other improvements.")
> (define-public yamagi-quake2
> (package
> (name "yamagi-quake2")
> - (version "7.10")
> + (version "7.40")
We're now at 7.45 on master but loading the OpenAL library was
failing...
[...]
> - ;; 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)
> + (add-before 'build 'hard-code-dynamicly-loaded-libs
> + (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 load them,
> + ;; this prevents loading old or a 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\"")))))
... until I applied the above forgotten patch! Finally applied as
c64c49b152.
Thank you!
Closing.
Maxim
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-08-06 4:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-15 23:19 [bug#34879] [PATCH] gnu: yamagi-quake2: Update to 7.40 nee
2019-03-16 5:09 ` Tobias Geerinckx-Rice
2019-04-01 21:15 ` nee
2021-08-06 4:04 ` bug#34879: " Maxim Cournoyer
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.