diff options
author | James Cowgill <jcowgill@debian.org> | 2018-05-15 15:11:29 +0100 |
---|---|---|
committer | James Cowgill <jcowgill@debian.org> | 2018-05-16 11:34:09 +0100 |
commit | 80d1da47044b30916da7be5f2ebdaac584e74488 (patch) | |
tree | 751b2ec17a2d96baa6a607da0192d79235daeb00 | |
parent | 7011e9b2da2323f4c86c10443ff3382f3f468375 (diff) |
Rewrite pkgconfig patches
- Adds 06a_pkgconfig-cleanup.patch which removes some code duplication.
- Adjusts 06a_pkgconfig-cleanup.patch to patch the new code in
cmake/Config.cmake.
-rw-r--r-- | debian/patches/06_pkgconfig-freebsd.patch | 33 | ||||
-rw-r--r-- | debian/patches/06a_pkgconfig-cleanup.patch | 41 | ||||
-rw-r--r-- | debian/patches/series | 1 |
3 files changed, 65 insertions, 10 deletions
diff --git a/debian/patches/06_pkgconfig-freebsd.patch b/debian/patches/06_pkgconfig-freebsd.patch index 34790a4..df3f5be 100644 --- a/debian/patches/06_pkgconfig-freebsd.patch +++ b/debian/patches/06_pkgconfig-freebsd.patch @@ -3,15 +3,28 @@ Author: James Cowgill <jcowgill@debian.org> Forwarded: no --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -204,9 +204,6 @@ endif() +--- a/cmake/Config.cmake ++++ b/cmake/Config.cmake +@@ -69,18 +69,10 @@ else() + return() + endif() - if(SFML_OS_LINUX OR SFML_OS_FREEBSD) - set(PKGCONFIG_DIR lib${LIB_SUFFIX}/pkgconfig) -- if(SFML_OS_FREEBSD) -- set(PKGCONFIG_DIR libdata/pkgconfig) +-# check if OS or package system supports pkg-config +-# this could be e.g. macports on mac or msys2 on windows etc. +-find_package(PkgConfig QUIET) +-if(PKG_CONFIG_EXECUTABLE) +- if(EXISTS "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig") +- set(SFML_OS_SUPPORTS_PKGCONFIG ON) +- set(SFML_OS_PKGCONFIG_DIR "/lib${LIB_SUFFIX}/pkgconfig") +- elseif(EXISTS "${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig") +- set(SFML_OS_SUPPORTS_PKGCONFIG ON) +- set(SFML_OS_PKGCONFIG_DIR "/libdata/pkgconfig") - endif() - if(BUILD_SHARED_LIBS) - sfml_set_option(SFML_INSTALL_PKGCONFIG_FILES FALSE BOOL "TRUE to automatically install pkg-config files so other projects can find SFML") - if(SFML_INSTALL_PKGCONFIG_FILES) +-endif() ++# on Debian, always install pkg-config files, and always into the default ++# $libdir path ++set(SFML_OS_SUPPORTS_PKGCONFIG ON) ++set(SFML_OS_PKGCONFIG_DIR "/lib${LIB_SUFFIX}/pkgconfig") + + # detect the compiler and its version + # Note: on some platforms (OS X), CMAKE_COMPILER_IS_GNUCXX is true diff --git a/debian/patches/06a_pkgconfig-cleanup.patch b/debian/patches/06a_pkgconfig-cleanup.patch new file mode 100644 index 0000000..915bae0 --- /dev/null +++ b/debian/patches/06a_pkgconfig-cleanup.patch @@ -0,0 +1,41 @@ +Description: Cleanup duplicated pkg-config code + Some parts of the pkg-config code released with 2.5.0 were duplicated and make + adjusting the pkg-config paths more complicated. Fix this by simply removing + the old code (which should be removed anyway). +Author: James Cowgill <jcowgill@debian.org> +Forwarded: no +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -269,30 +269,6 @@ if(SFML_OS_MACOSX) + set(XCODE_TEMPLATES_ARCH "\$(NATIVE_ARCH_ACTUAL)") + endif() + +-if(SFML_OS_LINUX OR SFML_OS_FREEBSD OR SFML_OS_OPENBSD) +- set(PKGCONFIG_DIR lib${LIB_SUFFIX}/pkgconfig) +- if(SFML_OS_FREEBSD OR SFML_OS_OPENBSD) +- set(PKGCONFIG_DIR libdata/pkgconfig) +- endif() +- if(BUILD_SHARED_LIBS) +- sfml_set_option(SFML_INSTALL_PKGCONFIG_FILES FALSE BOOL "TRUE to automatically install pkg-config files so other projects can find SFML") +- if(SFML_INSTALL_PKGCONFIG_FILES) +- foreach(sfml_module IN ITEMS all system window graphics audio network) +- CONFIGURE_FILE( +- "tools/pkg-config/sfml-${sfml_module}.pc.in" +- "tools/pkg-config/sfml-${sfml_module}.pc" +- @ONLY) +- INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/tools/pkg-config/sfml-${sfml_module}.pc" +- DESTINATION "${CMAKE_INSTALL_PREFIX}/${PKGCONFIG_DIR}") +- endforeach() +- endif() +- else() +- if(SFML_INSTALL_PKGCONFIG_FILES) +- message(WARNING "No pkg-config files are provided for the static SFML libraries (SFML_INSTALL_PKGCONFIG_FILES will be ignored).") +- endif() +- endif() +-endif() +- + # enable project folders + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake") diff --git a/debian/patches/series b/debian/patches/series index abeab28..af04eb4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ 04_remove-googleapi-css.patch 05_build-doc-once.patch +06a_pkgconfig-cleanup.patch 06_pkgconfig-freebsd.patch |