gentoo-overlay/games-action/supertuxkart/files/supertuxkart-0.9.2-unbundle-enet.patch

58 lines
1.6 KiB
Diff

Description: Build supertuxkart against system enet instead of embedded copy
Forwarded: not-yet
Author: Vincent Cheng <vcheng@debian.org>
Last-Update: 2016-07-17
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,9 +63,9 @@
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet")
include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src")
-# Build the ENet UDP network library
-add_subdirectory("${PROJECT_SOURCE_DIR}/lib/enet")
-include_directories("${PROJECT_SOURCE_DIR}/lib/enet/include")
+# ENet
+find_package(ENet REQUIRED)
+include_directories(${ENET_INCLUDE_DIR})
# Build glew library
add_definitions(-DGLEW_NO_GLU)
@@ -342,11 +342,11 @@
bulletdynamics
bulletcollision
bulletmath
- enet
glew
stkirrlicht
${Angelscript_LIBRARIES}
${CURL_LIBRARIES}
+ ${ENET_LIBRARIES}
${OGGVORBIS_LIBRARIES}
${OPENAL_LIBRARY}
${OPENGL_LIBRARIES}
--- /dev/null
+++ b/cmake/FindENet.cmake
@@ -0,0 +1,22 @@
+# - Find ENet
+# Find the ENet includes and libraries
+#
+# Following variables are provided:
+# ENET_FOUND
+# True if ENet has been found
+# ENET_INCLUDE_DIR
+# The include directories of ENet
+# ENET_LIBRARIES
+# ENet library list
+
+
+find_path(ENET_INCLUDE_DIR enet/enet.h /usr/include)
+find_library(ENET_LIBRARY NAMES enet PATHS /usr/lib)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ENet DEFAULT_MSG ENET_INCLUDE_DIR ENET_LIBRARY)
+
+# Publish variables
+set(ENET_INCLUDE_DIRS ${ENET_INCLUDE_DIR})
+set(ENET_LIBRARIES ${ENET_LIBRARY})
+mark_as_advanced(ENET_INCLUDE_DIR ENET_LIBRARY)