gnu: supertuxkart: Simplify unbundling and unbundle enet.
authorPierre Langlois <pierre.langlois@gmx.com>
Sun, 21 Apr 2019 18:09:48 +0000 (19:09 +0100)
committerChristopher Baines <mail@cbaines.net>
Sun, 21 Apr 2019 21:50:22 +0000 (22:50 +0100)
* 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>
gnu/packages/games.scm

index 0ca3cdc..6a782b2 100644 (file)
@@ -2130,50 +2130,31 @@ This game is based on the GPL version of the famous game TuxRacer.")
        (snippet
         ;; Delete bundled library sources
         '(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
                      '("lib/zlib"
                        "lib/libpng"
                        "lib/jpeglib"
                        "lib/glew"
-                       "lib/wiiuse"))
-           (substitute* "CMakeLists.txt"
-             ;; 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)\"\\)") ""))
+                       "lib/wiiuse"
+                       "lib/enet"))
            #t))))
     (build-system cmake-build-system)
     (arguments
      `(#:tests? #f ; no check target
        #:configure-flags
        (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"
+             "-DUSE_SYSTEM_GLEW=TRUE"
+             "-DUSE_SYSTEM_ENET=TRUE"
              ;; FIXME: needs libopenglrecorder
              "-DBUILD_RECORDER=0"
              ;; Irrlicht returns an integer instead of a boolean
-             "-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)))))
+             "-DCMAKE_C_FLAGS=-fpermissive")))
     (inputs
      `(("glew" ,glew)
        ("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
        ;; version of irrlicht.
        ("libjpeg" ,libjpeg)
-       ("openssl" ,openssl)))
+       ("openssl" ,openssl)
+       ("enet" ,enet)))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (home-page "https://supertuxkart.net/")