2024-07-21 02:31:32 +08:00
|
|
|
set(GNULIB_REF "3639c57")
|
2022-09-03 05:30:19 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO ShiftMediaProject/gnutls
|
2024-07-21 02:31:32 +08:00
|
|
|
REF ${VERSION}
|
2024-07-23 08:20:03 +08:00
|
|
|
SHA512 5bd515da85f9e87b98f09a29472f788e869ccc3355f9583fbb4215d954cc5f97239e017120a0b358d259e58d0bd8e538fd00ea102fdbc1b29363cd92f06d0299
|
2022-09-03 05:30:19 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
|
|
|
external-libtasn1.patch
|
|
|
|
pkgconfig.patch
|
2024-07-23 08:20:03 +08:00
|
|
|
ssize_t_already_define.patch
|
2024-07-30 14:04:27 +08:00
|
|
|
fix-warnings.patch
|
2024-09-04 02:56:21 +08:00
|
|
|
mkdir.patch
|
2022-09-03 05:30:19 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/devel/perlasm")
|
|
|
|
|
|
|
|
vcpkg_download_distfile(
|
|
|
|
GNULIB_SNAPSHOT
|
|
|
|
URLS "https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=snapshot;h=${GNULIB_REF};sf=tgz"
|
|
|
|
FILENAME "gnulib-${GNULIB_REF}.tar.gz"
|
2024-07-21 02:31:32 +08:00
|
|
|
SHA512 bc99be736d2907049d498f44d8f24db4beb2b3645459451b595087b9406ac1eebe4cbb4f2ef65df9e65823e01db4b4800b75eb9537236797fe1edcc65418c520
|
2022-09-03 05:30:19 +08:00
|
|
|
)
|
|
|
|
|
2023-04-14 00:13:15 +08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
GNULIB_SOURCE_PATH
|
2022-09-03 05:30:19 +08:00
|
|
|
ARCHIVE "${GNULIB_SNAPSHOT}"
|
2023-04-14 00:13:15 +08:00
|
|
|
SOURCE_BASE ${GNULIB_REF}
|
2022-09-03 05:30:19 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/gnulib")
|
|
|
|
file(RENAME "${GNULIB_SOURCE_PATH}" "${SOURCE_PATH}/gnulib")
|
|
|
|
|
|
|
|
include("${CURRENT_HOST_INSTALLED_DIR}/share/yasm-tool-helper/yasm-tool-helper.cmake")
|
|
|
|
yasm_tool_helper(OUT_VAR YASM)
|
|
|
|
file(TO_NATIVE_PATH "${YASM}" YASM)
|
|
|
|
|
|
|
|
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(_gnutlsproject "${SOURCE_PATH}/SMP/libgnutls.vcxproj")
|
|
|
|
file(READ "${_gnutlsproject}" _contents)
|
|
|
|
string(REPLACE [[<Import Project="$(VCTargetsPath)\BuildCustomizations\yasm.props" />]]
|
|
|
|
"<Import Project=\"${CURRENT_HOST_INSTALLED_DIR}/share/vs-yasm/yasm.props\" />"
|
|
|
|
_contents "${_contents}")
|
|
|
|
string(REPLACE [[<Import Project="$(VCTargetsPath)\BuildCustomizations\yasm.targets" />]]
|
|
|
|
"<Import Project=\"${CURRENT_HOST_INSTALLED_DIR}/share/vs-yasm/yasm.targets\" />"
|
|
|
|
_contents "${_contents}")
|
|
|
|
string(REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_HOST_INSTALLED_DIR}/share" _contents "${_contents}") # Above already
|
|
|
|
file(WRITE "${_gnutlsproject}" "${_contents}")
|
|
|
|
|
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL "static")
|
|
|
|
set(RuntimeLibraryExt "")
|
|
|
|
else()
|
|
|
|
set(RuntimeLibraryExt "DLL")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# patch output library file path and name
|
|
|
|
foreach(PROPS IN ITEMS
|
|
|
|
"${SOURCE_PATH}/SMP/smp_deps.props"
|
|
|
|
"${SOURCE_PATH}/SMP/smp_winrt_deps.props")
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${PROPS}"
|
|
|
|
[=[_winrt</TargetName>]=]
|
|
|
|
[=[</TargetName>]=]
|
2024-06-20 05:07:05 +08:00
|
|
|
IGNORE_UNCHANGED
|
2022-09-03 05:30:19 +08:00
|
|
|
)
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${PROPS}"
|
|
|
|
[=[<TargetName>lib$(RootNamespace)]=]
|
|
|
|
[=[<TargetName>$(RootNamespace)]=]
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# patch hogweed, gpm, nettle, zlib libraries file names; inject RuntimeLibrary property to control CRT linkage
|
|
|
|
foreach(VCXPROJ IN ITEMS
|
|
|
|
"${SOURCE_PATH}/SMP/libgnutls.vcxproj"
|
|
|
|
"${SOURCE_PATH}/SMP/libgnutls_winrt.vcxproj")
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${VCXPROJ}"
|
|
|
|
"_winrt.lib"
|
|
|
|
".lib"
|
2024-06-20 05:07:05 +08:00
|
|
|
IGNORE_UNCHANGED
|
2022-09-03 05:30:19 +08:00
|
|
|
)
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${VCXPROJ}"
|
|
|
|
"libhogweed"
|
|
|
|
"hogweed"
|
|
|
|
)
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${VCXPROJ}"
|
|
|
|
"hogweedd"
|
|
|
|
"hogweed"
|
|
|
|
)
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${VCXPROJ}"
|
|
|
|
"libgmp"
|
|
|
|
"gmp"
|
|
|
|
)
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${VCXPROJ}"
|
|
|
|
"gmpd"
|
|
|
|
"gmp"
|
|
|
|
)
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${VCXPROJ}"
|
|
|
|
"libnettle"
|
|
|
|
"nettle"
|
|
|
|
)
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${VCXPROJ}"
|
|
|
|
"nettled"
|
|
|
|
"nettle"
|
|
|
|
)
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${VCXPROJ}"
|
|
|
|
"libzlib"
|
|
|
|
"zlib"
|
|
|
|
)
|
|
|
|
vcpkg_replace_string(
|
|
|
|
"${VCXPROJ}"
|
|
|
|
[=[</DisableSpecificWarnings>]=]
|
|
|
|
[=[</DisableSpecificWarnings><RuntimeLibrary>$(RuntimeLibrary)</RuntimeLibrary>]=]
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
vcpkg_install_msbuild(
|
|
|
|
USE_VCPKG_INTEGRATION
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
PROJECT_SUBPATH SMP/libgnutls.sln
|
|
|
|
PLATFORM ${TRIPLET_SYSTEM_ARCH}
|
|
|
|
LICENSE_SUBPATH LICENSE
|
|
|
|
RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE}
|
|
|
|
DEBUG_CONFIGURATION ${CONFIGURATION_DEBUG}
|
|
|
|
SKIP_CLEAN
|
|
|
|
OPTIONS /p:YasmPath="${YASM}" /p:OutDir=..\\msvc
|
|
|
|
OPTIONS_DEBUG /p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}
|
|
|
|
OPTIONS_RELEASE /p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}
|
|
|
|
)
|
|
|
|
|
|
|
|
get_filename_component(SOURCE_PATH_SUFFIX "${SOURCE_PATH}" NAME)
|
|
|
|
if(VCPKG_TARGET_IS_UWP)
|
|
|
|
set(WINRT_SUBFOLDER libgnutls_winrt)
|
|
|
|
endif()
|
|
|
|
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/${WINRT_SUBFOLDER}/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
|
|
|
|
|
|
|
|
set(GNUTLS_REQUIRES_PRIVATE "Requires.private: gmp, nettle, hogweed, libtasn1")
|
|
|
|
set(GNUTLS_LIBS_PRIVATE "-lcrypt32 -lws2_32 -lkernel32 -lncrypt")
|
|
|
|
|
|
|
|
set(prefix "${CURRENT_INSTALLED_DIR}")
|
|
|
|
set(exec_prefix "\${prefix}")
|
|
|
|
set(libdir "\${prefix}/lib")
|
|
|
|
set(includedir "\${prefix}/include")
|
|
|
|
set(GNUTLS_LIBS "-lgnutls")
|
|
|
|
configure_file("${SOURCE_PATH}/lib/gnutls.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gnutls.pc" @ONLY)
|
|
|
|
|
|
|
|
set(prefix "${CURRENT_INSTALLED_DIR}/debug")
|
|
|
|
set(exec_prefix "\${prefix}")
|
|
|
|
set(libdir "\${prefix}/lib")
|
|
|
|
set(includedir "\${prefix}/../include")
|
|
|
|
set(GNUTLS_LIBS "-lgnutlsd")
|
|
|
|
configure_file("${SOURCE_PATH}/lib/gnutls.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gnutls.pc" @ONLY)
|
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
vcpkg_copy_pdbs()
|
2024-08-17 16:40:37 +08:00
|
|
|
file(COPY "${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/gnutls")
|