From 7b5ac9170fa6f8e899da634f68fc9a255e8b8171 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 10 May 2021 02:08:21 -0700 Subject: [PATCH 1/5] [thor] Support UNIX, re-fix dependency sfml --- ports/thor/CONTROL | 4 ---- ports/thor/fix-dependency-sfml.patch | 31 +++++++++++++++++++++++++ ports/thor/portfile.cmake | 25 ++++++++++---------- ports/thor/sfml-no-depend-libjpeg.patch | 16 ------------- ports/thor/vcpkg.json | 11 +++++++++ 5 files changed, 55 insertions(+), 32 deletions(-) delete mode 100644 ports/thor/CONTROL create mode 100644 ports/thor/fix-dependency-sfml.patch delete mode 100644 ports/thor/sfml-no-depend-libjpeg.patch create mode 100644 ports/thor/vcpkg.json diff --git a/ports/thor/CONTROL b/ports/thor/CONTROL deleted file mode 100644 index 5391f5d62d7137..00000000000000 --- a/ports/thor/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: thor -Version: 2.0-3 -Description: Extends the multimedia library SFML with higher-level features -Build-Depends: sfml, aurora diff --git a/ports/thor/fix-dependency-sfml.patch b/ports/thor/fix-dependency-sfml.patch new file mode 100644 index 00000000000000..8b6fb09daef902 --- /dev/null +++ b/ports/thor/fix-dependency-sfml.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 03536be..abcff44 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -115,11 +115,10 @@ set (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/;${CMAKE_MODULE_PATH + if(NOT THOR_SHARED_LIBS) + set(SFML_STATIC_LIBRARIES TRUE) + endif() +-find_package(SFML 2 COMPONENTS audio graphics window system) ++find_package(SFML COMPONENTS system window graphics CONFIG REQUIRED) ++set(SFML_LIBRARIES sfml-system sfml-network sfml-graphics sfml-window) + +-if(SFML_FOUND) +- include_directories(${SFML_INCLUDE_DIR}) +-else() ++if(0) + set(SFML_ROOT "" CACHE PATH "SFML top-level directory") + message("\n-> SFML directory not found. Set SFML_ROOT to SFML's top-level path (containing \"include\" and \"lib\" directories).") + message("-> Make sure the SFML libraries with the same configuration (Release/Debug, Static/Dynamic) exist.\n") +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 75e118e..0f90ac8 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -72,6 +72,7 @@ else() + add_library(${THOR_LIB} STATIC ${THOR_SRC}) + set_target_properties(${THOR_LIB} PROPERTIES DEBUG_POSTFIX -s-d) + set_target_properties(${THOR_LIB} PROPERTIES RELEASE_POSTFIX -s) ++ thor_link_sfml(${THOR_LIB}) + endif() + + diff --git a/ports/thor/portfile.cmake b/ports/thor/portfile.cmake index 4a6a7a5dc45eb8..87894201be55b1 100644 --- a/ports/thor/portfile.cmake +++ b/ports/thor/portfile.cmake @@ -4,8 +4,9 @@ vcpkg_from_github(ARCHIVE REF v2.0 SHA512 634fa5286405d9a8a837c082ace98bbb02e609521418935855b9e2fcad57003dbe35088bd771cf6a9292e55d3787f7e463d7a4cca0d0f007509de2520d9a8cf9 HEAD_REF master - PATCHES "${CMAKE_CURRENT_LIST_DIR}/sfml-no-depend-libjpeg.patch" + PATCHES fix-dependency-sfml.patch ) +file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindSFML.cmake) file(REMOVE_RECURSE ${SOURCE_PATH}/extlibs) file(COPY ${CURRENT_INSTALLED_DIR}/include/Aurora DESTINATION ${SOURCE_PATH}/extlibs/aurora/include) @@ -24,15 +25,17 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -set(CONFIG_FILE "${CURRENT_PACKAGES_DIR}/include/Thor/Config.hpp") +vcpkg_copy_pdbs() -file(READ ${CONFIG_FILE} CONFIG_H) - if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - string(REPLACE "defined(SFML_STATIC)" "1" CONFIG_H "${CONFIG_H}") - else() - string(REPLACE "defined(SFML_STATIC)" "0" CONFIG_H "${CONFIG_H}") - endif() -file(WRITE ${CONFIG_FILE} "${CONFIG_H}") +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/Thor/Config.hpp" + "defined(SFML_STATIC)" "1" + ) +else() + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/Thor/Config.hpp" + "defined(SFML_STATIC)" "0" + ) +endif() file(GLOB LICENSE "${CURRENT_PACKAGES_DIR}/debug/LicenseThor.txt" @@ -51,6 +54,4 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) endif() -file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/thor RENAME copyright) - -vcpkg_copy_pdbs() +file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/thor/sfml-no-depend-libjpeg.patch b/ports/thor/sfml-no-depend-libjpeg.patch deleted file mode 100644 index 7fcf73ff0ebd69..00000000000000 --- a/ports/thor/sfml-no-depend-libjpeg.patch +++ /dev/null @@ -1,16 +0,0 @@ -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() - diff --git a/ports/thor/vcpkg.json b/ports/thor/vcpkg.json new file mode 100644 index 00000000000000..3b1c3cfee0b324 --- /dev/null +++ b/ports/thor/vcpkg.json @@ -0,0 +1,11 @@ +{ + "name": "thor", + "version": "2.0", + "port-version": 4, + "description": "Extends the multimedia library SFML with higher-level features", + "homepage": "www.bromeon.ch/libraries/thor", + "dependencies": [ + "aurora", + "sfml" + ] +} From a2c12a0ebf336bee860f7f5137143246907a4b6d Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 10 May 2021 02:11:22 -0700 Subject: [PATCH 2/5] update baseline --- scripts/ci.baseline.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 166bebb1162419..7ee2664181acfc 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1570,8 +1570,6 @@ theia:x64-windows = skip theia:x64-windows-static = skip theia:x64-windows-static-md=skip theia:x86-windows = skip -thor:x64-linux=fail -thor:x64-osx=fail tidy-html5:arm-uwp=fail tidy-html5:x64-uwp=fail tinkerforge:arm-uwp=fail From 2266921850491cd82cb1422b7aa75c3fdcd14df5 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 10 May 2021 02:11:42 -0700 Subject: [PATCH 3/5] update version record --- versions/baseline.json | 4 ++-- versions/t-/thor.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index f9b2230fceb7e6..da5c1e1050b44f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5993,8 +5993,8 @@ "port-version": 0 }, "thor": { - "baseline": "2.0-3", - "port-version": 0 + "baseline": "2.0", + "port-version": 4 }, "threadpool": { "baseline": "0.2.5", diff --git a/versions/t-/thor.json b/versions/t-/thor.json index d110348ab32cfe..84a5cd435667c5 100644 --- a/versions/t-/thor.json +++ b/versions/t-/thor.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "7e6f73fde9dad730b7166e466bba2fb47176c629", + "version": "2.0", + "port-version": 4 + }, { "git-tree": "99d8374185d4ab57f61811b3d65a2c542a8ad42e", "version-string": "2.0-3", From e38a94a437584ad9465179673a15ec38bcca7ffb Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 10 May 2021 19:24:32 -0700 Subject: [PATCH 4/5] improve portfile.cmake --- ports/thor/portfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/thor/portfile.cmake b/ports/thor/portfile.cmake index 87894201be55b1..8371f16139dd21 100644 --- a/ports/thor/portfile.cmake +++ b/ports/thor/portfile.cmake @@ -48,10 +48,10 @@ if(LICENSE) file(REMOVE ${LICENSE}) endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/Aurora) -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/include/Aurora) + +if(NOT VCPKG_TARGET_IS_WINDOWS) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) endif() file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) From 6c73951755b55713a6ba763ea0c6d981b9649cc0 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 10 May 2021 19:24:52 -0700 Subject: [PATCH 5/5] update version record --- versions/t-/thor.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/t-/thor.json b/versions/t-/thor.json index 84a5cd435667c5..708cdd8038e00e 100644 --- a/versions/t-/thor.json +++ b/versions/t-/thor.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "7e6f73fde9dad730b7166e466bba2fb47176c629", + "git-tree": "cada171d405874f848790c8e10a7f332bbed1e6c", "version": "2.0", "port-version": 4 },