diff mbox series

[bug#39825] gnu: Add warsow-qfusion.

Message ID 20200228160451.22644-1-mail@ambrevar.xyz
State Accepted
Headers show
Series [bug#39825] gnu: Add warsow-qfusion. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Pierre Neidhardt Feb. 28, 2020, 4:04 p.m. UTC
* gnu/packages/game-development.scm (warsow-qfusion): New variable.
* gnu/packages/patches/warsow-fix-bool-return-type.patch: New file.
* gnu/local.mk: Add patch.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/game-development.scm             | 49 +++++++++++++++++++
 .../patches/warsow-fix-bool-return-type.patch | 24 +++++++++
 3 files changed, 74 insertions(+)
 create mode 100644 gnu/packages/patches/warsow-fix-bool-return-type.patch

Comments

Nicolas Goaziou Feb. 29, 2020, 7:13 p.m. UTC | #1
Hello,

Pierre Neidhardt <mail@ambrevar.xyz> writes:

> +(define-public warsow-qfusion

Thank you!

> +  (let ((commit "5ec6887887850fa9e6f0a4418ab2b776f54fb395"))
> +    (package
> +      (name "warsow-qfusion")
> +      (version (git-version "2.1.0" "1" commit))

You may add a comment explaining why we don't provide (outdated) stable
version.

> +      (inputs
> +       `(("sdl2" ,sdl2)
> +         ("libjpeg" ,libjpeg)
> +         ("libpng" ,libpng)
> +         ("libvorbis" ,libvorbis)
> +         ("libogg" ,libogg)
> +         ("libtheora" ,libtheora)
> +         ("freetype" ,freetype)
> +         ("mesa" ,mesa)
> +         ("openal" ,openal)
> +         ("zlib" ,zlib)
> +         ("curl" ,curl)
> +         ("qtbase" ,qtbase)
> +         ("qtdeclarative" ,qtdeclarative)
> +         ("uuid.h" ,util-linux)))

Could you re-order the inputs?

> +      (home-page "https://github.com/Warsow/qfusion")
> +      (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
> +      (description
> +       "This package contains Warsow's fork of qfusion, the id Tech 2 derived
> +game engine.  id Tech 2 is the engine originally behind Quake 2.")

Even though it is spelled "id" in the repository, I think this is really
"ID".

> +      (license license:gpl2))))

AFAICT, this is gpl2+.

Otherwise, FWIW, LGTM!

Regards,
vasilii.smirnov--- via Guix-patches" via Feb. 29, 2020, 9:48 p.m. UTC | #2
Nicolas Goaziou 写道:
> Even though it is spelled "id" in the repository, I think this 
> is really
> "ID".

‘Id’.

Kind regards,

T G-R
Nicolas Goaziou Feb. 29, 2020, 10:56 p.m. UTC | #3
Hello,

Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org>
writes:

> Nicolas Goaziou 写道:
>> Even though it is spelled "id" in the repository, I think this is
>> really
>> "ID".
>
> ‘Id’.

<nitpick>
Actually, I think we're both wrong. That should be "id Software", per
<https://en.wikipedia.org/wiki/Id_Software>
</nitpick>

Regards,
Pierre Neidhardt March 2, 2020, 8:46 a.m. UTC | #4
Thanks for the review!

> Even though it is spelled "id" in the repository, I think this is really
> "ID".

Actually nope :)

https://en.wikipedia.org/wiki/Id_tech
Pierre Neidhardt March 3, 2020, 10:35 a.m. UTC | #5
I'm trying to use commit c4de15df559410aff0ca6643724e24cddb0ecbbd as
suggested upstream
(https://github.com/Warsow/qfusion/issues/46#issuecomment-592940682) but
git-fetch fails with

--8<---------------cut here---------------start------------->8---
Submodule 'libsrcs' (https://github.com/Warsow/qfusion-libsrcs.git) registered for path 'libsrcs'
Submodule 'third-party/angelscript' (https://github.com/Qfusion/angelscript.git) registered for path 'third-party/angelscript'
Submodule 'third-party/libRocket' (https://github.com/Qfusion/libRocket) registered for path 'third-party/libRocket'
Submodule 'third-party/openal-soft' (https://github.com/Warsow/openal-soft.git) registered for path 'third-party/openal-soft'
Submodule 'third-party/recastnavigation' (https://github.com/Warsow/recastnavigation.git) registered for path 'third-party/recastnavigation'
Submodule 'third-party/sqlite-amalgamation' (https://github.com/Warsow/sqlite-amalgamation.git) registered for path 'third-party/sqlite-amalgamation'
Cloning into '/gnu/store/l4bjqp1yjkx0hczz0y2i9h0gzayfdx11-warsow-qfusion-2.5-1.c4de15d-checkout/libsrcs'...
Cloning into '/gnu/store/l4bjqp1yjkx0hczz0y2i9h0gzayfdx11-warsow-qfusion-2.5-1.c4de15d-checkout/third-party/angelscript'...
Cloning into '/gnu/store/l4bjqp1yjkx0hczz0y2i9h0gzayfdx11-warsow-qfusion-2.5-1.c4de15d-checkout/third-party/libRocket'...
Cloning into '/gnu/store/l4bjqp1yjkx0hczz0y2i9h0gzayfdx11-warsow-qfusion-2.5-1.c4de15d-checkout/third-party/openal-soft'...
Cloning into '/gnu/store/l4bjqp1yjkx0hczz0y2i9h0gzayfdx11-warsow-qfusion-2.5-1.c4de15d-checkout/third-party/recastnavigation'...
Cloning into '/gnu/store/l4bjqp1yjkx0hczz0y2i9h0gzayfdx11-warsow-qfusion-2.5-1.c4de15d-checkout/third-party/sqlite-amalgamation'...
Submodule path 'libsrcs': checked out 'd3c01feeed14aa2f24c1839fedfb43b4c38a3412'
Submodule path 'third-party/angelscript': checked out '478944145ce6d278abc2a119355c425b332482df'
error: Server does not allow request for unadvertised object 867fc72f980b40325c35d2a9182f741e8e0ca876
Fetched in submodule path 'third-party/libRocket', but it did not contain 867fc72f980b40325c35d2a9182f741e8e0ca876. Direct fetching of that commit failed.
git-fetch: '/gnu/store/zm51w1zv9zchx3n3xjw81zrjnlaswawa-git-minimal-2.25.1/bin/git submodule update --init --recursive' failed with exit code 1
--8<---------------cut here---------------end--------------->8---

Indeed, 867fc72f980b40325c35d2a9182f741e8e0ca876 does not exist in
libRocket, so I suspect it was removed, but isn't Git supposed to fetch
master?  Where did it guess this commit from.  I don't understand how
this is possible.  The .gitmodules file is

--8<---------------cut here---------------start------------->8---
[submodule "third-party/libRocket"]
	path = third-party/libRocket
	url = https://github.com/Qfusion/libRocket
[submodule "third-party/angelscript"]
	path = third-party/angelscript
	url = https://github.com/Qfusion/angelscript.git
[submodule "third-party/recastnavigation"]
	path = third-party/recastnavigation
	url = https://github.com/Warsow/recastnavigation.git
[submodule "third-party/openal-soft"]
	path = third-party/openal-soft
	url = https://github.com/Warsow/openal-soft.git
[submodule "third-party/sqlite-amalgamation"]
	path = third-party/sqlite-amalgamation
	url = https://github.com/Warsow/sqlite-amalgamation.git
[submodule "libsrcs"]
	path = libsrcs
	url = https://github.com/Warsow/qfusion-libsrcs.git
--8<---------------cut here---------------end--------------->8---

and

--8<---------------cut here---------------start------------->8---
> git submodule status --recursive
 d3c01feeed14aa2f24c1839fedfb43b4c38a3412 libsrcs (d3c01fe)
 478944145ce6d278abc2a119355c425b332482df third-party/angelscript (heads/master)
+4889e4c100920cbd0fc9004566d6380771bd77a7 third-party/libRocket (release-1.2.1-1264-g4889e4c1)
 6761218e51699f46bf25c377e65b3e9ea5e434b9 third-party/openal-soft (openal-soft-1.18.1-694-g6761218e)
 2c85309280dbc9c82029e7ab16dfb01b9235c74e third-party/recastnavigation (1.5.0-78-g2c85309)
 bc1dd8284590b5092a9bed4deb80a49e01cfb911 third-party/sqlite-amalgamation (heads/master)
--8<---------------cut here---------------end--------------->8---

I must be missing something about Git submodules...
vasilii.smirnov--- via Guix-patches" via March 3, 2020, 12:57 p.m. UTC | #6
Nicolas Goaziou 写道:
> <nitpick>
> Actually, I think we're both wrong. That should be "id 
> Software", per
> <https://en.wikipedia.org/wiki/Id_Software>
> </nitpick>

<ahkshually>
Id read that article as well and was… surprised: Wikipedia does 
not take kindly to marketingCase™, let alone promote it.

id obviously gets ‘special’ treatment from sympathetic editors in 
a certain age bracket.  ;-)  Any other brand would be forced to 
use Regularcase.

I wrote ‘Id’ just to make clear that it's a word, not an 
abbreviation, and because GNU doesn't recognise trademarks either, 
and oh god none of this matters let's go play in the sun.

Just don't call them I.D.
</ahkshually>

Kind regards,

T G-R, now installing gzdoom again
Pierre Neidhardt May 2, 2020, 2:03 p.m. UTC | #7
Somehow this issue went away by itself.

I've fixed added sound support to the package definition.

Merged with 39f1806ca1d04b9aee70e897e06466aadbbee152.
diff mbox series

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 857345cfad..82d5490dd8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1482,6 +1482,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/vsearch-unbundle-cityhash.patch		\
   %D%/packages/patches/vte-CVE-2012-2738-pt1.patch			\
   %D%/packages/patches/vte-CVE-2012-2738-pt2.patch			\
+  %D%/packages/patches/warsow-fix-bool-return-type.patch	\
   %D%/packages/patches/weasyprint-library-paths.patch		\
   %D%/packages/patches/websocketpp-fix-for-boost-1.70.patch	\
   %D%/packages/patches/wicd-bitrate-none-fix.patch		\
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 05e026a846..f0b1b5f066 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -2188,3 +2188,52 @@  rigid body physics library written in C.")
 developers providing an advanced true color console, input, and lots of other
 utilities frequently used in roguelikes.")
     (license license:bsd-3)))
+
+(define-public warsow-qfusion
+  (let ((commit "5ec6887887850fa9e6f0a4418ab2b776f54fb395"))
+    (package
+      (name "warsow-qfusion")
+      (version (git-version "2.1.0" "1" commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/Warsow/qfusion/")
+                      (commit commit)
+                      (recursive? #t)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0bfwyikpwgwqcli33hxscdp557li1hkwyxy069csx5dy6sfvci6q"))
+                ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46
+                (patches (search-patches "warsow-fix-bool-return-type.patch"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No tests.
+         #:configure-flags '("-DQFUSION_GAME=Warsow")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'change-to-build-dir
+             (lambda _
+               (chdir "source")
+               #t)))))
+      (inputs
+       `(("sdl2" ,sdl2)
+         ("libjpeg" ,libjpeg)
+         ("libpng" ,libpng)
+         ("libvorbis" ,libvorbis)
+         ("libogg" ,libogg)
+         ("libtheora" ,libtheora)
+         ("freetype" ,freetype)
+         ("mesa" ,mesa)
+         ("openal" ,openal)
+         ("zlib" ,zlib)
+         ("curl" ,curl)
+         ("qtbase" ,qtbase)
+         ("qtdeclarative" ,qtdeclarative)
+         ("uuid.h" ,util-linux)))
+      (home-page "https://github.com/Warsow/qfusion")
+      (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine")
+      (description
+       "This package contains Warsow's fork of qfusion, the id Tech 2 derived
+game engine.  id Tech 2 is the engine originally behind Quake 2.")
+      (license license:gpl2))))
diff --git a/gnu/packages/patches/warsow-fix-bool-return-type.patch b/gnu/packages/patches/warsow-fix-bool-return-type.patch
new file mode 100644
index 0000000000..cd2c58afef
--- /dev/null
+++ b/gnu/packages/patches/warsow-fix-bool-return-type.patch
@@ -0,0 +1,24 @@ 
+diff --git a/source/ref/imagelib.cpp b/source/ref/imagelib.cpp
+index 33337ac..bb9a156 100644
+--- a/source/ref/imagelib.cpp
++++ b/source/ref/imagelib.cpp
+@@ -762,7 +762,7 @@ static void q_jpg_noop( j_decompress_ptr cinfo ) {
+
+ static boolean q_jpg_fill_input_buffer( j_decompress_ptr cinfo ) {
+ 	Com_DPrintf( "Premature end of jpeg file\n" );
+-	return 1;
++	return TRUE;
+ }
+
+ static void q_jpg_skip_input_data( j_decompress_ptr cinfo, long num_bytes ) {
+@@ -955,7 +955,7 @@ bool WriteJPG( const char *name, r_imginfo_t *info, int quality ) {
+ 	}
+
+ 	// start compression
+-	qjpeg_start_compress( &cinfo, true );
++	qjpeg_start_compress( &cinfo, TRUE );
+
+ 	// feed scanline data
+ 	w3 = cinfo.image_width * info->samples;
+--
+2.25.1