From 4568b57ad7728f30c1e2badc9735c8990cd51265 Mon Sep 17 00:00:00 2001 From: hesiod Date: Tue, 16 Oct 2018 03:02:05 +0100 Subject: [PATCH] [glbinding] Update to v3.0.2 (#4405) * Update glbinding to v3.0.2 Because glbinding introduced a new auxiliary library glbinding-aux the CMake export/config file organization had to be changed. * [glbinding] Simplify targets handling. General port cleanup. Force system-style install on all platforms. * [glbinding] Fix glbinding-config.cmake * [globjects] Pin forward to handle changes in glbinding 3.x --- ports/glbinding/CONTROL | 2 +- ports/glbinding/force-system-install.patch | 36 +++++++++++ ports/glbinding/portfile.cmake | 69 ++++------------------ ports/globjects/CONTROL | 2 +- ports/globjects/portfile.cmake | 67 ++++++--------------- ports/globjects/system-install.patch | 27 +++++++++ 6 files changed, 96 insertions(+), 107 deletions(-) create mode 100644 ports/glbinding/force-system-install.patch create mode 100644 ports/globjects/system-install.patch diff --git a/ports/glbinding/CONTROL b/ports/glbinding/CONTROL index 1fd7819016dbe0..d225e60c81c743 100644 --- a/ports/glbinding/CONTROL +++ b/ports/glbinding/CONTROL @@ -1,3 +1,3 @@ Source: glbinding -Version: 2.1.1-3 +Version: 3.0.2-3 Description: glbinding is an MIT licensed, cross-platform C++ binding for the OpenGL API diff --git a/ports/glbinding/force-system-install.patch b/ports/glbinding/force-system-install.patch new file mode 100644 index 00000000000000..1674f145ab7830 --- /dev/null +++ b/ports/glbinding/force-system-install.patch @@ -0,0 +1,36 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 011577a..e52d19d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -42,11 +42,13 @@ include(cmake/GenerateTemplateExportHeader.cmake) + # + + # Get git revision ++if(NOT DEFINED GIT_REV) + get_git_head_revision(GIT_REFSPEC GIT_SHA1) + string(SUBSTRING "${GIT_SHA1}" 0 12 GIT_REV) + if(NOT GIT_SHA1) + set(GIT_REV "0") + endif() ++endif() + + # Meta information about the project + set(META_PROJECT_NAME "glbinding") +@@ -135,7 +137,7 @@ if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" OR "${CMAKE_INSTALL_PREFIX}" STREQU + endif() + + # Installation paths +-if(UNIX AND SYSTEM_DIR_INSTALL) ++if(1) + # Install into the system (/usr/bin or /usr/local/bin) + set(INSTALL_ROOT "share/${project}") # /usr/[local]/share/ + set(INSTALL_CMAKE "share/${project}/cmake") # /usr/[local]/share//cmake +@@ -148,7 +150,7 @@ if(UNIX AND SYSTEM_DIR_INSTALL) + set(INSTALL_DOC "share/doc/${project}") # /usr/[local]/share/doc/ + set(INSTALL_SHORTCUTS "share/applications") # /usr/[local]/share/applications + set(INSTALL_ICONS "share/pixmaps") # /usr/[local]/share/pixmaps +- set(INSTALL_INIT "/etc/init") # /etc/init (upstart init scripts) ++ set(INSTALL_INIT "etc/init") # /etc/init (upstart init scripts) + else() + # Install into local directory + set(INSTALL_ROOT ".") # ./ diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake index cf3f64e5db6e8c..64063bc73cbd6f 100644 --- a/ports/glbinding/portfile.cmake +++ b/ports/glbinding/portfile.cmake @@ -1,79 +1,34 @@ -# Common Ambient Variables: -# VCPKG_ROOT_DIR = -# TARGET_TRIPLET is the current triplet (x86-windows, etc) -# PORT is the current port name (zlib, etc) -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# - include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO cginternals/glbinding - REF v2.1.1 - SHA512 6c7251555801272a90c87a9386324eb6993102601a036fc7d9f9b4ebed64c74d011909566e5fc5a34ef8242e24915848296023daa1420c91aaf08cf9635be397 + REF v3.0.2 + SHA512 524ad20a11af7d8ee1764f53326b43efb3b3dbd6c64d1539f4d9fa2bcb7b58a6bd6caf460d6944aed4fd7439b82536d8f28a0f0f51c14c62c2f0c73baab9afcb HEAD_REF master + PATCHES force-system-install.patch ) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DOPTION_BUILD_TESTS=OFF -DOPTION_BUILD_GPU_TESTS=OFF + -DOPTION_BUILD_TOOLS=OFF + -DGIT_REV=0 + -DCMAKE_DISABLE_FIND_PACKAGE_cpplocate=ON ) -#vcpkg_build_cmake() vcpkg_install_cmake() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) -file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/glbinding ${CURRENT_PACKAGES_DIR}/share/glbinding) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) -file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/glbinding/glbinding-export-debug.cmake GLBINDING_DEBUG_MODULE) -string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" GLBINDING_DEBUG_MODULE "${GLBINDING_DEBUG_MODULE}") -string(REPLACE "glbindingd.dll" "bin/glbindingd.dll" GLBINDING_DEBUG_MODULE "${GLBINDING_DEBUG_MODULE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export-debug.cmake "${GLBINDING_DEBUG_MODULE}") -file(READ ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export-release.cmake RELEASE_CONF) -string(REPLACE "glbinding.dll" "bin/glbinding.dll" RELEASE_CONF "${RELEASE_CONF}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export-release.cmake "${RELEASE_CONF}") -file(REMOVE ${CURRENT_PACKAGES_DIR}/glbinding-config.cmake) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/glbinding-config.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export.cmake ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-config.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding.dll ${CURRENT_PACKAGES_DIR}/bin/glbinding.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/glbindingd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/glbindingd.dll) -endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/share/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/data) -file(REMOVE ${CURRENT_PACKAGES_DIR}/AUTHORS - ${CURRENT_PACKAGES_DIR}/LICENSE - ${CURRENT_PACKAGES_DIR}/README.md - ${CURRENT_PACKAGES_DIR}/VERSION - ${CURRENT_PACKAGES_DIR}/debug/AUTHORS - ${CURRENT_PACKAGES_DIR}/debug/LICENSE - ${CURRENT_PACKAGES_DIR}/debug/README.md - ${CURRENT_PACKAGES_DIR}/debug/VERSION - ) +vcpkg_fixup_cmake_targets(CONFIG_PATH share/glbinding/cmake/glbinding TARGET_PATH share/glbinding/cmake/glbinding) +vcpkg_fixup_cmake_targets(CONFIG_PATH share/glbinding/cmake/glbinding-aux TARGET_PATH share/glbinding/cmake/glbinding-aux) -# There are some executables that are only built if glfw is found by CMake (see source/tools/*/CMakeLists.txt). -# glfw is not listed as a dependency for glbinding, so this only happen on systems where package glfw3 is present. -# glbinding's CMake doesn't offer the choice to exlude those tools from the build process, so deleting them here: -file(REMOVE ${CURRENT_PACKAGES_DIR}/glcontexts.exe - ${CURRENT_PACKAGES_DIR}/glfunctions.exe - ${CURRENT_PACKAGES_DIR}/glmeta.exe - ${CURRENT_PACKAGES_DIR}/glqueries.exe - ${CURRENT_PACKAGES_DIR}/debug/glcontextsd.exe - ${CURRENT_PACKAGES_DIR}/debug/glfunctionsd.exe - ${CURRENT_PACKAGES_DIR}/debug/glmetad.exe - ${CURRENT_PACKAGES_DIR}/debug/glqueriesd.exe -) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-config.cmake "include(\${CMAKE_CURRENT_LIST_DIR}/cmake/glbinding/glbinding-export.cmake)\ninclude(\${CMAKE_CURRENT_LIST_DIR}/cmake/glbinding-aux/glbinding-aux-export.cmake)\nset(glbinding_FOUND TRUE)\n") +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/glbinding) file(RENAME ${CURRENT_PACKAGES_DIR}/share/glbinding/LICENSE ${CURRENT_PACKAGES_DIR}/share/glbinding/copyright) -vcpkg_copy_pdbs() \ No newline at end of file +vcpkg_copy_pdbs() diff --git a/ports/globjects/CONTROL b/ports/globjects/CONTROL index df9c862dc93659..b75b256c613e89 100644 --- a/ports/globjects/CONTROL +++ b/ports/globjects/CONTROL @@ -1,5 +1,5 @@ Source: globjects Maintainer: mattias@mattiascibien.net -Version: 1.0.0-1 +Version: 1.1.0-2018-09-19 Build-Depends: glbinding, glm Description: C++ library strictly wrapping OpenGL objects. diff --git a/ports/globjects/portfile.cmake b/ports/globjects/portfile.cmake index 08fae6ec3ecf89..5019fea0de40f4 100644 --- a/ports/globjects/portfile.cmake +++ b/ports/globjects/portfile.cmake @@ -1,66 +1,37 @@ -# Common Ambient Variables: -# VCPKG_ROOT_DIR = -# TARGET_TRIPLET is the current triplet (x86-windows, etc) -# PORT is the current port name (zlib, etc) -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# - include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/globjects-1.0.0) -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/cginternals/globjects/archive/v1.0.0.zip" - FILENAME "globjects-1.0.0.zip" - SHA512 e03ae16786b11891a61f0e2f85b0d98a858d1bad3cf4c45944982d6a753dbaa8b28975dc02153360a5ac0f3be73fe86c91af130cfc0dda7459dd782f16868eeb + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO cginternals/globjects + REF fe53c4a386506d3374df12ad6f1f67c4232aa389 + SHA512 62b40675671acf050bfe4836da5b6b6a757185d296a86ad1079cf79e4a149820971ed46fce7379b73707dff368919b63d52044230a7ce75601441fe368d91e63 + HEAD_REF master + PATCHES system-install.patch ) -vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS -DOPTION_BUILD_TESTS=OFF -DOPTION_BUILD_GPU_TESTS=OFF + -DGIT_REV=0 ) -#vcpkg_build_cmake() + vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/globjects/cmake/globjects TARGET_PATH share/globjects/cmake/globjects) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) -file(RENAME ${CURRENT_PACKAGES_DIR}/cmake/globjects ${CURRENT_PACKAGES_DIR}/share/globjects) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) +file(WRITE ${CURRENT_PACKAGES_DIR}/share/globjects/globjects-config.cmake "include(CMakeFindDependencyMacro) +find_dependency(glm) +find_dependency(glbinding) -file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/globjects/globjects-export-debug.cmake globjects_DEBUG_MODULE) -string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" globjects_DEBUG_MODULE "${globjects_DEBUG_MODULE}") -string(REPLACE "globjectsd.dll" "bin/globjectsd.dll" globjects_DEBUG_MODULE "${globjects_DEBUG_MODULE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/globjects/globjects-export-debug.cmake "${globjects_DEBUG_MODULE}") -file(READ ${CURRENT_PACKAGES_DIR}/share/globjects/globjects-export-release.cmake RELEASE_CONF) -string(REPLACE "globjects.dll" "bin/globjects.dll" RELEASE_CONF "${RELEASE_CONF}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/globjects/globjects-export-release.cmake "${RELEASE_CONF}") -file(REMOVE ${CURRENT_PACKAGES_DIR}/globjects-config.cmake) -file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/globjects-config.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/globjects/globjects-export.cmake ${CURRENT_PACKAGES_DIR}/share/globjects/globjects-config.cmake) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - file(RENAME ${CURRENT_PACKAGES_DIR}/globjects.dll ${CURRENT_PACKAGES_DIR}/bin/globjects.dll) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/globjectsd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/globjectsd.dll) -endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/share/data) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/data) -file(REMOVE ${CURRENT_PACKAGES_DIR}/AUTHORS - ${CURRENT_PACKAGES_DIR}/LICENSE - ${CURRENT_PACKAGES_DIR}/README.md - ${CURRENT_PACKAGES_DIR}/VERSION - ${CURRENT_PACKAGES_DIR}/debug/AUTHORS - ${CURRENT_PACKAGES_DIR}/debug/LICENSE - ${CURRENT_PACKAGES_DIR}/debug/README.md - ${CURRENT_PACKAGES_DIR}/debug/VERSION - ) +include(\${CMAKE_CURRENT_LIST_DIR}/cmake/globjects/globjects-export.cmake) +") # Handle copyright -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/globjects) file(RENAME ${CURRENT_PACKAGES_DIR}/share/globjects/LICENSE ${CURRENT_PACKAGES_DIR}/share/globjects/copyright) vcpkg_copy_pdbs() diff --git a/ports/globjects/system-install.patch b/ports/globjects/system-install.patch new file mode 100644 index 00000000000000..10e0c5b4905dc0 --- /dev/null +++ b/ports/globjects/system-install.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6556346..48ba95d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -42,11 +42,13 @@ include(cmake/GenerateTemplateExportHeader.cmake) + # + + # Get git revision ++if(NOT DEFINED GIT_REV) + get_git_head_revision(GIT_REFSPEC GIT_SHA1) + string(SUBSTRING "${GIT_SHA1}" 0 12 GIT_REV) + if(NOT GIT_SHA1) + set(GIT_REV "0") + endif() ++endif() + + # Meta information about the project + set(META_PROJECT_NAME "globjects") +@@ -133,7 +135,7 @@ if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" OR "${CMAKE_INSTALL_PREFIX}" STREQU + endif() + + # Installation paths +-if(UNIX AND SYSTEM_DIR_INSTALL) ++if(1) + # Install into the system (/usr/bin or /usr/local/bin) + set(INSTALL_ROOT "share/${project}") # /usr/[local]/share/ + set(INSTALL_CMAKE "share/${project}/cmake") # /usr/[local]/share//cmake