From df57a82f4d0c01266165d823d869d18177a52d9d Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 31 Jan 2020 14:58:42 +0100 Subject: [PATCH 01/32] add new function vcpkg_fixup_pkgconfig --- scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 49 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 scripts/cmake/vcpkg_fixup_pkgconfig.cmake diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 564ac9421b1d73..c601f833c60919 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -13,6 +13,7 @@ include(vcpkg_execute_build_process) include(vcpkg_fail_port_install) include(vcpkg_find_acquire_program) include(vcpkg_fixup_cmake_targets) +include(vcpkg_fixup_pkgconfig) include(vcpkg_from_github) include(vcpkg_from_gitlab) include(vcpkg_from_bitbucket) diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake new file mode 100644 index 00000000000000..2653ac026eb28a --- /dev/null +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -0,0 +1,49 @@ +#.rst: +# .. command:: vcpkg_fixup_pkgconfig +# +# Tries to fix the paths found in *.pc files + +function(vcpkg_fixup_pkgconfig) + cmake_parse_arguments(_vfpkg "" "" "RELEASE_FILES;DEBUG_FILES" ${ARGN}) + + message(STATUS "Fixing pkgconfig") + if(_vfpkg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_fixup_pkgconfig was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}") + endif() + + if(NOT _vfpkg_RELEASE_FILES) + file(GLOB_RECURSE _vfpkg_RELEASE_FILES "${CURRENT_PACKAGES_DIR}/**/*.pc") + list(FILTER _vfpkg_RELEASE_FILES EXCLUDE REGEX "${CURRENT_PACKAGES_DIR}/debug/") + endif() + + if(NOT _vfpkg_DEBUG_FILES) + file(GLOB_RECURSE _vfpkg_DEBUG_FILES "${CURRENT_PACKAGES_DIR}/debug/**/*.pc") + list(FILTER _vfpkg_DEBUG_FILES INCLUDE REGEX "${CURRENT_PACKAGES_DIR}/debug/") + endif() + + message(STATUS "Fixing pkgconfig - release") + message(STATUS "Files: ${_vfpkg_RELEASE_FILES}") + foreach(_file ${_vfpkg_RELEASE_FILES}) + file(READ "${_file}" _contents) + string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") + string(REGEX REPLACE "^prefix=\\\${prefix}" "prefix=${CURRENT_INSTALLED_DIR}" _contents "${_contents}") + file(WRITE "${_file}" "${_contents}") + endforeach() + + message(STATUS "Fixing pkgconfig - debug") + message(STATUS "Files: ${_vfpkg_DEBUG_FILES}") + foreach(_file ${_vfpkg_DEBUG_FILES}) + file(READ "${_file}" _contents) + string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "debug/include" "../include" _contents "${_contents}") + string(REPLACE "debug/share" "../share" _contents "${_contents}") + string(REPLACE "debug/lib" "lib" _contents "${_contents}") # the prefix will contain the debug keyword + string(REGEX REPLACE "^prefix=\\\${prefix}" "prefix=${CURRENT_INSTALLED_DIR}" _contents "${_contents}") + file(WRITE "${_file}" "${_contents}") + endforeach() + message(STATUS "Fixing pkgconfig --- finished") +endfunction() + + From 8c89d6ee1f87fd755c550087a7058dab0db1cd1b Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Fri, 31 Jan 2020 23:26:26 +0100 Subject: [PATCH 02/32] make message with changed files a debug_message --- scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index 2653ac026eb28a..fa581ba90388d9 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -22,7 +22,7 @@ function(vcpkg_fixup_pkgconfig) endif() message(STATUS "Fixing pkgconfig - release") - message(STATUS "Files: ${_vfpkg_RELEASE_FILES}") + debug_message("Files: ${_vfpkg_RELEASE_FILES}") foreach(_file ${_vfpkg_RELEASE_FILES}) file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") @@ -32,7 +32,7 @@ function(vcpkg_fixup_pkgconfig) endforeach() message(STATUS "Fixing pkgconfig - debug") - message(STATUS "Files: ${_vfpkg_DEBUG_FILES}") + debug_message("Files: ${_vfpkg_DEBUG_FILES}") foreach(_file ${_vfpkg_DEBUG_FILES}) file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") From fd3d35d14c01aa3e54ba31ae73604adfb3bf575b Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 4 Feb 2020 16:22:29 +0100 Subject: [PATCH 03/32] add two more cases to the debug *.pc files --- scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index fa581ba90388d9..3aa30eed8e23d9 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -37,8 +37,13 @@ function(vcpkg_fixup_pkgconfig) file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "debug/include" "../include" _contents "${_contents}") + string(REPLACE "\${prefix}/include" "\${prefix}/../include" _contents "${_contents}") + string(REPLACE "debug/share" "../share" _contents "${_contents}") + string(REPLACE "\${prefix}/share" "\${prefix}/../share" _contents "${_contents}") + string(REPLACE "debug/lib" "lib" _contents "${_contents}") # the prefix will contain the debug keyword string(REGEX REPLACE "^prefix=\\\${prefix}" "prefix=${CURRENT_INSTALLED_DIR}" _contents "${_contents}") file(WRITE "${_file}" "${_contents}") From 1b1d94404f0dad9d15bd2e9782ff962fd17c8f91 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 5 Feb 2020 11:40:12 +0100 Subject: [PATCH 04/32] comment out prefix. use --define-variable=prefix=INSTALL_PATH --- scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index 3aa30eed8e23d9..a81d3cb4bf9e2c 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -27,7 +27,7 @@ function(vcpkg_fixup_pkgconfig) file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") - string(REGEX REPLACE "^prefix=\\\${prefix}" "prefix=${CURRENT_INSTALLED_DIR}" _contents "${_contents}") + string(REGEX REPLACE "^prefix=\\\${prefix}" "#prefix=${CURRENT_INSTALLED_DIR}" _contents "${_contents}") # Comment out prefix file(WRITE "${_file}" "${_contents}") endforeach() @@ -45,7 +45,7 @@ function(vcpkg_fixup_pkgconfig) string(REPLACE "\${prefix}/share" "\${prefix}/../share" _contents "${_contents}") string(REPLACE "debug/lib" "lib" _contents "${_contents}") # the prefix will contain the debug keyword - string(REGEX REPLACE "^prefix=\\\${prefix}" "prefix=${CURRENT_INSTALLED_DIR}" _contents "${_contents}") + string(REGEX REPLACE "^prefix=\\\${prefix}/debug" "#prefix=${CURRENT_INSTALLED_DIR}/debug" _contents "${_contents}") # Comment out prefix file(WRITE "${_file}" "${_contents}") endforeach() message(STATUS "Fixing pkgconfig --- finished") From d7e29622c7ad6e750d8e43848fe736521a7e6bd9 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 7 Feb 2020 09:53:26 +0100 Subject: [PATCH 05/32] changed the comment header. --- scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 32 ++++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index a81d3cb4bf9e2c..a94a79a2aba50f 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -1,7 +1,31 @@ -#.rst: -# .. command:: vcpkg_fixup_pkgconfig -# -# Tries to fix the paths found in *.pc files +## # vcpkg_fixup_pkgconfig +## +## Fix common paths in *.pc files and make everything relativ to $(prefix) +## +## ## Usage +## ```cmake +## vcpkg_fixup_pkgconfig( +## [RELEASE_FILES ...] +## [DEBUG_FILES ...] +## ) +## ``` +## +## ## Parameters +## ### RELEASE_FILES +## Specifies a list of files to apply the fixes for release paths. +## Defaults to every *.pc file in the ${CURRENT_PACKAGES_DIR} without ${CURRENT_PACKAGES_DIR}/debug/ +## +## ### RELEASE_FILES +## Specifies a list of files to apply the fixes for debug paths. +## Defaults to every *.pc file in the ${CURRENT_PACKAGES_DIR}/debug/ +## +## ## Notes +## Still work in progress. If there are more cases which can be handled here feel free to add them +## +## ## Examples +## +## Just call vcpkg_fixup_pkgconfig() after any install step which installs *.pc files. + function(vcpkg_fixup_pkgconfig) cmake_parse_arguments(_vfpkg "" "" "RELEASE_FILES;DEBUG_FILES" ${ARGN}) From f4bfe74f9ceca6ef809cf35de6c320f81bd585c6 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 7 Feb 2020 09:55:10 +0100 Subject: [PATCH 06/32] add missing word --- scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index a94a79a2aba50f..3d094680b87cad 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -13,11 +13,11 @@ ## ## Parameters ## ### RELEASE_FILES ## Specifies a list of files to apply the fixes for release paths. -## Defaults to every *.pc file in the ${CURRENT_PACKAGES_DIR} without ${CURRENT_PACKAGES_DIR}/debug/ +## Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR} without ${CURRENT_PACKAGES_DIR}/debug/ ## ## ### RELEASE_FILES ## Specifies a list of files to apply the fixes for debug paths. -## Defaults to every *.pc file in the ${CURRENT_PACKAGES_DIR}/debug/ +## Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR}/debug/ ## ## ## Notes ## Still work in progress. If there are more cases which can be handled here feel free to add them From 3e0dd50330c435b48f7ebf1f2a1ae184bb9e78e6 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 12 Mar 2020 09:01:57 +0100 Subject: [PATCH 07/32] finish vcpkg_fixup_pkgconfig.cmake --- scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 191 +++++++++++++++++++++- 1 file changed, 187 insertions(+), 4 deletions(-) diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index 3d094680b87cad..566a1fae55adc3 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -7,6 +7,7 @@ ## vcpkg_fixup_pkgconfig( ## [RELEASE_FILES ...] ## [DEBUG_FILES ...] +## [SYSTEM_LIBRARIES ...] ## ) ## ``` ## @@ -15,10 +16,18 @@ ## Specifies a list of files to apply the fixes for release paths. ## Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR} without ${CURRENT_PACKAGES_DIR}/debug/ ## -## ### RELEASE_FILES +## ### DEBUG_FILES ## Specifies a list of files to apply the fixes for debug paths. ## Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR}/debug/ ## +## ### SYSTEM_PACKAGES +## If the *.pc file contains system packages outside vcpkg these need to be listed here. +## Since vcpkg checks the existence of all required packages within vcpkg. +## +## ### SYSTEM_LIBRARIES +## If the *.pc file contains system libraries outside vcpkg these need to be listed here. +## VCPKG checks every -l flag for the existence of the required library within vcpkg. +## ## ## Notes ## Still work in progress. If there are more cases which can be handled here feel free to add them ## @@ -26,10 +35,158 @@ ## ## Just call vcpkg_fixup_pkgconfig() after any install step which installs *.pc files. +function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_libs _system_packages) + set(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES}) + list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll.a;.a") + #message(STATUS "Checking configuration: ${_config}") + if("${_config}" STREQUAL "DEBUG") + set(prefix "${CURRENT_INSTALLED_DIR}/debug/") + set(libprefix "${CURRENT_INSTALLED_DIR}/debug/lib/") + set(installprefix "${CURRENT_PACKAGES_DIR}/debug/") + set(installlibprefix "${CURRENT_PACKAGES_DIR}/debug/lib/") + set(lib_suffixes d _d _debug) + elseif("${_config}" STREQUAL "RELEASE") + set(prefix "${CURRENT_INSTALLED_DIR}") + set(libprefix "${CURRENT_INSTALLED_DIR}/lib/") + set(installprefix "${CURRENT_PACKAGES_DIR}/") + set(installlibprefix "${CURRENT_PACKAGES_DIR}/lib/") + set(lib_suffixes "") + else() + message(FATAL_ERROR "Unknown configuration in vcpkg_fixup_pkgconfig_check_libraries!") + endif() + set(_contents "${${_contents_var}}") + #message(STATUS "Contents: ${_contents}") + set(_system_lib_normalized) + foreach(_system_lib ${_system_libs}) + string(REPLACE "-l" "" _system_lib "${_system_lib}") + list(APPEND _system_lib_normalized "${_system_lib}") + endforeach() + + ## Extra libraries: + string(REGEX MATCH "Libs:[^\n]+" _libs "${_contents}") + #message(STATUS "LIB LINE: ${_libs}") + # The path to the library is either quoted and can not contain a quote or it is unqouted and cannot contain a single unescaped space + string(REGEX REPLACE "Libs:" "" _libs_list_tmp "${_libs}") + string(REGEX REPLACE [[[\t ]+(-(l|L)("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_list_tmp "${_libs_list_tmp}") + + string(REGEX MATCH "Libs.private:[^\n]+" _libs_private "${_contents}") + string(REGEX REPLACE "Libs.private:" "" _libs_private_list_tmp "${_libs_private}") + string(REGEX REPLACE [[[\t ]+(-(l|L)("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_private_list_tmp "${_libs_private_list_tmp}") + + #message(STATUS "Found libraries: ${_libs_list_tmp}") + #message(STATUS "Found private libraries: ${_libs_private_list_tmp}") + list(APPEND _all_libs "${_libs_list_tmp}" "${_libs_private_list_tmp}") + list(REMOVE_DUPLICATES _all_libs) + foreach(_lib ${_all_libs}) + string(REGEX REPLACE "(^[\t ]+|[\t ]+$)" "" _lib "${_lib}") # Remove whitespaces at begin & end + if( "x${_lib}x" STREQUAL "xx") #Empty String + continue() + endif() + unset(CHECK_LIB CACHE) + unset(NO_CHECK_LIB) + #message(STATUS "CHECKING: x${_lib}z") + if("${_lib}" MATCHES "^-L((\\ |[^ ]+)+)$") + message(STATUS "Search path for libraries ${CMAKE_MATCH_1}") # not used yet we assume everything can be found in libprefix + continue() + elseif("${_lib}" MATCHES [[^-l("[^"]+"|(\\ |[^ ]+)+)$]] ) + set(_libname ${CMAKE_MATCH_1}) + #message(STATUS "CHECKING LIB: ${_libname}") + foreach(_system_lib "${_system_libs}") + #message(STATUS "AGAINST: ${_system_lib}") + string(REPLACE "^[\t ]*-l" "" _libname_norm "${_libname}") + string(REGEX REPLACE "[\t ]+$" "" _libname_norm "${_libname_norm}") + if("${_libname_norm}" MATCHES "${_system_lib}") + set(NO_CHECK_LIB ON) + #message(STATUS "FOUND SYSTEM LIB") + break() + endif() + endforeach() + if(NO_CHECK_LIB) + break() + endif() + debug_message("Searching for library ${_libname} in ${libprefix}") + if(EXISTS "${_libname}") #full path + set(CHECK_LIB_${_libname} "${_libname}" CACHE INTERNAL FORCE) + endif() + find_library(CHECK_LIB_${_libname} NAMES "${_libname}" PATHS "${libprefix}" "${installlibprefix}" NO_DEFAULT_PATH) + if(NOT CHECK_LIB_${_libname} AND "${_config}" STREQUAL "DEBUG") + #message(STATUS "Unable to locate ${_libname}. Trying with debug suffix") + foreach(_lib_suffix ${lib_suffixes}) + string(REPLACE ".dll.a|.a|.lib|.so" "" _name_without_extension "${_libname}") + find_library(CHECK_LIB_${_libname} NAMES ${_name_without_extension}${_lib_suffix} PATHS "${libprefix}" "${installlibprefix}") + if(CHECK_LIB_${_libname}) + message(FATAL_ERROR "Found ${CHECK_LIB_${_libname}} with additional debug suffix! Please correct the *.pc file!") + string(REGEX REPLACE "(-l${_name_without_extension})(\.dll\.a|\.a|\.lib|\.so)" "\\1${_lib_suffix}\\2" _contents ${_contents}) + endif() + endforeach() + if(NOT CHECK_LIB_${_libname}) + message(FATAL_ERROR "Library ${_libname} was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") + endif() + endif() + else() + #handle special cases + if(_lib STREQUAL "-pthread" OR _lib STREQUAL "-pthreads") + # Replace with VCPKG version? + #VCPKG should probably rename one of the pthread versions to avoid linking against system pthread? + # set(PTHREAD_SUFFIX ) + # if("${_config}" STREQUAL "DEBUG") + # file(GLOB PTHREAD_LIB "${CURRENT_INSTALLED_DIR}/debug/lib/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}pthread*C3d.*") + # elseif("${_config}" STREQUAL "RELEASE") + # file(GLOB PTHREAD_LIB "${CURRENT_INSTALLED_DIR}/lib/${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}pthread*C3.*") + # endif() + # get_filename_component(PTHREAD_LIB "${PTHREAD_LIB}" NAME_WE) + # string(REPLACE "Libs: -pthread" "Libs: -L\${libdir} -l${PTHREAD_LIB}" _contents ${_contents}) + else() + message(FATAL_ERROR "Found ${_lib} and no rule to analyse the flag! Please check the *.pc file") + endif() + endif() + unset(CHECK_LIB_${_libname} CACHE) + unset(NO_CHECK_LIB) + endforeach() + + ## Packages: + string(REGEX MATCH "Requires:[^\n]+" _pkg "${_contents}") + string(REGEX REPLACE "Requires:[\t ]" "" _pkg_list_tmp "${_pkg_list_tmp}") + string(REGEX REPLACE "[\t ]*,[\t ]*" ";" _pkg_list_tmp "${_pkg_list_tmp}") + string(REGEX REPLACE "[\t ]*(>|=)+[\t ]*([0-9]+|\\.)+" "" _pkg_list_tmp "${_pkg_list_tmp}") + string(REGEX REPLACE " " ";" _pkg_list_tmp "${_pkg_list_tmp}") + string(REGEX MATCH "Requires.private:[^\n]+" _pkg_private_list_tmp "${_contents}") + string(REGEX REPLACE "Requires.private:[\t ]" "" _pkg_private_list_tmp "${_pkg_private_list_tmp}") + string(REGEX REPLACE "[\t ]*,[\t ]*" ";" _pkg_private_list_tmp "${_pkg_private_list_tmp}") + string(REGEX REPLACE "[\t ]*(>|=)+[\t ]]*([0-9]+|\\.)+" " " _pkg_private_list_tmp "${_pkg_private_list_tmp}") + string(REGEX REPLACE "[\t ]+" ";" _pkg_private_list_tmp "${_pkg_private_list_tmp}") + + debug_message("Required packages: ${_pkg_list_tmp}") + debug_message("Required private packages: ${_pkg_private_list_tmp}") + + message(STATUS "System packages: ${_system_packages}") + foreach(_package ${_pkg_list_tmp} ${_pkg_private_list_tmp}) + debug_message("Searching for package: ${_package}") + set(PKG_CHECK ON) + if(NOT "${_system_packages}" STREQUAL "") + #message(STATUS "Checking ${_package} for SYSTEM PACKAGE: ${_system_packages}") + if("${_system_packages}" MATCHES "${_package}" ) + debug_message("Package ${_package} is SYSTEM PACKAGE!") + set(PKG_CHECK OFF) + endif() + endif() + if(PKG_CHECK AND NOT (EXISTS "${libprefix}/pkgconfig/${_package}.pc" OR EXISTS "${installlibprefix}/pkgconfig/${_package}.pc")) + message(FATAL_ERROR "Package ${_package} not found! If it is a system package add it to the SYSTEM_PACKAGES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") + else() + debug_message("Found package ${_package}!") + endif() + endforeach() + ## Push modifications up in scope + set(${_contents_var} "${_contents}" PARENT_SCOPE) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP}) +endfunction() function(vcpkg_fixup_pkgconfig) - cmake_parse_arguments(_vfpkg "" "" "RELEASE_FILES;DEBUG_FILES" ${ARGN}) + cmake_parse_arguments(_vfpkg "" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES" ${ARGN}) + if(VCPKG_TARGET_IS_LINUX) + list(APPEND _vfpkg_SYSTEM_LIBRARIES -ldl -lm) + endif() message(STATUS "Fixing pkgconfig") if(_vfpkg_UNPARSED_ARGUMENTS) message(FATAL_ERROR "vcpkg_fixup_pkgconfig was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}") @@ -45,13 +202,20 @@ function(vcpkg_fixup_pkgconfig) list(FILTER _vfpkg_DEBUG_FILES INCLUDE REGEX "${CURRENT_PACKAGES_DIR}/debug/") endif() + #Absolute Unix like paths + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}") + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}") + message(STATUS "Fixing pkgconfig - release") debug_message("Files: ${_vfpkg_RELEASE_FILES}") foreach(_file ${_vfpkg_RELEASE_FILES}) file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") string(REGEX REPLACE "^prefix=\\\${prefix}" "#prefix=${CURRENT_INSTALLED_DIR}" _contents "${_contents}") # Comment out prefix + vcpkg_fixup_pkgconfig_check_libraries("RELEASE" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}") file(WRITE "${_file}" "${_contents}") endforeach() @@ -61,7 +225,9 @@ function(vcpkg_fixup_pkgconfig) file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") - + string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") + string(REPLACE "debug/include" "../include" _contents "${_contents}") string(REPLACE "\${prefix}/include" "\${prefix}/../include" _contents "${_contents}") @@ -70,9 +236,26 @@ function(vcpkg_fixup_pkgconfig) string(REPLACE "debug/lib" "lib" _contents "${_contents}") # the prefix will contain the debug keyword string(REGEX REPLACE "^prefix=\\\${prefix}/debug" "#prefix=${CURRENT_INSTALLED_DIR}/debug" _contents "${_contents}") # Comment out prefix + string(REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}") # replace remaining debug paths if they exist. + vcpkg_fixup_pkgconfig_check_libraries("DEBUG" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}") file(WRITE "${_file}" "${_contents}") endforeach() message(STATUS "Fixing pkgconfig --- finished") + + set(VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL FORCE) + # Variable to check if this function has been called! + # Theoreotically vcpkg could look for *.pc files and automatically call this function + # or check if this function has been called if *.pc files are detected. + # The same is true for vcpkg_fixup_cmake_targets endfunction() - + + # script to test the function locally without running vcpkg. Uncomment fix filepaths and use cmake -P vcpkg_fixup_pkgconfig + # set(_file "G:\\xlinux\\packages\\xlib_x64-windows\\lib\\pkgconfig\\x11.pc") + # include(${CMAKE_CURRENT_LIST_DIR}/vcpkg_common_definitions.cmake) + # file(READ "${_file}" _contents) + # set(CURRENT_INSTALLED_DIR "G:/xlinux/installed/x64-windows") + # set(CURRENT_PACKAGES_DIR "G:/xlinux/packages/xlib_x64-windows") + # set(_vfpkg_SYSTEM_LIBRARIES "blu\\ ub") + # set(_vfpkg_SYSTEM_PACKAGES "szip") + # vcpkg_fixup_pkgconfig_check_libraries("RELEASE" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}") From a3d4a0b4757340c3d6244a7e1a1b9d4eb1118c34 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Fri, 20 Mar 2020 09:54:22 +0100 Subject: [PATCH 08/32] Update vcpkg_fixup_pkgconfig.cmake Note: since CMake is run in script mode the description of VCPKG_FIXUP_PKGCONFIG_CALLED cannot be viewed --- scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index 566a1fae55adc3..ef6b7f05f10f9b 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -242,7 +242,7 @@ function(vcpkg_fixup_pkgconfig) endforeach() message(STATUS "Fixing pkgconfig --- finished") - set(VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL FORCE) + set(VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL "See below" FORCE) # Variable to check if this function has been called! # Theoreotically vcpkg could look for *.pc files and automatically call this function # or check if this function has been called if *.pc files are detected. From efbf912a704f3a96f51b4f8eca2c6aee148da7de Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 25 Mar 2020 15:48:46 +0100 Subject: [PATCH 09/32] transfer changes from x windows pr --- scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 54 +++++++++++++++-------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index ef6b7f05f10f9b..bcbeca4bb6ed43 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -28,14 +28,16 @@ ## If the *.pc file contains system libraries outside vcpkg these need to be listed here. ## VCPKG checks every -l flag for the existence of the required library within vcpkg. ## +## ### IGNORE_FLAGS +## If the *.pc file contains flags in the lib field which are not libraries. These can be listed here +## ## ## Notes ## Still work in progress. If there are more cases which can be handled here feel free to add them ## ## ## Examples ## ## Just call vcpkg_fixup_pkgconfig() after any install step which installs *.pc files. - -function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_libs _system_packages) +function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_libs _system_packages _ignore_flags) set(CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${CMAKE_FIND_LIBRARY_SUFFIXES}) list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll.a;.a") #message(STATUS "Checking configuration: ${_config}") @@ -54,6 +56,7 @@ function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_lib else() message(FATAL_ERROR "Unknown configuration in vcpkg_fixup_pkgconfig_check_libraries!") endif() + debug_message("Default library search paths: ${libprefix} --- ${installlibprefix} --- ${PKG_LIB_SEARCH_PATH}") set(_contents "${${_contents_var}}") #message(STATUS "Contents: ${_contents}") set(_system_lib_normalized) @@ -67,11 +70,11 @@ function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_lib #message(STATUS "LIB LINE: ${_libs}") # The path to the library is either quoted and can not contain a quote or it is unqouted and cannot contain a single unescaped space string(REGEX REPLACE "Libs:" "" _libs_list_tmp "${_libs}") - string(REGEX REPLACE [[[\t ]+(-(l|L)("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_list_tmp "${_libs_list_tmp}") + string(REGEX REPLACE [[[\t ]+(-(l|L)?("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_list_tmp "${_libs_list_tmp}") string(REGEX MATCH "Libs.private:[^\n]+" _libs_private "${_contents}") string(REGEX REPLACE "Libs.private:" "" _libs_private_list_tmp "${_libs_private}") - string(REGEX REPLACE [[[\t ]+(-(l|L)("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_private_list_tmp "${_libs_private_list_tmp}") + string(REGEX REPLACE [[[\t ]+(-(l|L)?("[^"]+"|(\\ |[^ ]+)+))]] ";\\1" _libs_private_list_tmp "${_libs_private_list_tmp}") #message(STATUS "Found libraries: ${_libs_list_tmp}") #message(STATUS "Found private libraries: ${_libs_private_list_tmp}") @@ -86,34 +89,35 @@ function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_lib unset(NO_CHECK_LIB) #message(STATUS "CHECKING: x${_lib}z") if("${_lib}" MATCHES "^-L((\\ |[^ ]+)+)$") - message(STATUS "Search path for libraries ${CMAKE_MATCH_1}") # not used yet we assume everything can be found in libprefix + debug_message("Search path for libraries (unused): ${CMAKE_MATCH_1}") # not used yet we assume everything can be found in libprefix continue() elseif("${_lib}" MATCHES [[^-l("[^"]+"|(\\ |[^ ]+)+)$]] ) set(_libname ${CMAKE_MATCH_1}) - #message(STATUS "CHECKING LIB: ${_libname}") - foreach(_system_lib "${_system_libs}") - #message(STATUS "AGAINST: ${_system_lib}") + debug_message("Searching for library: ${_libname}") + #debug_message("System libraries: ${_system_libs}") + foreach(_system_lib ${_system_libs}) string(REPLACE "^[\t ]*-l" "" _libname_norm "${_libname}") string(REGEX REPLACE "[\t ]+$" "" _libname_norm "${_libname_norm}") - if("${_libname_norm}" MATCHES "${_system_lib}") + #debug_message("${_libname_norm} vs ${_system_lib}") + if("${_libname_norm}" MATCHES "${_system_lib}" OR "-l${_libname_norm}" MATCHES "${_system_lib}") set(NO_CHECK_LIB ON) - #message(STATUS "FOUND SYSTEM LIB") + debug_message("${_libname} is SYSTEM_LIBRARY") break() endif() endforeach() if(NO_CHECK_LIB) break() endif() - debug_message("Searching for library ${_libname} in ${libprefix}") + #debug_message("Searching for library ${_libname} in ${libprefix}") if(EXISTS "${_libname}") #full path set(CHECK_LIB_${_libname} "${_libname}" CACHE INTERNAL FORCE) endif() - find_library(CHECK_LIB_${_libname} NAMES "${_libname}" PATHS "${libprefix}" "${installlibprefix}" NO_DEFAULT_PATH) + find_library(CHECK_LIB_${_libname} NAMES "${_libname}" PATHS "${libprefix}" "${installlibprefix}" "${PKG_LIB_SEARCH_PATH}" NO_DEFAULT_PATH) if(NOT CHECK_LIB_${_libname} AND "${_config}" STREQUAL "DEBUG") #message(STATUS "Unable to locate ${_libname}. Trying with debug suffix") foreach(_lib_suffix ${lib_suffixes}) string(REPLACE ".dll.a|.a|.lib|.so" "" _name_without_extension "${_libname}") - find_library(CHECK_LIB_${_libname} NAMES ${_name_without_extension}${_lib_suffix} PATHS "${libprefix}" "${installlibprefix}") + find_library(CHECK_LIB_${_libname} NAMES ${_name_without_extension}${_lib_suffix} PATHS "${libprefix}" "${installlibprefix}" "${PKG_LIB_SEARCH_PATH}") if(CHECK_LIB_${_libname}) message(FATAL_ERROR "Found ${CHECK_LIB_${_libname}} with additional debug suffix! Please correct the *.pc file!") string(REGEX REPLACE "(-l${_name_without_extension})(\.dll\.a|\.a|\.lib|\.so)" "\\1${_lib_suffix}\\2" _contents ${_contents}) @@ -122,6 +126,10 @@ function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_lib if(NOT CHECK_LIB_${_libname}) message(FATAL_ERROR "Library ${_libname} was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") endif() + elseif(NOT CHECK_LIB_${_libname}) + message(FATAL_ERROR "Library ${_libname} was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") + else() + debug_message("Found ${_libname} at ${CHECK_LIB_${_libname}}") endif() else() #handle special cases @@ -145,7 +153,7 @@ function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_lib endforeach() ## Packages: - string(REGEX MATCH "Requires:[^\n]+" _pkg "${_contents}") + string(REGEX MATCH "Requires:[^\n]+" _pkg_list_tmp "${_contents}") string(REGEX REPLACE "Requires:[\t ]" "" _pkg_list_tmp "${_pkg_list_tmp}") string(REGEX REPLACE "[\t ]*,[\t ]*" ";" _pkg_list_tmp "${_pkg_list_tmp}") string(REGEX REPLACE "[\t ]*(>|=)+[\t ]*([0-9]+|\\.)+" "" _pkg_list_tmp "${_pkg_list_tmp}") @@ -159,7 +167,7 @@ function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_lib debug_message("Required packages: ${_pkg_list_tmp}") debug_message("Required private packages: ${_pkg_private_list_tmp}") - message(STATUS "System packages: ${_system_packages}") + #message(STATUS "System packages: ${_system_packages}") foreach(_package ${_pkg_list_tmp} ${_pkg_private_list_tmp}) debug_message("Searching for package: ${_package}") set(PKG_CHECK ON) @@ -170,7 +178,7 @@ function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_lib set(PKG_CHECK OFF) endif() endif() - if(PKG_CHECK AND NOT (EXISTS "${libprefix}/pkgconfig/${_package}.pc" OR EXISTS "${installlibprefix}/pkgconfig/${_package}.pc")) + if(PKG_CHECK AND NOT (EXISTS "${libprefix}/pkgconfig/${_package}.pc" OR EXISTS "${installlibprefix}/pkgconfig/${_package}.pc" OR EXISTS "${PKG_LIB_SEARCH_PATH}/pkgconfig/${_package}.pc")) message(FATAL_ERROR "Package ${_package} not found! If it is a system package add it to the SYSTEM_PACKAGES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, corret the *.pc file") else() debug_message("Found package ${_package}!") @@ -182,7 +190,7 @@ function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_lib endfunction() function(vcpkg_fixup_pkgconfig) - cmake_parse_arguments(_vfpkg "" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES" ${ARGN}) + cmake_parse_arguments(_vfpkg "" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS" ${ARGN}) if(VCPKG_TARGET_IS_LINUX) list(APPEND _vfpkg_SYSTEM_LIBRARIES -ldl -lm) @@ -209,19 +217,26 @@ function(vcpkg_fixup_pkgconfig) message(STATUS "Fixing pkgconfig - release") debug_message("Files: ${_vfpkg_RELEASE_FILES}") foreach(_file ${_vfpkg_RELEASE_FILES}) + message(STATUS "Checking file: ${_file}") + get_filename_component(PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY) + string(REGEX REPLACE "/pkgconfig/?" "" PKG_LIB_SEARCH_PATH "${PKG_LIB_SEARCH_PATH}") file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") string(REGEX REPLACE "^prefix=\\\${prefix}" "#prefix=${CURRENT_INSTALLED_DIR}" _contents "${_contents}") # Comment out prefix - vcpkg_fixup_pkgconfig_check_libraries("RELEASE" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}") + vcpkg_fixup_pkgconfig_check_libraries("RELEASE" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}" "${_vfpkg_IGNORE_FLAGS}") file(WRITE "${_file}" "${_contents}") + unset(PKG_LIB_SEARCH_PATH) endforeach() message(STATUS "Fixing pkgconfig - debug") debug_message("Files: ${_vfpkg_DEBUG_FILES}") foreach(_file ${_vfpkg_DEBUG_FILES}) + message(STATUS "Checking file: ${_file}") + get_filename_component(PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY) + string(REGEX REPLACE "/pkgconfig/?" "" PKG_LIB_SEARCH_PATH "${PKG_LIB_SEARCH_PATH}") file(READ "${_file}" _contents) string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") @@ -237,8 +252,9 @@ function(vcpkg_fixup_pkgconfig) string(REPLACE "debug/lib" "lib" _contents "${_contents}") # the prefix will contain the debug keyword string(REGEX REPLACE "^prefix=\\\${prefix}/debug" "#prefix=${CURRENT_INSTALLED_DIR}/debug" _contents "${_contents}") # Comment out prefix string(REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}") # replace remaining debug paths if they exist. - vcpkg_fixup_pkgconfig_check_libraries("DEBUG" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}") + vcpkg_fixup_pkgconfig_check_libraries("DEBUG" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}" "${_vfpkg_IGNORE_FLAGS}") file(WRITE "${_file}" "${_contents}") + unset(PKG_LIB_SEARCH_PATH) endforeach() message(STATUS "Fixing pkgconfig --- finished") From a7c6c6c8466862a873a15120ba616d0cff8f53c2 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 26 Mar 2020 13:52:17 +0100 Subject: [PATCH 10/32] fix typo in regex --- scripts/cmake/vcpkg_fixup_pkgconfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake index bcbeca4bb6ed43..fdf342b23da7b7 100644 --- a/scripts/cmake/vcpkg_fixup_pkgconfig.cmake +++ b/scripts/cmake/vcpkg_fixup_pkgconfig.cmake @@ -161,7 +161,7 @@ function(vcpkg_fixup_pkgconfig_check_libraries _config _contents_var _system_lib string(REGEX MATCH "Requires.private:[^\n]+" _pkg_private_list_tmp "${_contents}") string(REGEX REPLACE "Requires.private:[\t ]" "" _pkg_private_list_tmp "${_pkg_private_list_tmp}") string(REGEX REPLACE "[\t ]*,[\t ]*" ";" _pkg_private_list_tmp "${_pkg_private_list_tmp}") - string(REGEX REPLACE "[\t ]*(>|=)+[\t ]]*([0-9]+|\\.)+" " " _pkg_private_list_tmp "${_pkg_private_list_tmp}") + string(REGEX REPLACE "[\t ]*(>|=)+[\t ]*([0-9]+|\\.)+" " " _pkg_private_list_tmp "${_pkg_private_list_tmp}") string(REGEX REPLACE "[\t ]+" ";" _pkg_private_list_tmp "${_pkg_private_list_tmp}") debug_message("Required packages: ${_pkg_list_tmp}") From 93070958bbb2e4a8bfc841fafb217dac05738f9d Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 30 Mar 2020 22:29:25 +0200 Subject: [PATCH 11/32] add port for vs yasm integration within VCPKG --- ports/vs-yasm/CONTROL | 5 +++++ ports/vs-yasm/portfile.cmake | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 ports/vs-yasm/CONTROL create mode 100644 ports/vs-yasm/portfile.cmake diff --git a/ports/vs-yasm/CONTROL b/ports/vs-yasm/CONTROL new file mode 100644 index 00000000000000..9b0125a6723210 --- /dev/null +++ b/ports/vs-yasm/CONTROL @@ -0,0 +1,5 @@ +Source: vs-yasm +Version: 0.5.0 +Homepage: https://github.com/ShiftMediaProject/VSYASM +Description: Provides Visual Studio integration for the YASM assembler. +Supports: windows \ No newline at end of file diff --git a/ports/vs-yasm/portfile.cmake b/ports/vs-yasm/portfile.cmake new file mode 100644 index 00000000000000..54c1f1906e0454 --- /dev/null +++ b/ports/vs-yasm/portfile.cmake @@ -0,0 +1,15 @@ +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ShiftMediaProject/VSYASM + REF deb50d9f18e8461538468339d508cdf240e64897 #v0.5 + SHA512 04627546020d33e5ea91f74b09c5ce3b817dce5f6ae4548c3b4148daa82fbd837c81675ac8730d3ca1cdf91fefa8bb23eec76d1bcd02c03dda1203d0c261178d + HEAD_REF master +) + +set(_files yasm.props yasm.targets yasm.xml) +foreach(_file ${_files}) + file(INSTALL "${SOURCE_PATH}/${_file}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/") +endforeach() + +configure_file("${SOURCE_PATH}/COPYING" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY) \ No newline at end of file From 2a217d6d52319be78c111eaaa2aa04ed92b70b23 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 30 Mar 2020 22:30:06 +0200 Subject: [PATCH 12/32] add gmp --- ports/gmp/CONTROL | 5 ++ ports/gmp/portfile.cmake | 108 +++++++++++++++++++++++++ ports/gmp/vs.build.patch | 165 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 278 insertions(+) create mode 100644 ports/gmp/CONTROL create mode 100644 ports/gmp/portfile.cmake create mode 100644 ports/gmp/vs.build.patch diff --git a/ports/gmp/CONTROL b/ports/gmp/CONTROL new file mode 100644 index 00000000000000..54fe0fe2c3298d --- /dev/null +++ b/ports/gmp/CONTROL @@ -0,0 +1,5 @@ +Source: gmp +Version: 6.2.0 +Homepage: https://gmplib.org/ +Description: The GNU Multiple Precision Arithmetic Library +Build-Depends: vs-yasm (windows) \ No newline at end of file diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake new file mode 100644 index 00000000000000..252f341f30bb82 --- /dev/null +++ b/ports/gmp/portfile.cmake @@ -0,0 +1,108 @@ + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ShiftMediaProject/gmp + REF e140dfc8668e96d7e56cbd46467945adcc6b3cc4 #v6.2.0 + SHA512 3b646c142447946bb4556db01214ff130da917bc149946b8cf086f3b01e1cc3d664b941a30a42608799c14461b2f29e4b894b72915d723bd736513c8914729b7 + HEAD_REF master + PATCHES vs.build.patch + ) + vcpkg_find_acquire_program(YASM) + get_filename_component(YASM_DIR "${YASM}" DIRECTORY) + vcpkg_add_to_path(${YASM_DIR}) + set(ENV{YASMPATH} ${YASM_DIR}/) + if (TRIPLET_SYSTEM_ARCH MATCHES "x86") + set(PLATFORM "Win32") + else () + set(PLATFORM ${TRIPLET_SYSTEM_ARCH}) + endif() + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(CONFIGURATION_RELEASE ReleaseDLL) + set(CONFIGURATION_DEBUG DebugDLL) + else() + set(CONFIGURATION_RELEASE Release) + set(CONFIGURATION_DEBUG Debug) + endif() + + if(VCPKG_TARGET_IS_UWP) + string(APPEND CONFIGURATION_RELEASE WinRT) + string(APPEND CONFIGURATION_DEBUG WinRT) + endif() + # + set(_file "${SOURCE_PATH}/SMP/libgmp.vcxproj") + file(READ "${_file}" _contents) + string(REPLACE +[[ + ]] +"\n \ + \n \ + " + _contents "${_contents}") + file(WRITE "${_file}" "${_contents}") + + vcpkg_install_msbuild( + SOURCE_PATH ${SOURCE_PATH} + PROJECT_SUBPATH SMP/libgmp.sln + PLATFORM ${PLATFORM} + LICENSE_SUBPATH COPYING.LESSERv3 + TARGET Rebuild + RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE} + DEBUG_CONFIGURATION ${CONFIGURATION_DEBUG} + SKIP_CLEAN + ) + get_filename_component(SOURCE_PATH_SUFFIX "${SOURCE_PATH}" NAME) + file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/include" "${CURRENT_PACKAGES_DIR}/include") + set(PACKAGE_VERSION 6.2.0) + set(PACKAGE_NAME gmp) + set(prefix "${CURRENT_INSTALLED_DIR}") + set(exec_prefix "\${prefix}") + set(libdir "\${prefix}/lib") + set(includedir "\${prefix}/include") + set(LIBS -lgmp) + configure_file("${SOURCE_PATH}/gmp.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gmp.pc" @ONLY) + configure_file("${SOURCE_PATH}/gmpxx.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gmpxx.pc" @ONLY) + set(prefix "${CURRENT_INSTALLED_DIR}/debug") + set(exec_prefix "\${prefix}") + set(libdir "\${prefix}/lib") + set(includedir "\${prefix}/../include") + set(LIBS -lgmpd) + configure_file("${SOURCE_PATH}/gmp.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gmp.pc" @ONLY) + configure_file("${SOURCE_PATH}/gmpxx.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gmpxx.pc" @ONLY) + vcpkg_fixup_pkgconfig() +else() + vcpkg_download_distfile( + ARCHIVE + URLS https://gmplib.org/download/gmp/gmp-6.2.0.tar.xz + FILENAME gmp-6.2.0.tar.xz + SHA512 a066f0456f0314a1359f553c49fc2587e484ff8ac390ff88537266a146ea373f97a1c0ba24608bf6756f4eab11c9056f103c8deb99e5b57741b4f7f0ec44b90c) + + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + REF gmp-6.2.0 + ) + + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + #SKIP_CONFIGURE + #NO_DEBUG + #AUTO_HOST + #AUTO_DST + #PRERUN_SHELL ${SHELL_PATH} + OPTIONS ${OPTIONS} + #OPTIONS_DEBUG + #OPTIONS_RELEASE + ) + + vcpkg_install_make() + vcpkg_fixup_pkgconfig() + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + # # Handle copyright + file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +endif() + + diff --git a/ports/gmp/vs.build.patch b/ports/gmp/vs.build.patch new file mode 100644 index 00000000000000..69aba99398f9d9 --- /dev/null +++ b/ports/gmp/vs.build.patch @@ -0,0 +1,165 @@ +diff --git a/SMP/libgmp.vcxproj b/SMP/libgmp.vcxproj +index b4e06ae42..442d82c51 100644 +--- a/SMP/libgmp.vcxproj ++++ b/SMP/libgmp.vcxproj +@@ -1559,114 +1559,114 @@ + + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmpd ++ gmpd + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmpd_winrt ++ gmpd + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + libgmpd +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmpd_winrt +- $(ProjectDir)..\..\..\msvc\ ++ libgmpd ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + gmpd + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- gmpd_winrt ++ gmpd + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + gmpd +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- gmpd_winrt +- $(ProjectDir)..\..\..\msvc\ ++ gmpd ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmp ++ gmp + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmp_winrt ++ gmp + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + libgmp +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmp_winrt +- $(ProjectDir)..\..\..\msvc\ ++ libgmp ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + gmp + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- gmp_winrt ++ gmp + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + gmp +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- gmp_winrt +- $(ProjectDir)..\..\..\msvc\ ++ gmp ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + +diff --git a/gmp.pc.in b/gmp.pc.in +index bf1c799ad..d0c81be91 100644 +--- a/gmp.pc.in ++++ b/gmp.pc.in +@@ -8,4 +8,4 @@ Description: GNU Multiple Precision Arithmetic Library + URL: https://gmplib.org + Version: @PACKAGE_VERSION@ + Cflags: -I${includedir} +-Libs: -L${libdir} -lgmp ++Libs: -L${libdir} @LIBS@ +diff --git a/gmpxx.pc.in b/gmpxx.pc.in +index 181cc70c6..2b697ceab 100644 +--- a/gmpxx.pc.in ++++ b/gmpxx.pc.in +@@ -9,4 +9,4 @@ URL: https://gmplib.org + Version: @PACKAGE_VERSION@ + Requires: gmp + Cflags: -I${includedir} +-Libs: -L${libdir} -lgmpxx ++Libs: -L${libdir} @LIBS@ From 417dd8a152f85ce8c668e5102d8a65e60cb82e89 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 30 Mar 2020 22:30:42 +0200 Subject: [PATCH 13/32] add nettle --- ports/nettle/CONTROL | 5 + ports/nettle/gmp.patch | 273 +++++++++++++++++ ports/nettle/name.dir.patch | 567 ++++++++++++++++++++++++++++++++++++ ports/nettle/portfile.cmake | 136 +++++++++ 4 files changed, 981 insertions(+) create mode 100644 ports/nettle/CONTROL create mode 100644 ports/nettle/gmp.patch create mode 100644 ports/nettle/name.dir.patch create mode 100644 ports/nettle/portfile.cmake diff --git a/ports/nettle/CONTROL b/ports/nettle/CONTROL new file mode 100644 index 00000000000000..2d9ed8ab68b64f --- /dev/null +++ b/ports/nettle/CONTROL @@ -0,0 +1,5 @@ +Source: nettle +Version: 3.5.1 +Homepage: https://git.lysator.liu.se/nettle/nettle +Description: Nettle is a low-level cryptographic library that is designed to fit easily in more or less any context: In crypto toolkits for object-oriented languages (C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in kernel space. +Build-Depends: gmp, vs-yasm \ No newline at end of file diff --git a/ports/nettle/gmp.patch b/ports/nettle/gmp.patch new file mode 100644 index 00000000000000..5ed62de0169d47 --- /dev/null +++ b/ports/nettle/gmp.patch @@ -0,0 +1,273 @@ +diff --git a/SMP/config.h b/SMP/config.h +index 5e59a1daa..c5a658954 100644 +--- a/SMP/config.h ++++ b/SMP/config.h +@@ -101,7 +101,7 @@ + #define HAVE_SYS_TYPES_H 1 + + /* Define to 1 if you have the header file. */ +-#define HAVE_UNISTD_H 1 ++//#define HAVE_UNISTD_H 1 + + /* Define to 1 if you have the header file. */ + /* #undef HAVE_VALGRIND_MEMCHECK_H */ +diff --git a/SMP/libhogweed.vcxproj b/SMP/libhogweed.vcxproj +index cdf309639..9d37146a4 100644 +--- a/SMP/libhogweed.vcxproj ++++ b/SMP/libhogweed.vcxproj +@@ -1325,7 +1325,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + true + 5.1 +- nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1457,7 +1457,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettled_winrt.lib;gmpd_winrt.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib%(AdditionalDependencies) + $(OutDir)\lib\x86\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -1585,7 +1585,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) + true + 6.1 +- nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1715,7 +1715,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettled_winrt.lib;gmpd_winrt.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib%(AdditionalDependencies) + $(OutDir)\lib\x64\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -2368,7 +2368,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + true + 5.1 +- nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2641,7 +2641,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettle_winrt.lib;gmp_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib%(AdditionalDependencies) + $(OutDir)\lib\x86\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -2915,7 +2915,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) + true + 6.1 +- nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -3186,7 +3186,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettle_winrt.lib;gmp_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib%(AdditionalDependencies) + $(OutDir)\lib\x64\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +diff --git a/SMP/libnettle.vcxproj b/SMP/libnettle.vcxproj +index 9ea0d8ea7..56583e10f 100644 +--- a/SMP/libnettle.vcxproj ++++ b/SMP/libnettle.vcxproj +@@ -968,7 +968,7 @@ + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmpd.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1091,7 +1091,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmpd_winrt.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1212,7 +1212,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmpd.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1335,7 +1335,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmpd_winrt.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1463,7 +1463,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 5.1 + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- gmpd.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1595,7 +1595,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x86\$(RootNamespace).winmd + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- gmpd_winrt.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1721,7 +1721,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 6.1 + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- gmpd.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1851,7 +1851,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x64\$(RootNamespace).winmd + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- gmpd_winrt.lib;%(AdditionalDependencies) ++ gmpd.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -1979,7 +1979,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmp.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2108,7 +2108,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmp_winrt.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2235,7 +2235,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmp.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2364,7 +2364,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmp_winrt.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2498,7 +2498,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 5.1 + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- gmp.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2632,7 +2632,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 5.1 + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmp.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2770,7 +2770,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x86\$(RootNamespace).winmd + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- gmp_winrt.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -2908,7 +2908,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x86\$(RootNamespace).winmd + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libgmp_winrt.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -3041,7 +3041,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 6.1 + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- gmp.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -3174,7 +3174,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 6.1 + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmp.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -3311,7 +3311,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x64\$(RootNamespace).winmd + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- gmp_winrt.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -3448,7 +3448,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + 8.1 + $(OutDir)\lib\x64\$(RootNamespace).winmd + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libgmp_winrt.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include diff --git a/ports/nettle/name.dir.patch b/ports/nettle/name.dir.patch new file mode 100644 index 00000000000000..9b7886b1833d5c --- /dev/null +++ b/ports/nettle/name.dir.patch @@ -0,0 +1,567 @@ +diff --git a/SMP/libhogweed.vcxproj b/SMP/libhogweed.vcxproj +index 9f741e240..5bb05b359 100644 +--- a/SMP/libhogweed.vcxproj ++++ b/SMP/libhogweed.vcxproj +@@ -670,142 +670,142 @@ + + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweedd ++ hogweedd + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweedd_winrt ++ hogweedd + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweedd +- $(ProjectDir)..\..\..\msvc\ ++ hogweedd ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweedd_winrt +- $(ProjectDir)..\..\..\msvc\ ++ hogweedd ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweedd + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweedd_winrt ++ hogweedd + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweedd +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweedd_winrt +- $(ProjectDir)..\..\..\msvc\ ++ hogweedd ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweed ++ hogweed + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweed_winrt ++ hogweed + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweed +- $(ProjectDir)..\..\..\msvc\ ++ hogweed ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libhogweed_winrt +- $(ProjectDir)..\..\..\msvc\ ++ hogweed ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweed + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweed + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweed_winrt ++ hogweed + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweed_winrt ++ hogweed + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweed +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + hogweed +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweed_winrt +- $(ProjectDir)..\..\..\msvc\ ++ hogweed ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- hogweed_winrt +- $(ProjectDir)..\..\..\msvc\ ++ hogweed ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + +@@ -826,7 +826,7 @@ + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libnettled.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -950,7 +950,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libnettled_winrt.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1072,7 +1072,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libnettled.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1196,7 +1196,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libnettled_winrt.lib;%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1325,7 +1325,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + true + 5.1 +- nettled.lib;gmpd.lib%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1457,7 +1457,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettled.lib;gmpd.lib%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + $(OutDir)\lib\x86\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -1585,7 +1585,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) + true + 6.1 +- nettled.lib;gmpd.lib%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1715,7 +1715,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettled.lib;gmpd.lib%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) + $(OutDir)\lib\x64\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -1845,7 +1845,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libnettle.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -1975,7 +1975,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX86 + Windows + $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) +- libnettle_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2103,7 +2103,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libnettle.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2233,7 +2233,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + MachineX64 + Windows + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) +- libnettle_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2368,7 +2368,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + true + 5.1 +- nettle.lib;gmp.lib%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2503,7 +2503,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + true + 5.1 +- libnettle.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -2641,7 +2641,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettle.lib;gmp.lib%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + $(OutDir)\lib\x86\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -2780,7 +2780,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- libnettle_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + $(OutDir)\lib\x86\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -2915,7 +2915,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) + true + 6.1 +- nettle.lib;gmp.lib%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -3049,7 +3049,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) + true + 6.1 +- libnettle.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -3186,7 +3186,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- nettle.lib;gmp.lib%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + $(OutDir)\lib\x64\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +@@ -3324,7 +3324,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + true + 10.0 + 8.1 +- libnettle_winrt.lib;%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) + $(OutDir)\lib\x64\$(RootNamespace).winmd + /IGNORE:4006,4221,4078 %(AdditionalOptions) + +diff --git a/SMP/libnettle.vcxproj b/SMP/libnettle.vcxproj +index 56583e10f..665e8ef4e 100644 +--- a/SMP/libnettle.vcxproj ++++ b/SMP/libnettle.vcxproj +@@ -812,142 +812,142 @@ + + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettled ++ nettled + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettled_winrt ++ nettled + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettled +- $(ProjectDir)..\..\..\msvc\ ++ nettled ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettled_winrt +- $(ProjectDir)..\..\..\msvc\ ++ nettled ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettled + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettled_winrt ++ nettled + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettled +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettled_winrt +- $(ProjectDir)..\..\..\msvc\ ++ nettled ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettle ++ nettle + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettle_winrt ++ nettle + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettle +- $(ProjectDir)..\..\..\msvc\ ++ nettle ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libnettle_winrt +- $(ProjectDir)..\..\..\msvc\ ++ nettle ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettle + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettle + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettle_winrt ++ nettle + Clean + MSB8012 + + +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettle_winrt ++ nettle + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettle +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ + nettle +- $(ProjectDir)..\..\..\msvc\ ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettle_winrt +- $(ProjectDir)..\..\..\msvc\ ++ nettle ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- nettle_winrt +- $(ProjectDir)..\..\..\msvc\ ++ nettle ++ $(ProjectDir)..\msvc\ + Clean + MSB8012 + +diff --git a/hogweed.pc.in b/hogweed.pc.in +index 97fb9d46a..ce977c02e 100644 +--- a/hogweed.pc.in ++++ b/hogweed.pc.in +@@ -13,7 +13,7 @@ URL: http://www.lysator.liu.se/~nisse/nettle + Version: @PACKAGE_VERSION@ + Requires: @IF_NOT_SHARED@ nettle + Requires.private: @IF_SHARED@ nettle +-Libs: -L${libdir} -lhogweed @IF_NOT_SHARED@ @LIBS@ ++Libs: -L${libdir} @HOGWEED@ @IF_NOT_SHARED@ @LIBS@ + Libs.private: @IF_SHARED@ @LIBS@ + Cflags: -I${includedir} + +diff --git a/nettle.pc.in b/nettle.pc.in +index eb0020caa..6e3ed1e4f 100644 +--- a/nettle.pc.in ++++ b/nettle.pc.in +@@ -7,5 +7,6 @@ Name: Nettle + Description: Nettle low-level cryptographic library (symmetric algorithms) + URL: http://www.lysator.liu.se/~nisse/nettle + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lnettle ++Requires.private: gmp ++Libs: -L${libdir} @LIBS@ + Cflags: -I${includedir} diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake new file mode 100644 index 00000000000000..0e12564e1d9629 --- /dev/null +++ b/ports/nettle/portfile.cmake @@ -0,0 +1,136 @@ +## requires AUTOCONF, LIBTOOL and PKCONF + + +if(VCPKG_TARGET_IS_WINDOWS) + #vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + #set(OPTIONS --disable-assembler) +endif() + +if(VCPKG_TARGET_IS_WINDOWS) + set(ENV{YASMPATH}) + vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ShiftMediaProject/nettle + REF 1d0a6e64e01458fdf37eaf5d90975deb52c3da41 #v3.5.1 + SHA512 6124fbd223e6519d88290c3f4e3b8cc399e038c9c77cfec38e6ab17b075846e662fd0360d62c132c882536489c8a865795f64059e2d2b21467f65d90320e5c39 + HEAD_REF master + PATCHES gmp.patch + name.dir.patch + ) + vcpkg_find_acquire_program(YASM) + get_filename_component(YASM_DIR "${YASM}" DIRECTORY) + vcpkg_add_to_path(${YASM_DIR}) + set(ENV{YASMPATH} ${YASM_DIR}/) + + if (TRIPLET_SYSTEM_ARCH MATCHES "x86") + set(PLATFORM "Win32") + else () + set(PLATFORM ${TRIPLET_SYSTEM_ARCH}) + endif() + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(CONFIGURATION_RELEASE ReleaseDLL) + set(CONFIGURATION_DEBUG DebugDLL) + else() + set(CONFIGURATION_RELEASE Release) + set(CONFIGURATION_DEBUG Debug) + endif() + + if(VCPKG_TARGET_IS_UWP) + string(APPEND CONFIGURATION_RELEASE WinRT) + string(APPEND CONFIGURATION_DEBUG WinRT) + endif() + # + set(_file "${SOURCE_PATH}/SMP/libnettle.vcxproj") + file(READ "${_file}" _contents) + string(REPLACE +[[ + ]] +"\n \ + \n \ + " + _contents "${_contents}") + file(WRITE "${_file}" "${_contents}") + + vcpkg_install_msbuild( + USE_VCPKG_INTEGRATION + SOURCE_PATH ${SOURCE_PATH} + PROJECT_SUBPATH SMP/libnettle.sln + PLATFORM ${PLATFORM} + LICENSE_SUBPATH COPYING.LESSERv3 + TARGET Rebuild + RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE} + DEBUG_CONFIGURATION ${CONFIGURATION_DEBUG} + SKIP_CLEAN + ) + + get_filename_component(SOURCE_PATH_SUFFIX "${SOURCE_PATH}" NAME) + file(RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/include" "${CURRENT_PACKAGES_DIR}/include") + set(PACKAGE_VERSION 3.5.1) + set(prefix "${CURRENT_INSTALLED_DIR}") + set(exec_prefix "\${prefix}") + set(libdir "\${prefix}/lib") + set(includedir "\${prefix}/include") + set(LIBS -lnettle -lgmp) + configure_file("${SOURCE_PATH}/nettle.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/nettle.pc" @ONLY) + set(HOGWEED -lhogweed) + set(LIBS -lnettle) + configure_file("${SOURCE_PATH}/hogweed.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libhogweed.pc" @ONLY) + set(prefix "${CURRENT_INSTALLED_DIR}/debug") + set(exec_prefix "\${prefix}") + set(libdir "\${prefix}/lib") + set(includedir "\${prefix}/../include") + set(LIBS -lnettled -lgmpd) + configure_file("${SOURCE_PATH}/nettle.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/nettle.pc" @ONLY) + set(LIBS -lnettled) + set(HOGWEED -lhogweedd) + configure_file("${SOURCE_PATH}/hogweed.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libhogweed.pc" @ONLY) + vcpkg_fixup_pkgconfig() +else() + vcpkg_find_acquire_program(YASM) + get_filename_component(YASM_DIR "${YASM}" DIRECTORY) + vcpkg_add_to_path(${YASM_DIR}) + vcpkg_from_gitlab( + GITLAB_URL https://git.lysator.liu.se/ + OUT_SOURCE_PATH SOURCE_PATH + REPO nettle/nettle + REF ee5d62898cf070f08beedc410a8d7c418588bd95 #v3.5.1 + SHA512 881912548f4abb21460f44334de11439749c8a055830849a8beb4332071d11d9196d9eecaeba5bf822819d242356083fba91eb8719a64f90e41766826e6d75e1 + HEAD_REF master # branch name + #PATCHES example.patch #patch name + ) + vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + #SKIP_CONFIGURE + #NO_DEBUG + #AUTO_HOST + #AUTO_DST + #PRERUN_SHELL ${SHELL_PATH} + OPTIONS + --disable-documentation + ${OPTIONS} + #OPTIONS_DEBUG + #OPTIONS_RELEASE + ) + + vcpkg_install_make() + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + # # Handle copyright + + file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + # # Post-build test for cmake libraries + # vcpkg_test_cmake(PACKAGE_NAME Xlib) + + # set(TOOLS nettle-hash nettle-lfib-stream nettle-pbkdf2 sexp-conv) + # file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}") + # foreach(tool ${TOOLS}) + # file(RENAME "${CURRENT_PACKAGES_DIR}/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + # endforeach() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_IS_LINUX) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") + endif() +endif() + + From 5588d48262beb66188289432a5213c95fafa8bbc Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 08:05:33 +0200 Subject: [PATCH 14/32] add missing windows flag in control --- ports/nettle/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nettle/CONTROL b/ports/nettle/CONTROL index 2d9ed8ab68b64f..8cbe448678941c 100644 --- a/ports/nettle/CONTROL +++ b/ports/nettle/CONTROL @@ -2,4 +2,4 @@ Source: nettle Version: 3.5.1 Homepage: https://git.lysator.liu.se/nettle/nettle Description: Nettle is a low-level cryptographic library that is designed to fit easily in more or less any context: In crypto toolkits for object-oriented languages (C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in kernel space. -Build-Depends: gmp, vs-yasm \ No newline at end of file +Build-Depends: gmp, vs-yasm (windows) \ No newline at end of file From 193fbca88a91c7bd0ddd24fee7fa84d0f90c7377 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 09:16:09 +0200 Subject: [PATCH 15/32] CI workaround CI seems to not pass env YASMPATH correctly to cl. Since YASM is on PATH -> remove $(VCInstallDir) as the default for YasmPath --- ports/vs-yasm/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/vs-yasm/portfile.cmake b/ports/vs-yasm/portfile.cmake index 54c1f1906e0454..341f66ca510990 100644 --- a/ports/vs-yasm/portfile.cmake +++ b/ports/vs-yasm/portfile.cmake @@ -11,5 +11,9 @@ set(_files yasm.props yasm.targets yasm.xml) foreach(_file ${_files}) file(INSTALL "${SOURCE_PATH}/${_file}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/") endforeach() +set(_file "${CURRENT_PACKAGES_DIR}/share/${PORT}/yasm.props") +file(READ "${_file}" _contents) +string(REPLACE "$(VCInstallDir)" "" _contents "${_contents}") +file(WRITE "${_file}" "${_contents}") configure_file("${SOURCE_PATH}/COPYING" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY) \ No newline at end of file From 6885beb2cf75a750d6ef8d491f18cd4955d80707 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 11:25:59 +0200 Subject: [PATCH 16/32] overwrite correct import. --- ports/gmp/portfile.cmake | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index 252f341f30bb82..93b2ee34c07645 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -33,13 +33,9 @@ if(VCPKG_TARGET_IS_WINDOWS) # set(_file "${SOURCE_PATH}/SMP/libgmp.vcxproj") file(READ "${_file}" _contents) - string(REPLACE -[[ - ]] -"\n \ - \n \ - " - _contents "${_contents}") + string(REPLACE [[]] + "" + _contents "${_contents}") file(WRITE "${_file}" "${_contents}") vcpkg_install_msbuild( From 181af657fcf03bd49c6e172cd9cee3c6a398cf1a Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 11:31:16 +0200 Subject: [PATCH 17/32] If CI does not give logs just display some extra info --- ports/gmp/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index 93b2ee34c07645..e5cbcc68bc83fb 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -9,6 +9,7 @@ if(VCPKG_TARGET_IS_WINDOWS) PATCHES vs.build.patch ) vcpkg_find_acquire_program(YASM) + message(STATUS "YASM:${YASM}") get_filename_component(YASM_DIR "${YASM}" DIRECTORY) vcpkg_add_to_path(${YASM_DIR}) set(ENV{YASMPATH} ${YASM_DIR}/) From 78667121aafc1632766ad4eca0cf1928f1f28cbd Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 11:45:18 +0200 Subject: [PATCH 18/32] target replacement was mising --- ports/gmp/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index e5cbcc68bc83fb..7d3c12577e763c 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -37,6 +37,9 @@ if(VCPKG_TARGET_IS_WINDOWS) string(REPLACE [[]] "" _contents "${_contents}") + string(REPLACE [[]] + "" + _contents "${_contents}") file(WRITE "${_file}" "${_contents}") vcpkg_install_msbuild( From f9a8227a8ca3d41e0ce017cab6030953ffd6e2e6 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 11:55:23 +0200 Subject: [PATCH 19/32] apply same replacements for nettle --- ports/nettle/portfile.cmake | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index 0e12564e1d9629..529b55ab7f4cb1 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -43,13 +43,12 @@ if(VCPKG_TARGET_IS_WINDOWS) # set(_file "${SOURCE_PATH}/SMP/libnettle.vcxproj") file(READ "${_file}" _contents) - string(REPLACE -[[ - ]] -"\n \ - \n \ - " - _contents "${_contents}") + string(REPLACE [[]] + "" + _contents "${_contents}") + string(REPLACE [[]] + "" + _contents "${_contents}") file(WRITE "${_file}" "${_contents}") vcpkg_install_msbuild( From 76fbdcbd91ca6cbcddacec719d21d13afff1244e Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 11:56:11 +0200 Subject: [PATCH 20/32] remove unnecessary status message --- ports/gmp/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index 7d3c12577e763c..8c721b28c5eb2c 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -9,7 +9,6 @@ if(VCPKG_TARGET_IS_WINDOWS) PATCHES vs.build.patch ) vcpkg_find_acquire_program(YASM) - message(STATUS "YASM:${YASM}") get_filename_component(YASM_DIR "${YASM}" DIRECTORY) vcpkg_add_to_path(${YASM_DIR}) set(ENV{YASMPATH} ${YASM_DIR}/) From 51e7188c929b271542ccdce866dc457380ac200e Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 12:05:03 +0200 Subject: [PATCH 21/32] remove unnecessary platform code --- ports/gmp/portfile.cmake | 9 ++------- ports/nettle/portfile.cmake | 10 ++-------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index 8c721b28c5eb2c..fc87804cbd740c 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -12,12 +12,7 @@ if(VCPKG_TARGET_IS_WINDOWS) get_filename_component(YASM_DIR "${YASM}" DIRECTORY) vcpkg_add_to_path(${YASM_DIR}) set(ENV{YASMPATH} ${YASM_DIR}/) - if (TRIPLET_SYSTEM_ARCH MATCHES "x86") - set(PLATFORM "Win32") - else () - set(PLATFORM ${TRIPLET_SYSTEM_ARCH}) - endif() - + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(CONFIGURATION_RELEASE ReleaseDLL) set(CONFIGURATION_DEBUG DebugDLL) @@ -44,7 +39,7 @@ if(VCPKG_TARGET_IS_WINDOWS) vcpkg_install_msbuild( SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH SMP/libgmp.sln - PLATFORM ${PLATFORM} + PLATFORM ${TRIPLET_SYSTEM_ARCH} LICENSE_SUBPATH COPYING.LESSERv3 TARGET Rebuild RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE} diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index 529b55ab7f4cb1..96ea33fe2bc7b8 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -21,13 +21,7 @@ if(VCPKG_TARGET_IS_WINDOWS) get_filename_component(YASM_DIR "${YASM}" DIRECTORY) vcpkg_add_to_path(${YASM_DIR}) set(ENV{YASMPATH} ${YASM_DIR}/) - - if (TRIPLET_SYSTEM_ARCH MATCHES "x86") - set(PLATFORM "Win32") - else () - set(PLATFORM ${TRIPLET_SYSTEM_ARCH}) - endif() - + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(CONFIGURATION_RELEASE ReleaseDLL) set(CONFIGURATION_DEBUG DebugDLL) @@ -55,7 +49,7 @@ if(VCPKG_TARGET_IS_WINDOWS) USE_VCPKG_INTEGRATION SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH SMP/libnettle.sln - PLATFORM ${PLATFORM} + PLATFORM ${TRIPLET_SYSTEM_ARCH} LICENSE_SUBPATH COPYING.LESSERv3 TARGET Rebuild RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE} From 13ea5b85e39090f88adcb8d09d1c9355676ce85a Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 12:07:44 +0200 Subject: [PATCH 22/32] update supports field for vs-yasm --- ports/vs-yasm/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/vs-yasm/CONTROL b/ports/vs-yasm/CONTROL index 9b0125a6723210..68f7328a9c02e4 100644 --- a/ports/vs-yasm/CONTROL +++ b/ports/vs-yasm/CONTROL @@ -2,4 +2,4 @@ Source: vs-yasm Version: 0.5.0 Homepage: https://github.com/ShiftMediaProject/VSYASM Description: Provides Visual Studio integration for the YASM assembler. -Supports: windows \ No newline at end of file +Supports: windows & !arm \ No newline at end of file From af66ddd40ee0011a4c9073831622ad0c9645a692 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 13:17:08 +0200 Subject: [PATCH 23/32] apply replacement also to libhogweed --- ports/nettle/portfile.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index 96ea33fe2bc7b8..c6c48c188cb98d 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -44,7 +44,15 @@ if(VCPKG_TARGET_IS_WINDOWS) "" _contents "${_contents}") file(WRITE "${_file}" "${_contents}") - + set(_file "${SOURCE_PATH}/SMP/libhogweed.vcxproj") + file(READ "${_file}" _contents) + string(REPLACE [[]] + "" + _contents "${_contents}") + string(REPLACE [[]] + "" + _contents "${_contents}") + file(WRITE "${_file}" "${_contents}") vcpkg_install_msbuild( USE_VCPKG_INTEGRATION SOURCE_PATH ${SOURCE_PATH} From 6bae44dcaad4568fc14e16b5328906b5af411354 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 15:35:07 +0200 Subject: [PATCH 24/32] fix static builds --- ports/gmp/portfile.cmake | 9 ++++ ports/gmp/prefix.patch | 38 ++++++++++++++ ports/gmp/runtime.patch | 68 ++++++++++++++++++++++++ ports/nettle/portfile.cmake | 23 ++++++++ ports/nettle/runtime.hogweed.patch | 84 ++++++++++++++++++++++++++++++ ports/nettle/runtime.nettle.patch | 84 ++++++++++++++++++++++++++++++ 6 files changed, 306 insertions(+) create mode 100644 ports/gmp/prefix.patch create mode 100644 ports/gmp/runtime.patch create mode 100644 ports/nettle/runtime.hogweed.patch create mode 100644 ports/nettle/runtime.nettle.patch diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index fc87804cbd740c..d9ad43c3296246 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -7,6 +7,8 @@ if(VCPKG_TARGET_IS_WINDOWS) SHA512 3b646c142447946bb4556db01214ff130da917bc149946b8cf086f3b01e1cc3d664b941a30a42608799c14461b2f29e4b894b72915d723bd736513c8914729b7 HEAD_REF master PATCHES vs.build.patch + runtime.patch + prefix.patch ) vcpkg_find_acquire_program(YASM) get_filename_component(YASM_DIR "${YASM}" DIRECTORY) @@ -34,6 +36,13 @@ if(VCPKG_TARGET_IS_WINDOWS) string(REPLACE [[]] "" _contents "${_contents}") + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + STRING(REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}") + STRING(REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}") + else() + STRING(REPLACE ">MultiThreadedDebug<" ">MultiThreadedDebugDLL<" _contents "${_contents}") + STRING(REPLACE ">MultiThreaded<" ">MultiThreadedDLL<" _contents "${_contents}") + endif() file(WRITE "${_file}" "${_contents}") vcpkg_install_msbuild( diff --git a/ports/gmp/prefix.patch b/ports/gmp/prefix.patch new file mode 100644 index 00000000000000..611c73763f4cb0 --- /dev/null +++ b/ports/gmp/prefix.patch @@ -0,0 +1,38 @@ +diff --git a/SMP/libgmp.vcxproj b/SMP/libgmp.vcxproj +index 2c5b8cdc6..157215394 100644 +--- a/SMP/libgmp.vcxproj ++++ b/SMP/libgmp.vcxproj +@@ -1574,14 +1574,14 @@ + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmpd ++ gmpd + $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmpd ++ gmpd + $(ProjectDir)..\msvc\ + Clean + MSB8012 +@@ -1630,14 +1630,14 @@ + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmp ++ gmp + $(ProjectDir)..\msvc\ + Clean + MSB8012 + + + $(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ +- libgmp ++ gmp + $(ProjectDir)..\msvc\ + Clean + MSB8012 diff --git a/ports/gmp/runtime.patch b/ports/gmp/runtime.patch new file mode 100644 index 00000000000000..b2f15d26052d3b --- /dev/null +++ b/ports/gmp/runtime.patch @@ -0,0 +1,68 @@ +diff --git a/SMP/libgmp.vcxproj b/SMP/libgmp.vcxproj +index 3c774be11..e8919240b 100644 +--- a/SMP/libgmp.vcxproj ++++ b/SMP/libgmp.vcxproj +@@ -1846,6 +1846,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -1929,6 +1930,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) + false ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2190,6 +2192,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -2278,6 +2281,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) + false ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -2549,6 +2553,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + $(OutDir)\lib\x64\$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2638,6 +2643,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) + false ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2916,6 +2922,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + $(IntDir)$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3011,6 +3018,7 @@ del /f /q $(OutDir)\licenses\gmp.txt + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4101;4018;4307;4267;4334;4554;4267;4800;%(DisableSpecificWarnings) + false ++ MultiThreadedDLL + + + true diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index c6c48c188cb98d..0e93f2c4b0dacb 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -16,6 +16,8 @@ if(VCPKG_TARGET_IS_WINDOWS) HEAD_REF master PATCHES gmp.patch name.dir.patch + runtime.nettle.patch + runtime.hogweed.patch ) vcpkg_find_acquire_program(YASM) get_filename_component(YASM_DIR "${YASM}" DIRECTORY) @@ -43,6 +45,13 @@ if(VCPKG_TARGET_IS_WINDOWS) string(REPLACE [[]] "" _contents "${_contents}") + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + STRING(REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}") + STRING(REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}") + else() + STRING(REPLACE ">MultiThreadedDebug<" ">MultiThreadedDebugDLL<" _contents "${_contents}") + STRING(REPLACE ">MultiThreaded<" ">MultiThreadedDLL<" _contents "${_contents}") + endif() file(WRITE "${_file}" "${_contents}") set(_file "${SOURCE_PATH}/SMP/libhogweed.vcxproj") file(READ "${_file}" _contents) @@ -52,7 +61,19 @@ if(VCPKG_TARGET_IS_WINDOWS) string(REPLACE [[]] "" _contents "${_contents}") + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + STRING(REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}") + STRING(REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}") + else() + STRING(REPLACE ">MultiThreadedDebug<" ">MultiThreadedDebugDLL<" _contents "${_contents}") + STRING(REPLACE ">MultiThreaded<" ">MultiThreadedDLL<" _contents "${_contents}") + endif() file(WRITE "${_file}" "${_contents}") + + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(OPTIONS_RELASE "/p:AdditionalLibraryDirectories=${CURRENT_INSTALLED_DIR}/lib;$(AdditionalLibraryDirectories)") + set(OPTIONS_DEBUG "/p:AdditionalLibraryDirectories=${CURRENT_INSTALLED_DIR}/debug/lib;$(AdditionalLibraryDirectories)") + endif() vcpkg_install_msbuild( USE_VCPKG_INTEGRATION SOURCE_PATH ${SOURCE_PATH} @@ -62,6 +83,8 @@ if(VCPKG_TARGET_IS_WINDOWS) TARGET Rebuild RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE} DEBUG_CONFIGURATION ${CONFIGURATION_DEBUG} + OPTIONS_DEBUG ${OPTIONS_DEBUG} + OPTIONS_RELASE ${OPTIONS_RELASE} SKIP_CLEAN ) diff --git a/ports/nettle/runtime.hogweed.patch b/ports/nettle/runtime.hogweed.patch new file mode 100644 index 00000000000000..a096b77b7b6d19 --- /dev/null +++ b/ports/nettle/runtime.hogweed.patch @@ -0,0 +1,84 @@ +diff --git a/SMP/libhogweed.vcxproj b/SMP/libhogweed.vcxproj +index 3f400af81..e5758ea27 100644 +--- a/SMP/libhogweed.vcxproj ++++ b/SMP/libhogweed.vcxproj +@@ -1066,6 +1066,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -1190,6 +1191,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -1574,6 +1576,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -1703,6 +1706,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -2097,6 +2101,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2227,6 +2232,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2902,6 +2908,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(IntDir)$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3036,6 +3043,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(IntDir)$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3172,6 +3180,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3310,6 +3319,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4146;4267;4028;4244;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true diff --git a/ports/nettle/runtime.nettle.patch b/ports/nettle/runtime.nettle.patch new file mode 100644 index 00000000000000..33d147ededee2e --- /dev/null +++ b/ports/nettle/runtime.nettle.patch @@ -0,0 +1,84 @@ +diff --git a/SMP/libnettle.vcxproj b/SMP/libnettle.vcxproj +index 54f686af6..05b903ab9 100644 +--- a/SMP/libnettle.vcxproj ++++ b/SMP/libnettle.vcxproj +@@ -1206,6 +1206,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -1329,6 +1330,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDebug + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -1710,6 +1712,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -1838,6 +1841,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDebugDLL + + + $(OutDir)\bin\x64\$(TargetName)$(TargetExt) +@@ -2229,6 +2233,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(OutDir)\lib\x64\$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -2358,6 +2363,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreaded + + + $(OutDir)\lib\x64\$(TargetName)$(TargetExt) +@@ -3028,6 +3034,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(IntDir)$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3161,6 +3168,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + $(IntDir)$(TargetName).pdb + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreaded + + + true +@@ -3296,6 +3304,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreadedDLL + + + true +@@ -3433,6 +3442,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + false + 4113;%(TreatSpecificWarningsAsErrors) + 4244;4146;4267;4098;%(DisableSpecificWarnings) ++ MultiThreaded + + + true From e844512336d6b7b6af730a2ef01b9f5af242641f Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 15:35:38 +0200 Subject: [PATCH 25/32] remove not working code --- ports/nettle/portfile.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index 0e93f2c4b0dacb..4ee33e6d1a574c 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -70,10 +70,6 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() file(WRITE "${_file}" "${_contents}") - if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(OPTIONS_RELASE "/p:AdditionalLibraryDirectories=${CURRENT_INSTALLED_DIR}/lib;$(AdditionalLibraryDirectories)") - set(OPTIONS_DEBUG "/p:AdditionalLibraryDirectories=${CURRENT_INSTALLED_DIR}/debug/lib;$(AdditionalLibraryDirectories)") - endif() vcpkg_install_msbuild( USE_VCPKG_INTEGRATION SOURCE_PATH ${SOURCE_PATH} From 5d3a895a650e6ef18ec1bca39ec6dd1fcd1a247b Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Tue, 31 Mar 2020 15:59:48 +0200 Subject: [PATCH 26/32] remove debug/release options --- ports/nettle/portfile.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index 4ee33e6d1a574c..b916e4dd73984d 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -79,8 +79,6 @@ if(VCPKG_TARGET_IS_WINDOWS) TARGET Rebuild RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE} DEBUG_CONFIGURATION ${CONFIGURATION_DEBUG} - OPTIONS_DEBUG ${OPTIONS_DEBUG} - OPTIONS_RELASE ${OPTIONS_RELASE} SKIP_CLEAN ) From c54827330ed2d6b9c6855bf9e90b537a5f411c40 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 2 Apr 2020 12:31:27 +0200 Subject: [PATCH 27/32] add additional replacement for the case the SOURCE dir has already been patched within VCPKG --- ports/gmp/portfile.cmake | 2 ++ ports/nettle/portfile.cmake | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index d9ad43c3296246..7014beadc2d407 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -36,6 +36,7 @@ if(VCPKG_TARGET_IS_WINDOWS) string(REPLACE [[]] "" _contents "${_contents}") + string(REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_INSTALLED_DIR}/share" _contents "${_contents}") # Above already replaced by another triplet if(VCPKG_LIBRARY_LINKAGE STREQUAL static) STRING(REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}") STRING(REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}") @@ -46,6 +47,7 @@ if(VCPKG_TARGET_IS_WINDOWS) file(WRITE "${_file}" "${_contents}") vcpkg_install_msbuild( + USE_VCPKG_INTEGRATION SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH SMP/libgmp.sln PLATFORM ${TRIPLET_SYSTEM_ARCH} diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index b916e4dd73984d..a7f7922fa5bd11 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -45,6 +45,7 @@ if(VCPKG_TARGET_IS_WINDOWS) string(REPLACE [[]] "" _contents "${_contents}") + string(REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_INSTALLED_DIR}/share" _contents "${_contents}") # Above already replaced by another triplet if(VCPKG_LIBRARY_LINKAGE STREQUAL static) STRING(REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}") STRING(REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}") @@ -61,6 +62,7 @@ if(VCPKG_TARGET_IS_WINDOWS) string(REPLACE [[]] "" _contents "${_contents}") + string(REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_INSTALLED_DIR}/share" _contents "${_contents}") # Above already replaced by another triplet if(VCPKG_LIBRARY_LINKAGE STREQUAL static) STRING(REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}") STRING(REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}") From 250166035fdfdb7642fa8e47bc1c798ee4eda747 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 2 Apr 2020 12:31:47 +0200 Subject: [PATCH 28/32] add triplet selection to vcpkg_install_msbuild --- scripts/cmake/vcpkg_install_msbuild.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/cmake/vcpkg_install_msbuild.cmake b/scripts/cmake/vcpkg_install_msbuild.cmake index db2874a9ffd273..01bf49f029fe23 100644 --- a/scripts/cmake/vcpkg_install_msbuild.cmake +++ b/scripts/cmake/vcpkg_install_msbuild.cmake @@ -136,6 +136,7 @@ function(vcpkg_install_msbuild) /p:VCPkgLocalAppDataDisabled=true /p:UseIntelMKL=No /p:WindowsTargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION} + /p:VcpkgTriplet=${TARGET_TRIPLET} /m ) From 8692b57c31c210df870164a9304b39eed4bbccdd Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 2 Apr 2020 12:34:37 +0200 Subject: [PATCH 29/32] fix missing ; in patches --- ports/nettle/gmp.patch | 16 ++++++++-------- ports/nettle/name.dir.patch | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ports/nettle/gmp.patch b/ports/nettle/gmp.patch index 5ed62de0169d47..3d254d8dd9b456 100644 --- a/ports/nettle/gmp.patch +++ b/ports/nettle/gmp.patch @@ -20,7 +20,7 @@ index cdf309639..9d37146a4 100644 true 5.1 - nettled.lib;gmpd.lib;%(AdditionalDependencies) -+ nettled.lib;gmpd.lib%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -29,7 +29,7 @@ index cdf309639..9d37146a4 100644 10.0 8.1 - nettled_winrt.lib;gmpd_winrt.lib;%(AdditionalDependencies) -+ nettled.lib;gmpd.lib%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) $(OutDir)\lib\x86\$(RootNamespace).winmd /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -38,7 +38,7 @@ index cdf309639..9d37146a4 100644 true 6.1 - nettled.lib;gmpd.lib;%(AdditionalDependencies) -+ nettled.lib;gmpd.lib%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -47,7 +47,7 @@ index cdf309639..9d37146a4 100644 10.0 8.1 - nettled_winrt.lib;gmpd_winrt.lib;%(AdditionalDependencies) -+ nettled.lib;gmpd.lib%(AdditionalDependencies) ++ nettled.lib;gmpd.lib;%(AdditionalDependencies) $(OutDir)\lib\x64\$(RootNamespace).winmd /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -56,7 +56,7 @@ index cdf309639..9d37146a4 100644 true 5.1 - nettle.lib;gmp.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -65,7 +65,7 @@ index cdf309639..9d37146a4 100644 10.0 8.1 - nettle_winrt.lib;gmp_winrt.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) $(OutDir)\lib\x86\$(RootNamespace).winmd /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -74,7 +74,7 @@ index cdf309639..9d37146a4 100644 true 6.1 - nettle.lib;gmp.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -83,7 +83,7 @@ index cdf309639..9d37146a4 100644 10.0 8.1 - nettle_winrt.lib;gmp_winrt.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib%(AdditionalDependencies) ++ nettle.lib;gmp.lib;%(AdditionalDependencies) $(OutDir)\lib\x64\$(RootNamespace).winmd /IGNORE:4006,4221,4078 %(AdditionalOptions) diff --git a/ports/nettle/name.dir.patch b/ports/nettle/name.dir.patch index 9b7886b1833d5c..c19087f75d6c67 100644 --- a/ports/nettle/name.dir.patch +++ b/ports/nettle/name.dir.patch @@ -219,7 +219,7 @@ index 9f741e240..5bb05b359 100644 true true 5.1 -- nettled.lib;gmpd.lib%(AdditionalDependencies) +- nettled.lib;gmpd.lib;%(AdditionalDependencies) + nettled.lib;gmpd.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -228,7 +228,7 @@ index 9f741e240..5bb05b359 100644 true 10.0 8.1 -- nettled.lib;gmpd.lib%(AdditionalDependencies) +- nettled.lib;gmpd.lib;%(AdditionalDependencies) + nettled.lib;gmpd.lib;%(AdditionalDependencies) $(OutDir)\lib\x86\$(RootNamespace).winmd /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -237,7 +237,7 @@ index 9f741e240..5bb05b359 100644 $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) true 6.1 -- nettled.lib;gmpd.lib%(AdditionalDependencies) +- nettled.lib;gmpd.lib;%(AdditionalDependencies) + nettled.lib;gmpd.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -246,7 +246,7 @@ index 9f741e240..5bb05b359 100644 true 10.0 8.1 -- nettled.lib;gmpd.lib%(AdditionalDependencies) +- nettled.lib;gmpd.lib;%(AdditionalDependencies) + nettled.lib;gmpd.lib;%(AdditionalDependencies) $(OutDir)\lib\x64\$(RootNamespace).winmd /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -291,7 +291,7 @@ index 9f741e240..5bb05b359 100644 true true 5.1 -- nettle.lib;gmp.lib%(AdditionalDependencies) +- nettle.lib;gmp.lib;%(AdditionalDependencies) + nettle.lib;gmp.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -309,7 +309,7 @@ index 9f741e240..5bb05b359 100644 true 10.0 8.1 -- nettle.lib;gmp.lib%(AdditionalDependencies) +- nettle.lib;gmp.lib;%(AdditionalDependencies) + nettle.lib;gmp.lib;%(AdditionalDependencies) $(OutDir)\lib\x86\$(RootNamespace).winmd /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -327,7 +327,7 @@ index 9f741e240..5bb05b359 100644 $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) true 6.1 -- nettle.lib;gmp.lib%(AdditionalDependencies) +- nettle.lib;gmp.lib;%(AdditionalDependencies) + nettle.lib;gmp.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -345,7 +345,7 @@ index 9f741e240..5bb05b359 100644 true 10.0 8.1 -- nettle.lib;gmp.lib%(AdditionalDependencies) +- nettle.lib;gmp.lib;%(AdditionalDependencies) + nettle.lib;gmp.lib;%(AdditionalDependencies) $(OutDir)\lib\x64\$(RootNamespace).winmd /IGNORE:4006,4221,4078 %(AdditionalOptions) From 36d5c0e72357253f72592abd9bcabc39d5662da1 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 2 Apr 2020 12:39:04 +0200 Subject: [PATCH 30/32] remove gmp dependency in static builds since they are not required --- ports/nettle/gmp.patch | 24 ++++++++++++------------ ports/nettle/name.dir.patch | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ports/nettle/gmp.patch b/ports/nettle/gmp.patch index 3d254d8dd9b456..b732e0360def8e 100644 --- a/ports/nettle/gmp.patch +++ b/ports/nettle/gmp.patch @@ -96,7 +96,7 @@ index 9ea0d8ea7..56583e10f 100644 Windows $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) - libgmpd.lib;%(AdditionalDependencies) -+ gmpd.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -105,7 +105,7 @@ index 9ea0d8ea7..56583e10f 100644 Windows $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) - libgmpd_winrt.lib;%(AdditionalDependencies) -+ gmpd.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -114,7 +114,7 @@ index 9ea0d8ea7..56583e10f 100644 Windows $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) - libgmpd.lib;%(AdditionalDependencies) -+ gmpd.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -123,7 +123,7 @@ index 9ea0d8ea7..56583e10f 100644 Windows $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) - libgmpd_winrt.lib;%(AdditionalDependencies) -+ gmpd.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -168,7 +168,7 @@ index 9ea0d8ea7..56583e10f 100644 Windows $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) - libgmp.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -177,7 +177,7 @@ index 9ea0d8ea7..56583e10f 100644 Windows $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) - libgmp_winrt.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -186,7 +186,7 @@ index 9ea0d8ea7..56583e10f 100644 Windows $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) - libgmp.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -195,7 +195,7 @@ index 9ea0d8ea7..56583e10f 100644 Windows $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) - libgmp_winrt.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -213,7 +213,7 @@ index 9ea0d8ea7..56583e10f 100644 5.1 $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) - libgmp.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -231,7 +231,7 @@ index 9ea0d8ea7..56583e10f 100644 $(OutDir)\lib\x86\$(RootNamespace).winmd $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) - libgmp_winrt.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -249,7 +249,7 @@ index 9ea0d8ea7..56583e10f 100644 6.1 $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) - libgmp.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -267,7 +267,7 @@ index 9ea0d8ea7..56583e10f 100644 $(OutDir)\lib\x64\$(RootNamespace).winmd $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) - libgmp_winrt.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) ++ %(AdditionalDependencies) mkdir "$(OutDir)"\include diff --git a/ports/nettle/name.dir.patch b/ports/nettle/name.dir.patch index c19087f75d6c67..753aaff5af7314 100644 --- a/ports/nettle/name.dir.patch +++ b/ports/nettle/name.dir.patch @@ -184,7 +184,7 @@ index 9f741e240..5bb05b359 100644 Windows $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) - libnettled.lib;%(AdditionalDependencies) -+ nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -193,7 +193,7 @@ index 9f741e240..5bb05b359 100644 Windows $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) - libnettled_winrt.lib;%(AdditionalDependencies) -+ nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -202,7 +202,7 @@ index 9f741e240..5bb05b359 100644 Windows $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) - libnettled.lib;%(AdditionalDependencies) -+ nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -211,7 +211,7 @@ index 9f741e240..5bb05b359 100644 Windows $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) - libnettled_winrt.lib;%(AdditionalDependencies) -+ nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -256,7 +256,7 @@ index 9f741e240..5bb05b359 100644 Windows $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) - libnettle.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -265,7 +265,7 @@ index 9f741e240..5bb05b359 100644 Windows $(OutDir)\lib\x86\;$(ProjectDir)\..\..\prebuilt\lib\x86\;%(AdditionalLibraryDirectories) - libnettle_winrt.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -274,7 +274,7 @@ index 9f741e240..5bb05b359 100644 Windows $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) - libnettle.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -283,7 +283,7 @@ index 9f741e240..5bb05b359 100644 Windows $(OutDir)\lib\x64\;$(ProjectDir)\..\..\prebuilt\lib\x64\;%(AdditionalLibraryDirectories) - libnettle_winrt.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -301,7 +301,7 @@ index 9f741e240..5bb05b359 100644 true 5.1 - libnettle.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -319,7 +319,7 @@ index 9f741e240..5bb05b359 100644 10.0 8.1 - libnettle_winrt.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) $(OutDir)\lib\x86\$(RootNamespace).winmd /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -337,7 +337,7 @@ index 9f741e240..5bb05b359 100644 true 6.1 - libnettle.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -355,7 +355,7 @@ index 9f741e240..5bb05b359 100644 10.0 8.1 - libnettle_winrt.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib;%(AdditionalDependencies) ++ nettle.lib;%(AdditionalDependencies) $(OutDir)\lib\x64\$(RootNamespace).winmd /IGNORE:4006,4221,4078 %(AdditionalOptions) From 3ba8f9f71f111ba196b58ec354f77bc1442986a7 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 3 Apr 2020 08:02:50 +0200 Subject: [PATCH 31/32] cleanup portfiles --- ports/gmp/portfile.cmake | 12 +++--------- ports/nettle/portfile.cmake | 34 +++++----------------------------- 2 files changed, 8 insertions(+), 38 deletions(-) diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index 7014beadc2d407..be12772d0946ce 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -1,4 +1,3 @@ - if(VCPKG_TARGET_IS_WINDOWS) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -27,7 +26,8 @@ if(VCPKG_TARGET_IS_WINDOWS) string(APPEND CONFIGURATION_RELEASE WinRT) string(APPEND CONFIGURATION_DEBUG WinRT) endif() - # + + #Setup YASM integration set(_file "${SOURCE_PATH}/SMP/libgmp.vcxproj") file(READ "${_file}" _contents) string(REPLACE [[]] @@ -92,20 +92,14 @@ else() vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} AUTOCONFIG - #SKIP_CONFIGURE - #NO_DEBUG - #AUTO_HOST - #AUTO_DST - #PRERUN_SHELL ${SHELL_PATH} OPTIONS ${OPTIONS} - #OPTIONS_DEBUG - #OPTIONS_RELEASE ) vcpkg_install_make() vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + # # Handle copyright file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) endif() diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index a7f7922fa5bd11..6d178a9bcbc2e3 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -1,13 +1,4 @@ -## requires AUTOCONF, LIBTOOL and PKCONF - - if(VCPKG_TARGET_IS_WINDOWS) - #vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - #set(OPTIONS --disable-assembler) -endif() - -if(VCPKG_TARGET_IS_WINDOWS) - set(ENV{YASMPATH}) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ShiftMediaProject/nettle @@ -36,7 +27,8 @@ if(VCPKG_TARGET_IS_WINDOWS) string(APPEND CONFIGURATION_RELEASE WinRT) string(APPEND CONFIGURATION_DEBUG WinRT) endif() - # + + #Setup YASM integration set(_file "${SOURCE_PATH}/SMP/libnettle.vcxproj") file(READ "${_file}" _contents) string(REPLACE [[]] @@ -107,9 +99,6 @@ if(VCPKG_TARGET_IS_WINDOWS) configure_file("${SOURCE_PATH}/hogweed.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libhogweed.pc" @ONLY) vcpkg_fixup_pkgconfig() else() - vcpkg_find_acquire_program(YASM) - get_filename_component(YASM_DIR "${YASM}" DIRECTORY) - vcpkg_add_to_path(${YASM_DIR}) vcpkg_from_gitlab( GITLAB_URL https://git.lysator.liu.se/ OUT_SOURCE_PATH SOURCE_PATH @@ -118,36 +107,23 @@ else() SHA512 881912548f4abb21460f44334de11439749c8a055830849a8beb4332071d11d9196d9eecaeba5bf822819d242356083fba91eb8719a64f90e41766826e6d75e1 HEAD_REF master # branch name #PATCHES example.patch #patch name - ) + ) + vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} AUTOCONFIG - #SKIP_CONFIGURE - #NO_DEBUG - #AUTO_HOST - #AUTO_DST - #PRERUN_SHELL ${SHELL_PATH} OPTIONS --disable-documentation ${OPTIONS} - #OPTIONS_DEBUG - #OPTIONS_RELEASE ) vcpkg_install_make() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + # # Handle copyright - file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - # # Post-build test for cmake libraries - # vcpkg_test_cmake(PACKAGE_NAME Xlib) - # set(TOOLS nettle-hash nettle-lfib-stream nettle-pbkdf2 sexp-conv) - # file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}") - # foreach(tool ${TOOLS}) - # file(RENAME "${CURRENT_PACKAGES_DIR}/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}") - # endforeach() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_IS_LINUX) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") endif() From 54d0c9235d5ee7a41bcab14e7c47cd87f0017a4f Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 29 Apr 2020 14:31:06 +0200 Subject: [PATCH 32/32] add missing vcpkg_fixup_pkgconfig() call --- ports/nettle/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index 6d178a9bcbc2e3..c599f2d7c4c4f9 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -118,6 +118,7 @@ else() ) vcpkg_install_make() + vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")