gnu: supertuxkart: Simplify unbundling and unbundle enet.

* gnu/packages/games.scm (supertuxkart)[source](snippet): Delete "lib/enet".
Remove "CMakeList.txt" substitution.
[arguments]<#:configure-flags>: Add "-DUSER_SYSTEM_GLEW=TRUE" and
"-DUSE_SYSTEM_ENET=TRUE".
<#:phases>: Delete.

Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
Pierre Langlois 2019-04-21 19:09:48 +01:00 committed by Christopher Baines
parent 60af1822d4
commit 56a4858210
No known key found for this signature in database
GPG Key ID: 5E28A33B0B84F577
1 changed files with 12 additions and 30 deletions

View File

@ -2130,50 +2130,31 @@ This game is based on the GPL version of the famous game TuxRacer.")
(snippet (snippet
;; Delete bundled library sources ;; Delete bundled library sources
'(begin '(begin
;; FIXME: try to unbundle enet, and angelscript ;; Supertuxkart uses modified versions of the Irrlicht engine
;; and the bullet library. The developers gave an explanation
;; here: http://forum.freegamedev.net/viewtopic.php?f=17&t=3906
;; FIXME: try to unbundle angelscript
(for-each delete-file-recursively (for-each delete-file-recursively
'("lib/zlib" '("lib/zlib"
"lib/libpng" "lib/libpng"
"lib/jpeglib" "lib/jpeglib"
"lib/glew" "lib/glew"
"lib/wiiuse")) "lib/wiiuse"
(substitute* "CMakeLists.txt" "lib/enet"))
;; Supertuxkart uses modified versions of the Irrlicht engine
;; and the bullet library. The developers gave an explanation here:
;; http://forum.freegamedev.net/viewtopic.php?f=17&t=3906
(("add_subdirectory\\(.*/(glew|zlib)\"\\)") ""))
#t)))) #t))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
`(#:tests? #f ; no check target `(#:tests? #f ; no check target
#:configure-flags #:configure-flags
(list "-DUSE_WIIUSE=0" (list "-DUSE_WIIUSE=0"
;; Do not use the bundled zlib ;; Do not use the bundled zlib, glew and enet.
"-DNO_IRR_COMPILE_WITH_ZLIB_=TRUE" "-DNO_IRR_COMPILE_WITH_ZLIB_=TRUE"
"-DUSE_SYSTEM_GLEW=TRUE"
"-DUSE_SYSTEM_ENET=TRUE"
;; FIXME: needs libopenglrecorder ;; FIXME: needs libopenglrecorder
"-DBUILD_RECORDER=0" "-DBUILD_RECORDER=0"
;; Irrlicht returns an integer instead of a boolean ;; Irrlicht returns an integer instead of a boolean
"-DCMAKE_C_FLAGS=-fpermissive") "-DCMAKE_C_FLAGS=-fpermissive")))
#:phases
(modify-phases %standard-phases
;; see https://github.com/supertuxkart/stk-code/issues/3557
(add-after 'unpack 'patch-for-mesa-18.3
(lambda _
(substitute* "src/graphics/gl_headers.hpp"
(("#if !defined\\(USE_GLES2\\)")
"#if !defined(USE_GLES2)\n# define __gl_glext_h_"))
#t))
(add-after 'unpack 'unbundle
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "CMakeLists.txt"
(("glew")
(string-append (assoc-ref inputs "glew")
"/lib/libGLEW.a"))
(("include_directories\\(\"\\$\\{PROJECT_SOURCE_DIR\\}/lib/glew/include\"\\)")
(string-append "include_directories(\""
(assoc-ref inputs "glew")
"/include\")")))
#t)))))
(inputs (inputs
`(("glew" ,glew) `(("glew" ,glew)
("zlib" ,zlib) ("zlib" ,zlib)
@ -2188,7 +2169,8 @@ This game is based on the GPL version of the famous game TuxRacer.")
;; The following input is needed to build the bundled and modified ;; The following input is needed to build the bundled and modified
;; version of irrlicht. ;; version of irrlicht.
("libjpeg" ,libjpeg) ("libjpeg" ,libjpeg)
("openssl" ,openssl))) ("openssl" ,openssl)
("enet" ,enet)))
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config))) `(("pkg-config" ,pkg-config)))
(home-page "https://supertuxkart.net/") (home-page "https://supertuxkart.net/")