games-action/supertuxkart: Fix automagic dependency on libsquish
authorJames Le Cuirot <chewi@gentoo.org>
Mon, 13 May 2019 22:05:28 +0000 (23:05 +0100)
committerJames Le Cuirot <chewi@gentoo.org>
Mon, 13 May 2019 22:05:28 +0000 (23:05 +0100)
Closes: https://bugs.gentoo.org/685808
Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
games-action/supertuxkart/files/supertuxkart-1.0-system-squish.patch [new file with mode: 0644]
games-action/supertuxkart/supertuxkart-1.0.ebuild

diff --git a/games-action/supertuxkart/files/supertuxkart-1.0-system-squish.patch b/games-action/supertuxkart/files/supertuxkart-1.0-system-squish.patch
new file mode 100644 (file)
index 0000000..8158c4b
--- /dev/null
@@ -0,0 +1,43 @@
+From e1601b1ae07e3c1ac05cffe05b82e0c60998bc72 Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+Date: Mon, 13 May 2019 22:51:21 +0100
+Subject: [PATCH] CMake: Add option to use system Squish library
+
+The system version was preferred before but it wasn't possible to
+explicitly disable it, making its use automagic, which is bad for
+packaging.
+
+Closes: https://github.com/supertuxkart/stk-code/pull/3916
+---
+ CMakeLists.txt | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8a7f03264..40e7790fe 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -31,6 +31,8 @@ CMAKE_DEPENDENT_OPTION(BUILD_RECORDER "Build opengl recorder" ON
+     "NOT SERVER_ONLY;NOT APPLE" OFF)
+ CMAKE_DEPENDENT_OPTION(USE_FRIBIDI "Support for right-to-left languages" ON
+     "NOT SERVER_ONLY" OFF)
++CMAKE_DEPENDENT_OPTION(USE_SYSTEM_SQUISH "Use system Squish library instead of the built-in version, when available." ON
++    "NOT SERVER_ONLY" OFF)
+ CMAKE_DEPENDENT_OPTION(USE_WIIUSE "Support for wiimote input devices" ON
+     "NOT SERVER_ONLY;NOT MINGW;NOT CYGWIN" OFF)
+@@ -247,8 +249,10 @@ if(NOT SERVER_ONLY)
+ endif()
+ if(NOT SERVER_ONLY)
+-    find_library(SQUISH_LIBRARY NAMES squish libsquish)
+-    find_path(SQUISH_INCLUDEDIR NAMES squish.h PATHS)
++    if(USE_SYSTEM_SQUISH)
++        find_library(SQUISH_LIBRARY NAMES squish libsquish)
++        find_path(SQUISH_INCLUDEDIR NAMES squish.h PATHS)
++    endif()
+     if (NOT SQUISH_LIBRARY OR NOT SQUISH_INCLUDEDIR)
+         add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libsquish")
+         include_directories("${PROJECT_SOURCE_DIR}/lib/libsquish")
+-- 
+2.20.1
+
index 0069c7d8553decc26654b41968d5190ff8598e09..96746c833f783a669e4c208ccdd0269457e91f27 100644 (file)
@@ -52,6 +52,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-0.9.3-irrlicht-arch-support.patch
        "${FILESDIR}"/${PN}-0.9.3-irrlicht-system-libs.patch
        "${FILESDIR}"/${PN}-1.0-fix-buildsystem.patch
+       "${FILESDIR}"/${PN}-1.0-system-squish.patch
 )
 
 src_prepare() {
@@ -66,6 +67,7 @@ src_configure() {
                -DUSE_SYSTEM_ANGELSCRIPT=ON
                -DUSE_SYSTEM_ENET=ON
                -DUSE_SYSTEM_GLEW=ON
+               -DUSE_SYSTEM_SQUISH=OFF
                -DUSE_SYSTEM_WIIUSE=OFF
                -DUSE_CRYPTO_OPENSSL=$(usex nettle no yes)
                -DENABLE_WAYLAND_DEVICE=OFF