From c70e9d895f7f5a1467b5562274637dd24459bdd7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Aug 2018 03:30:31 -0700 Subject: [PATCH] [thor][sfgui] Fix outdated FindSFML.cmake files --- ports/sfgui/CONTROL | 2 +- ports/sfgui/portfile.cmake | 12 +++---- ports/sfgui/use-sfml-targets.patch | 44 +++++++++++++++++++++++++ ports/thor/CONTROL | 2 +- ports/thor/portfile.cmake | 29 ++++------------ ports/thor/sfml-no-depend-libjpeg.patch | 16 +++++++++ 6 files changed, 73 insertions(+), 32 deletions(-) create mode 100644 ports/sfgui/use-sfml-targets.patch create mode 100644 ports/thor/sfml-no-depend-libjpeg.patch diff --git a/ports/sfgui/CONTROL b/ports/sfgui/CONTROL index 39962e0e5b..59a7cdab3d 100644 --- a/ports/sfgui/CONTROL +++ b/ports/sfgui/CONTROL @@ -1,4 +1,4 @@ Source: sfgui -Version: 0.3.2-1 +Version: 0.3.2-2 Description: simple and fast graphical user interface library Build-Depends: sfml diff --git a/ports/sfgui/portfile.cmake b/ports/sfgui/portfile.cmake index 7764a60a12..66ce7d8303 100644 --- a/ports/sfgui/portfile.cmake +++ b/ports/sfgui/portfile.cmake @@ -6,15 +6,12 @@ vcpkg_from_github( REF 0.3.2 SHA512 cd97e421695f6189995c1b7a4180e3738bf785abae37d3eb51ac6d687a88a26a1f088863b37e065edaff6ba43eea379e423b31118324c4daa65dba0b3e904869 HEAD_REF master + PATCHES "${CMAKE_CURRENT_LIST_DIR}/use-sfml-targets.patch" ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(SFGUI_BUILD_SHARED_LIBS ON) - set(SFML_STATIC_LIBRARIES OFF) -else() - set(SFGUI_BUILD_SHARED_LIBS OFF) - set(SFML_STATIC_LIBRARIES ON) -endif() +file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindSFML.cmake) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SFGUI_BUILD_SHARED_LIBS) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -23,7 +20,6 @@ vcpkg_configure_cmake( -DSFGUI_BUILD_DOC=OFF -DSFGUI_BUILD_EXAMPLES=OFF -DSFGUI_BUILD_SHARED_LIBS=${SFGUI_BUILD_SHARED_LIBS} - -DSFML_STATIC_LIBRARIES=${SFML_STATIC_LIBRARIES} ) vcpkg_install_cmake() diff --git a/ports/sfgui/use-sfml-targets.patch b/ports/sfgui/use-sfml-targets.patch new file mode 100644 index 0000000000..337949f5ad --- /dev/null +++ b/ports/sfgui/use-sfml-targets.patch @@ -0,0 +1,44 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index abc9be0..eb999f5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -190,7 +190,6 @@ endif() + + include_directories( "${INCLUDE_PATH}" ) + include_directories( "${SOURCE_PATH}" ) +-include_directories( SYSTEM "${SFML_INCLUDE_DIR}" ) + include_directories( SYSTEM "${PROJECT_SOURCE_DIR}/extlibs/libELL/include" ) + + # Set the library output directory +@@ -244,7 +243,7 @@ if( WIN32 ) + endif() + + add_definitions( -DWIN32 ) +- target_link_libraries( sfgui ${SFML_LIBRARIES} ${SFML_DEPENDENCIES} ${OPENGL_gl_LIBRARY} ) ++ target_link_libraries( sfgui sfml-graphics sfml-window sfml-system ${OPENGL_gl_LIBRARY} ) + + if( CMAKE_COMPILER_IS_GNUCXX ) + if( SFGUI_BUILD_SHARED_LIBS ) +@@ -261,11 +260,11 @@ elseif( APPLE ) + mark_as_advanced( COREFOUNDATION_LIBRARY ) + + include_directories( SYSTEM /System/Library/Frameworks/CoreFoundation.framework/Headers ) +- target_link_libraries( sfgui ${SFML_LIBRARIES} ${SFML_DEPENDENCIES} ${OPENGL_gl_LIBRARY} ${COREFOUNDATION_LIBRARY} ) ++ target_link_libraries( sfgui sfml-graphics sfml-window sfml-system ${OPENGL_gl_LIBRARY} ${COREFOUNDATION_LIBRARY} ) + set( SHARE_PATH "${CMAKE_INSTALL_PREFIX}/share/SFGUI" ) + set( LIB_PATH "lib" ) + elseif( "${CMAKE_SYSTEM_NAME}" MATCHES "Linux" ) +- target_link_libraries( sfgui ${SFML_LIBRARIES} ${SFML_DEPENDENCIES} ${OPENGL_gl_LIBRARY} ${X11_LIBRARIES} ) ++ target_link_libraries( sfgui sfml-graphics sfml-window sfml-system ${OPENGL_gl_LIBRARY} ${X11_LIBRARIES} ) + set( SHARE_PATH "${CMAKE_INSTALL_PREFIX}/share/SFGUI" ) + + if( LIB_SUFFIX ) +@@ -274,7 +273,7 @@ elseif( "${CMAKE_SYSTEM_NAME}" MATCHES "Linux" ) + set( LIB_PATH "lib" ) + endif() + else() +- target_link_libraries( sfgui ${SFML_LIBRARIES} ${SFML_DEPENDENCIES} ${OPENGL_gl_LIBRARY} ) ++ target_link_libraries( sfgui sfml-graphics sfml-window sfml-system ${OPENGL_gl_LIBRARY} ) + set( SHARE_PATH "${CMAKE_INSTALL_PREFIX}/share/SFGUI" ) + set( LIB_PATH "lib" ) + endif() diff --git a/ports/thor/CONTROL b/ports/thor/CONTROL index cdb393f38e..4ff531d142 100644 --- a/ports/thor/CONTROL +++ b/ports/thor/CONTROL @@ -1,4 +1,4 @@ Source: thor -Version: 2.0-1 +Version: 2.0-2 Description: Extends the multimedia library SFML with higher-level features Build-Depends: sfml, aurora diff --git a/ports/thor/portfile.cmake b/ports/thor/portfile.cmake index c96df47284..5728530644 100644 --- a/ports/thor/portfile.cmake +++ b/ports/thor/portfile.cmake @@ -1,45 +1,31 @@ include(vcpkg_common_functions) - - -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/tests) vcpkg_from_github(ARCHIVE OUT_SOURCE_PATH SOURCE_PATH REPO Bromeon/Thor REF v2.0 SHA512 634fa5286405d9a8a837c082ace98bbb02e609521418935855b9e2fcad57003dbe35088bd771cf6a9292e55d3787f7e463d7a4cca0d0f007509de2520d9a8cf9 HEAD_REF master + PATCHES "${CMAKE_CURRENT_LIST_DIR}/sfml-no-depend-libjpeg.patch" ) +file(REMOVE_RECURSE ${SOURCE_PATH}/extlibs) file(COPY ${CURRENT_INSTALLED_DIR}/include/Aurora DESTINATION ${SOURCE_PATH}/extlibs/aurora/include) +file(WRITE "${SOURCE_PATH}/extlibs/aurora/License.txt") - -set(ENV{SFML_ROOT} ${CURRENT_INSTALLED_DIR}) - -if(VCPKG_CRT_LINKAGE STREQUAL static) - set(THOR_STATIC_STD_LIBS ON) -else() - set(THOR_STATIC_STD_LIBS OFF) -endif() - - -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(THOR_SHARED_LIBS ON) -else() - set(THOR_SHARED_LIBS OFF) -endif() +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" THOR_STATIC_STD_LIBS) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" THOR_SHARED_LIBS) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DTHOR_SHARED_LIBS=${THOR_SHARED_LIBS} - -DTHOR_STATIC_STD_LIBS=${THOR_STATIC_STD_LIBS} + -DTHOR_SHARED_LIBS=${THOR_SHARED_LIBS} + -DTHOR_STATIC_STD_LIBS=${THOR_STATIC_STD_LIBS} ) vcpkg_install_cmake() - set(CONFIG_FILE "${CURRENT_PACKAGES_DIR}/include/Thor/Config.hpp") file(READ ${CONFIG_FILE} CONFIG_H) @@ -48,7 +34,6 @@ file(READ ${CONFIG_FILE} CONFIG_H) else() string(REPLACE "defined(SFML_STATIC)" "0" CONFIG_H "${CONFIG_H}") endif() - file(WRITE ${CONFIG_FILE} "${CONFIG_H}") file(GLOB LICENSE diff --git a/ports/thor/sfml-no-depend-libjpeg.patch b/ports/thor/sfml-no-depend-libjpeg.patch new file mode 100644 index 0000000000..7fcf73ff0e --- /dev/null +++ b/ports/thor/sfml-no-depend-libjpeg.patch @@ -0,0 +1,16 @@ +diff --git a/cmake/Modules/FindSFML.cmake b/cmake/Modules/FindSFML.cmake +index 48873ef..a1834f6 100644 +--- a/cmake/Modules/FindSFML.cmake ++++ b/cmake/Modules/FindSFML.cmake +@@ -312,10 +312,9 @@ if(SFML_STATIC_LIBRARIES) + + # find libraries + find_sfml_dependency(FREETYPE_LIBRARY "FreeType" freetype) +- find_sfml_dependency(JPEG_LIBRARY "libjpeg" jpeg) + + # update the list +- set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY} ${JPEG_LIBRARY}) ++ set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY}) + set(SFML_DEPENDENCIES ${SFML_GRAPHICS_DEPENDENCIES} ${SFML_DEPENDENCIES}) + endif() +