diff options
author | Pierre Neidhardt <mail@ambrevar.xyz> | 2020-05-02 17:51:21 +0200 |
---|---|---|
committer | Pierre Neidhardt <mail@ambrevar.xyz> | 2020-05-06 10:57:30 +0200 |
commit | 0b5bf61573c5491a52dfb70ea2b6e91ca61ef199 (patch) | |
tree | cfbee9cb4e86da1ef33ce85807d29ace6b186eaf /gnu/packages | |
parent | a4be14261cff5770f490172668373c1b0bb60235 (diff) | |
download | patches-0b5bf61573c5491a52dfb70ea2b6e91ca61ef199.tar patches-0b5bf61573c5491a52dfb70ea2b6e91ca61ef199.tar.gz |
gnu: Add warsow-qfusion.
* gnu/packages/patches/warsow-qfusion-fix-bool-return-type.patch: New file.
* gnu/local.mk: Include patch.
* gnu/packages/game-development.scm (warsow-qfusion): New variable.
Diffstat (limited to 'gnu/packages')
-rw-r--r-- | gnu/packages/game-development.scm | 81 | ||||
-rw-r--r-- | gnu/packages/patches/warsow-qfusion-fix-bool-return-type.patch | 22 |
2 files changed, 103 insertions, 0 deletions
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index d4b2fdcab2..05cc152afd 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -38,6 +38,7 @@ (define-module (gnu packages game-development) #:use-module (srfi srfi-1) + #:use-module (ice-9 match) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) @@ -2225,3 +2226,83 @@ 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 + ;; As of 2020-04-09, the latest stable version 2.1.0 is deprecated. + ;; The 2.5 beta as published on the homepage is commit + ;; c4de15df559410aff0ca6643724e24cddb0ecbbd + (let ((commit "c4de15df559410aff0ca6643724e24cddb0ecbbd")) + (package + (name "warsow-qfusion") + (version (git-version "2.5" "1" commit)) ; 2.5-beta + (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 + "0xv2yycr43p3xmq7lm6j6zb3cpcr6w00x7qg918faq0mw9j7v48g")) + ;; Issue reported here: https://github.com/Warsow/qfusion/issues/46 + (patches (search-patches "warsow-qfusion-fix-bool-return-type.patch")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; No tests. + #:configure-flags '("-DQFUSION_GAME=Warsow") + #:modules + ((guix build utils) + (guix build cmake-build-system) + (ice-9 match)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'change-to-build-dir + (lambda _ + (chdir "source") + #t)) + (add-after 'install 'really-install + (lambda* (#:key outputs system #:allow-other-keys) + (let ((arch (match system + ("x86_64-linux" "x86_64") + ("i686-linux" "i386"))) + (out (assoc-ref outputs "out"))) + (install-file (string-append "../source/build/basewsw/libgame_" + arch ".so") + (string-append out "/lib/")) + (install-file (string-append "../source/build/libui_" arch ".so") + (string-append out "/lib/")) + (for-each + (lambda (file) + (install-file file (string-append out "/bin/"))) + (append (find-files "../source/build" "warsow") + (find-files "../source/build" "wsw_server.")))) + #t))))) + (inputs + `(("alsa-lib" ,alsa-lib) + ("curl" ,curl) + ("freetype" ,freetype) + ("ffmpeg" ,ffmpeg) + ("libjpeg" ,libjpeg) + ("libogg" ,libogg) + ("libpng" ,libpng) + ("libtheora" ,libtheora) + ("libvorbis" ,libvorbis) + ("mesa" ,mesa) + ("openal" ,openal) + ("pulseaudio" ,pulseaudio) + ("qtbase" ,qtbase) + ("qtdeclarative" ,qtdeclarative) + ("sdl2" ,sdl2) + ("uuid.h" ,util-linux) + ("zlib" ,zlib))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (home-page "https://github.com/Warsow/qfusion") + (supported-systems '("i686-linux" "x86_64-linux")) + (synopsis "Warsow's fork of qfusion, the id Tech 2 derived game engine") + (description + "This package contains the game engine of Warsow, a first-person +shooter video game. The engine is based on 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-qfusion-fix-bool-return-type.patch b/gnu/packages/patches/warsow-qfusion-fix-bool-return-type.patch new file mode 100644 index 0000000000..ec22377446 --- /dev/null +++ b/gnu/packages/patches/warsow-qfusion-fix-bool-return-type.patch @@ -0,0 +1,22 @@ +diff --git a/source/ref_gl/r_imagelib.cpp b/source/ref_gl/r_imagelib.cpp +index 418028a..f76916b 100644 +--- a/source/ref_gl/r_imagelib.cpp ++++ b/source/ref_gl/r_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; |