From 032692ad9e15537e6f6793498c7fea0515c77a35 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Tue, 20 Jun 2017 15:37:31 -0700 Subject: [PATCH 1/6] added thor #1319 --- ports/thor/CONTROL | 4 +++ ports/thor/portfile.cmake | 71 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 ports/thor/CONTROL create mode 100644 ports/thor/portfile.cmake diff --git a/ports/thor/CONTROL b/ports/thor/CONTROL new file mode 100644 index 000000000..9da28972a --- /dev/null +++ b/ports/thor/CONTROL @@ -0,0 +1,4 @@ +Source: thor +Version: +Description: +Build-Depends: sfml diff --git a/ports/thor/portfile.cmake b/ports/thor/portfile.cmake new file mode 100644 index 000000000..046dd57b5 --- /dev/null +++ b/ports/thor/portfile.cmake @@ -0,0 +1,71 @@ +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 +) + + +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() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DTHOR_SHARED_LIBS=${THOR_SHARED_LIBS} + -DTHOR_STATIC_STD_LIBS=${THOR_STATIC_STD_LIBS} +) + +vcpkg_build_cmake() + +file(GLOB DLLS + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dll" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/*.dll" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/src/*.dll" +) +file(GLOB LIBS + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.lib" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/*.lib" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/src/*.lib" +) +file(GLOB DEBUG_DLLS + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dll" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/*.dll" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/src/*.dll" +) +file(GLOB DEBUG_LIBS + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.lib" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/*.lib" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/src/*.lib" +) +if(DLLS) + file(INSTALL ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +endif() +file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +if(DEBUG_DLLS) + file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +file(INSTALL ${DEBUG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + +file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include/thor) +file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/thor RENAME copyright) From ab3b3e4fa435c560383367cd8f836f06d35b0460 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Tue, 20 Jun 2017 15:39:42 -0700 Subject: [PATCH 2/6] added description and version to control --- ports/thor/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/thor/CONTROL b/ports/thor/CONTROL index 9da28972a..ddaad1c5d 100644 --- a/ports/thor/CONTROL +++ b/ports/thor/CONTROL @@ -1,4 +1,4 @@ Source: thor -Version: -Description: +Version: v2.0 +Description: Extends the multimedia library SFML with higher-level features Build-Depends: sfml From 0cb1ec56b14c7906c48c28cc8f430cdd12386e44 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Tue, 20 Jun 2017 15:56:52 -0700 Subject: [PATCH 3/6] fix include folder --- ports/thor/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/thor/portfile.cmake b/ports/thor/portfile.cmake index 046dd57b5..710d464b9 100644 --- a/ports/thor/portfile.cmake +++ b/ports/thor/portfile.cmake @@ -67,5 +67,5 @@ endif() file(INSTALL ${DEBUG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}/include/thor) +file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/thor RENAME copyright) From dab6693550dcee29544058e72e108b540a4c08e3 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Wed, 21 Jun 2017 08:23:27 -0700 Subject: [PATCH 4/6] Added aurora as independant portfile --- ports/aurora/CONTROL | 3 +++ ports/aurora/portfile.cmake | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 ports/aurora/CONTROL create mode 100644 ports/aurora/portfile.cmake diff --git a/ports/aurora/CONTROL b/ports/aurora/CONTROL new file mode 100644 index 000000000..172c019cd --- /dev/null +++ b/ports/aurora/CONTROL @@ -0,0 +1,3 @@ +Source: aurora +Version: 2017-06-21-c75699d2a8caa726260c29b6d7a0fd35f8f28933 +Description: Aurora is an open-source C++ library providing various rather uncommon C++ utilities diff --git a/ports/aurora/portfile.cmake b/ports/aurora/portfile.cmake new file mode 100644 index 000000000..32e3d804f --- /dev/null +++ b/ports/aurora/portfile.cmake @@ -0,0 +1,11 @@ +include(vcpkg_common_functions) +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Bromeon/Aurora + REF c75699d2a8caa726260c29b6d7a0fd35f8f28933 + SHA512 862253e281eb441b773feb330d5ce4d7fe10769f516e927c0f875477ec912671fc35132a48986b2394f6d0a7160a5cb70afe868c597350c385ce23686b9613d6 + HEAD_REF master +) +file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) +file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/aurora RENAME copyright) +vcpkg_copy_pdbs() From f58052047adb5d9a3e3dee17feb9ff8f784d48e9 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Wed, 21 Jun 2017 09:04:57 -0700 Subject: [PATCH 5/6] [thor] Fixes aurora headers, defines SFML_STATIC, uses install target --- ports/thor/CONTROL | 2 +- ports/thor/portfile.cmake | 53 ++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/ports/thor/CONTROL b/ports/thor/CONTROL index ddaad1c5d..46396427b 100644 --- a/ports/thor/CONTROL +++ b/ports/thor/CONTROL @@ -1,4 +1,4 @@ Source: thor Version: v2.0 Description: Extends the multimedia library SFML with higher-level features -Build-Depends: sfml +Build-Depends: sfml, aurora diff --git a/ports/thor/portfile.cmake b/ports/thor/portfile.cmake index 710d464b9..32602a84c 100644 --- a/ports/thor/portfile.cmake +++ b/ports/thor/portfile.cmake @@ -35,37 +35,34 @@ vcpkg_configure_cmake( -DTHOR_STATIC_STD_LIBS=${THOR_STATIC_STD_LIBS} ) -vcpkg_build_cmake() +vcpkg_install_cmake() -file(GLOB DLLS - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dll" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/*.dll" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/src/*.dll" + +set(CONFIG_FILE "${CURRENT_PACKAGES_DIR}/include/Thor/Config.hpp") + +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}") + +file(GLOB LICENSE + "${CURRENT_PACKAGES_DIR}/debug/LicenseThor.txt" + "${CURRENT_PACKAGES_DIR}/debug/LicenseAurora.txt" + "${CURRENT_PACKAGES_DIR}/LicenseThor.txt" + "${CURRENT_PACKAGES_DIR}/LicenseAurora.txt" ) -file(GLOB LIBS - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.lib" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/*.lib" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/src/*.lib" -) -file(GLOB DEBUG_DLLS - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dll" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/*.dll" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/src/*.dll" -) -file(GLOB DEBUG_LIBS - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.lib" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/*.lib" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/src/*.lib" -) -if(DLLS) - file(INSTALL ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) -endif() -file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -if(DEBUG_DLLS) - file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +if(LICENSE) + file(REMOVE ${LICENSE}) endif() -file(INSTALL ${DEBUG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/Aurora) -file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/thor RENAME copyright) + +vcpkg_copy_pdbs() From cf27696e5a213bed7077dd33d6012a88bbcabd96 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Wed, 21 Jun 2017 09:29:50 -0700 Subject: [PATCH 6/6] remove internal copy used during build --- ports/thor/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/thor/portfile.cmake b/ports/thor/portfile.cmake index 32602a84c..c96df4728 100644 --- a/ports/thor/portfile.cmake +++ b/ports/thor/portfile.cmake @@ -11,6 +11,8 @@ vcpkg_from_github(ARCHIVE HEAD_REF master ) +file(COPY ${CURRENT_INSTALLED_DIR}/include/Aurora DESTINATION ${SOURCE_PATH}/extlibs/aurora/include) + set(ENV{SFML_ROOT} ${CURRENT_INSTALLED_DIR})