From 9f889d761d1c200c5843b26cb47fee4845ecdb83 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 9 Mar 2022 21:48:43 +0100 Subject: [PATCH 01/22] [gmp] use native buildsystem on windows --- ports/gmp/adddef.patch | 12 --- ports/gmp/portfile.cmake | 156 ++++++++++----------------------- ports/gmp/runtime.patch | 180 --------------------------------------- ports/gmp/vcpkg.json | 7 +- ports/gmp/vs.build.patch | 172 ------------------------------------- ports/gmp/yasm.patch | 83 ++++++++++++++++++ 6 files changed, 130 insertions(+), 480 deletions(-) delete mode 100644 ports/gmp/adddef.patch delete mode 100644 ports/gmp/runtime.patch delete mode 100644 ports/gmp/vs.build.patch create mode 100644 ports/gmp/yasm.patch diff --git a/ports/gmp/adddef.patch b/ports/gmp/adddef.patch deleted file mode 100644 index c2276ffc10b2d6..00000000000000 --- a/ports/gmp/adddef.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/SMP/libgmp.def b/SMP/libgmp.def -index 289f0e2d1..632274ab2 100644 ---- a/SMP/libgmp.def -+++ b/SMP/libgmp.def -@@ -16,6 +16,7 @@ __gmp_randclear - __gmp_urandomb_ui - __gmp_urandomm_ui - __gmp_asprintf -+__gmp_vasprintf - __gmp_fprintf - __gmp_printf - __gmp_snprintf diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index 6007ad9c60dd3b..62b4c6c8e26dc5 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -2,116 +2,52 @@ if(EXISTS "${CURRENT_INSTALLED_DIR}/include/gmp.h" OR "${CURRENT_INSTALLED_DIR}/ message(FATAL_ERROR "Can't build ${PORT} if mpir is installed. Please remove mpir, and try install ${PORT} again if you need it.") endif() -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO ShiftMediaProject/gmp - REF 0018c44e8dfcc3b64b43e0aea4b3f419f0b65fd0 #v6.2.1-2 - SHA512 2405e2536ca9fe0b890f44f54c936ac0e4b5a9ebe6a19e1c48a9c21b7211d2a1b45865852e3c65a98a6735216a4e27bea75c0fd6e52efeed4baecd95da9895a5 - HEAD_REF master - PATCHES - vs.build.patch - runtime.patch - adddef.patch - ) - - 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() - - #Setup YASM integration - set(_porjectfile) - if(VCPKG_TARGET_IS_UWP) - set(_porjectfile "${SOURCE_PATH}/SMP/libgmp_winrt.vcxproj") - else() - set(_porjectfile "${SOURCE_PATH}/SMP/libgmp.vcxproj") - endif() - set(_file "${_porjectfile}") - file(READ "${_file}" _contents) - string(REPLACE [[]] - "" - _contents "${_contents}") - string(REPLACE [[]] - "" - _contents "${_contents}") - file(WRITE "${_file}" "${_contents}") +vcpkg_download_distfile( + ARCHIVE + URLS https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz + FILENAME gmp-6.2.1.tar.xz + SHA512 c99be0950a1d05a0297d65641dd35b75b74466f7bf03c9e8a99895a3b2f9a0856cd17887738fa51cf7499781b65c049769271cbcb77d057d2e9f1ec52e07dd84 +) + +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + set(PATCHES yasm.patch) +endif() - vcpkg_install_msbuild( - USE_VCPKG_INTEGRATION - SOURCE_PATH ${SOURCE_PATH} - PROJECT_SUBPATH SMP/libgmp.sln - PLATFORM ${TRIPLET_SYSTEM_ARCH} - LICENSE_SUBPATH COPYING.LESSERv3 - TARGET Rebuild - RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE} - DEBUG_CONFIGURATION ${CONFIGURATION_DEBUG} - SKIP_CLEAN - OPTIONS "/p:YasmPath=${YASM}" - ) - 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.1) - 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() - if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/gmp.h" - "#if defined(DLL_EXPORT) && defined(NO_ASM)" - "#if 1") +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${ARCHIVE}" + REF gmp-6.2.1 + PATCHES + ${PATCHES} + tools.patch +) + +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + set(ENV{CCAS} "${CURRENT_HOST_INSTALLED_DIR}/tools/yasm-tool/yasm${VCPKG_HOST_EXECUTABLE_SUFFIX}") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(asmflag win64) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(asmflag win32) endif() -else() - vcpkg_download_distfile( - ARCHIVE - URLS https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz - FILENAME gmp-6.2.1.tar.xz - SHA512 c99be0950a1d05a0297d65641dd35b75b74466f7bf03c9e8a99895a3b2f9a0856cd17887738fa51cf7499781b65c049769271cbcb77d057d2e9f1ec52e07dd84 - ) - - vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - REF gmp-6.2.1 - PATCHES - tools.patch - ) - - vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} - AUTOCONFIG - OPTIONS - --enable-cxx - ) - - 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) + set(ENV{ASMFLAGS} "-Xvc -f ${asmflag} -pgas -rraw") + set(OPTIONS ac_cv_func_memset=yes + "gmp_cv_asm_w32=.word" + ) + endif() +vcpkg_configure_make( + SOURCE_PATH "${SOURCE_PATH}" + AUTOCONFIG + OPTIONS + ${OPTIONS} + --enable-cxx +) + +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) + diff --git a/ports/gmp/runtime.patch b/ports/gmp/runtime.patch deleted file mode 100644 index f219e3dc740043..00000000000000 --- a/ports/gmp/runtime.patch +++ /dev/null @@ -1,180 +0,0 @@ -diff --git a/SMP/smp.props b/SMP/smp.props -index fc70bd8..d515523 100644 ---- a/SMP/smp.props -+++ b/SMP/smp.props -@@ -86,7 +86,7 @@ - - - -- lib$(RootNamespace)d -+ $(RootNamespace)d - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated -@@ -94,7 +94,7 @@ - MSB8012 - - -- lib$(RootNamespace)d -+ $(RootNamespace)d - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated -@@ -118,7 +118,7 @@ - MSB8012 - - -- lib$(RootNamespace) -+ $(RootNamespace) - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated -@@ -126,7 +126,7 @@ - MSB8012 - - -- lib$(RootNamespace) -+ $(RootNamespace) - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated -@@ -159,6 +159,7 @@ - $(OutDir)\lib\x86\$(TargetName).pdb - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebug - - - $(OutDir)\lib\x86\$(TargetName)$(TargetExt) -@@ -177,6 +178,7 @@ - $(OutDir)\lib\x64\$(TargetName).pdb - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebug - - - $(OutDir)\lib\x64\$(TargetName)$(TargetExt) -@@ -196,6 +198,7 @@ - $(IntDir)$(TargetName).pdb - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebugDLL - - - $(OutDir)\bin\x86\$(TargetName)$(TargetExt) -@@ -219,6 +222,7 @@ - $(IntDir)$(TargetName).pdb - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebugDLL - - - $(OutDir)\bin\x64\$(TargetName)$(TargetExt) -@@ -248,6 +252,7 @@ - SingleFile - $(OutDir)\lib\x86\$(TargetName).pdb - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreaded - - - $(OutDir)\lib\x86\$(TargetName)$(TargetExt) -@@ -273,6 +278,7 @@ - SingleFile - $(OutDir)\lib\x64\$(TargetName).pdb - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreaded - - - $(OutDir)\lib\x64\$(TargetName)$(TargetExt) -@@ -297,6 +303,7 @@ - $(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories) - $(IntDir)$(TargetName).pdb - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDLL - - - true -@@ -328,6 +335,7 @@ - $(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories) - $(IntDir)$(TargetName).pdb - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDLL - - - true -diff --git a/SMP/smp_winrt.props b/SMP/smp_winrt.props -index cb5f090..19b2b8d 100644 ---- a/SMP/smp_winrt.props -+++ b/SMP/smp_winrt.props -@@ -97,7 +97,7 @@ - - - -- lib$(RootNamespace)d_winrt -+ l$(RootNamespace)d - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated -@@ -105,7 +105,7 @@ - MSB8012 - - -- lib$(RootNamespace)d_winrt -+ $(RootNamespace)d - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated -@@ -113,7 +113,7 @@ - MSB8012 - - -- $(RootNamespace)d_winrt -+ $(RootNamespace)d - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated -@@ -121,7 +121,7 @@ - MSB8012 - - -- $(RootNamespace)d_winrt -+ $(RootNamespace)d - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated -@@ -129,7 +129,7 @@ - MSB8012 - - -- lib$(RootNamespace)_winrt -+ $(RootNamespace) - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated -@@ -137,7 +137,7 @@ - MSB8012 - - -- lib$(RootNamespace)_winrt -+ $(RootNamespace) - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated -@@ -145,7 +145,7 @@ - MSB8012 - - -- $(RootNamespace)_winrt -+ $(RootNamespace) - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated -@@ -153,7 +153,7 @@ - MSB8012 - - -- $(RootNamespace)_winrt -+ $(RootNamespace) - $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated diff --git a/ports/gmp/vcpkg.json b/ports/gmp/vcpkg.json index f907a9babdb175..40820b2ce9d603 100644 --- a/ports/gmp/vcpkg.json +++ b/ports/gmp/vcpkg.json @@ -1,16 +1,11 @@ { "name": "gmp", "version-string": "6.2.1", - "port-version": 7, + "port-version": 8, "description": "The GNU Multiple Precision Arithmetic Library", "homepage": "https://gmplib.org", "supports": "!(windows & (arm | arm64))", "dependencies": [ - { - "name": "vs-yasm", - "host": true, - "platform": "windows" - }, { "name": "yasm-tool", "host": true, diff --git a/ports/gmp/vs.build.patch b/ports/gmp/vs.build.patch deleted file mode 100644 index 4c04d0c1659645..00000000000000 --- a/ports/gmp/vs.build.patch +++ /dev/null @@ -1,172 +0,0 @@ -diff --git a/SMP/smp.props b/SMP/smp.props -index e2ed214..fc70bd8 100644 ---- a/SMP/smp.props -+++ b/SMP/smp.props -@@ -87,7 +87,7 @@ - - - lib$(RootNamespace)d -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -95,7 +95,7 @@ - - - lib$(RootNamespace)d -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -103,7 +103,7 @@ - - - $(RootNamespace)d -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -111,7 +111,7 @@ - - - $(RootNamespace)d -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -119,7 +119,7 @@ - - - lib$(RootNamespace) -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -127,7 +127,7 @@ - - - lib$(RootNamespace) -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -135,7 +135,7 @@ - - - $(RootNamespace) -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -143,7 +143,7 @@ - - - $(RootNamespace) -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -diff --git a/SMP/smp_winrt.props b/SMP/smp_winrt.props -index 9b453a5..cb5f090 100644 ---- a/SMP/smp_winrt.props -+++ b/SMP/smp_winrt.props -@@ -98,7 +98,7 @@ - - - lib$(RootNamespace)d_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -106,7 +106,7 @@ - - - lib$(RootNamespace)d_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -114,7 +114,7 @@ - - - $(RootNamespace)d_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -122,7 +122,7 @@ - - - $(RootNamespace)d_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -130,7 +130,7 @@ - - - lib$(RootNamespace)_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -138,7 +138,7 @@ - - - lib$(RootNamespace)_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -146,7 +146,7 @@ - - - $(RootNamespace)_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -154,7 +154,7 @@ - - - $(RootNamespace)_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -diff --git a/gmp.pc.in b/gmp.pc.in -index bf1c799..d0c81be 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 181cc70..2b697ce 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@ diff --git a/ports/gmp/yasm.patch b/ports/gmp/yasm.patch new file mode 100644 index 00000000000000..8ea6ac35659291 --- /dev/null +++ b/ports/gmp/yasm.patch @@ -0,0 +1,83 @@ +diff --git a/acinclude.m4 b/acinclude.m4 +index 86175ce42..8228d20dc 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -1649,7 +1649,7 @@ AC_DEFUN([GMP_TRY_ASSEMBLE], + [cat >conftest.s <&AC_FD_CC + ifelse([$2],,:,[$2]) +@@ -2382,7 +2382,7 @@ for tmp_underscore in "" "_"; do + ${tmp_gsym_prefix}main$gmp_cv_asm_label_suffix + addl $ ${tmp_underscore}_GLOBAL_OFFSET_TABLE_, %ebx + EOF +- gmp_compile="$CCAS $CFLAGS $CPPFLAGS $lt_prog_compiler_pic conftest.s >&AC_FD_CC && $CC $CFLAGS $CPPFLAGS $lt_prog_compiler_pic conftest.$OBJEXT >&AC_FD_CC" ++ gmp_compile="$CCAS $CPPFLAGS $ASMFLAGS $lt_prog_compiler_pic conftest.s >&AC_FD_CC && $CC $CPPFLAGS $ASMFLAGS $lt_prog_compiler_pic conftest.$OBJEXT >&AC_FD_CC" + if AC_TRY_EVAL(gmp_compile); then + if test "$tmp_underscore" = "_"; then + gmp_cv_asm_x86_got_underscore=yes +@@ -2556,7 +2556,7 @@ movq-bug) + AC_MSG_WARN([+----------------------------------------------------------]) + AC_MSG_WARN([| WARNING WARNING WARNING]) + AC_MSG_WARN([| Host CPU has MMX code, but the assembler]) +- AC_MSG_WARN([| $CCAS $CFLAGS $CPPFLAGS]) ++ AC_MSG_WARN([| $CCAS $CPPFLAGS $ASMFLAGS]) + AC_MSG_WARN([| has the Solaris 2.6 and 2.7 bug where register to register]) + AC_MSG_WARN([| movq operands are reversed.]) + AC_MSG_WARN([| Non-MMX replacements will be used.]) +diff --git a/mpn/Makeasm.am b/mpn/Makeasm.am +index 5d7306c22..75692128d 100644 +--- a/mpn/Makeasm.am ++++ b/mpn/Makeasm.am +@@ -32,7 +32,7 @@ + # COMPILE minus CC. + # + COMPILE_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ +- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ASMFLAGS) ++ $(CPPFLAGS) $(ASMFLAGS) + + # Flags used for preprocessing (in ansi2knr rules). + # +diff --git a/mpn/Makefile.in b/mpn/Makefile.in +index 2bc061012..59c805976 100644 +--- a/mpn/Makefile.in ++++ b/mpn/Makefile.in +@@ -403,7 +403,7 @@ EXTRA_DIST = asm-defs.m4 cpp-ccas m4-ccas $(TARG_DIST) + # COMPILE minus CC. + # + COMPILE_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ +- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ASMFLAGS) ++ $(CPPFLAGS) $(ASMFLAGS) + + + # Flags used for preprocessing (in ansi2knr rules). +diff --git a/tests/Makefile.in b/tests/Makefile.in +index 9742a4016..430603cef 100644 +--- a/tests/Makefile.in ++++ b/tests/Makefile.in +@@ -666,7 +666,7 @@ SUBDIRS = . devel mpn mpz mpq mpf rand misc cxx + # COMPILE minus CC. + # + COMPILE_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ +- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ASMFLAGS) ++ $(CPPFLAGS) $(ASMFLAGS) + + + # Flags used for preprocessing (in ansi2knr rules). +diff --git a/tune/Makefile.in b/tune/Makefile.in +index f82cd13e2..351bcd9b1 100644 +--- a/tune/Makefile.in ++++ b/tune/Makefile.in +@@ -549,7 +549,7 @@ TUNE_MPN_SRCS_BASIC = div_qr_2.c bdiv_q.c bdiv_qr.c \ + # COMPILE minus CC. + # + COMPILE_FLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ +- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(ASMFLAGS) ++ $(CPPFLAGS) $(ASMFLAGS) + + + # Flags used for preprocessing (in ansi2knr rules). From db9f4c6eff5c9f4db4368bdeeafd02bac28e697d Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 9 Mar 2022 22:14:02 +0100 Subject: [PATCH 02/22] fix stuff from merge --- ports/gmp/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index 62b4c6c8e26dc5..4dd78583179768 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -23,7 +23,7 @@ vcpkg_extract_source_archive_ex( ) if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - set(ENV{CCAS} "${CURRENT_HOST_INSTALLED_DIR}/tools/yasm-tool/yasm${VCPKG_HOST_EXECUTABLE_SUFFIX}") + set(ENV{CCAS} "${CURRENT_HOST_INSTALLED_DIR}/tools/yasm/yasm${VCPKG_HOST_EXECUTABLE_SUFFIX}") if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(asmflag win64) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") @@ -48,6 +48,6 @@ vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -# # Handle copyright +# Handle copyright file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) From fbc29dbdb465ea5f376a203fb1cff31cbf7b626b Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 9 Mar 2022 22:15:55 +0100 Subject: [PATCH 03/22] fix version --- ports/gmp/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/gmp/vcpkg.json b/ports/gmp/vcpkg.json index 11766157b4e392..adce9edfb4c242 100644 --- a/ports/gmp/vcpkg.json +++ b/ports/gmp/vcpkg.json @@ -1,6 +1,6 @@ { "name": "gmp", - "version-string": "6.2.1", + "version": "6.2.1", "port-version": 9, "description": "The GNU Multiple Precision Arithmetic Library", "homepage": "https://gmplib.org", From dcc1b6e03f2d3142975b82c3730b304f1b8eed5e Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 9 Mar 2022 22:16:08 +0100 Subject: [PATCH 04/22] version stuff --- versions/baseline.json | 2 +- versions/g-/gmp.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 539209d079e7e6..ec78293334e241 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2534,7 +2534,7 @@ }, "gmp": { "baseline": "6.2.1", - "port-version": 8 + "port-version": 9 }, "gmsh": { "baseline": "4.9.0", diff --git a/versions/g-/gmp.json b/versions/g-/gmp.json index 85c94f62f43b64..f6ad9ad56ccb0e 100644 --- a/versions/g-/gmp.json +++ b/versions/g-/gmp.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "66917e3a6421c994cf676763cd48c30f8117c8ec", + "version": "6.2.1", + "port-version": 9 + }, { "git-tree": "8d09c9addf60d381cabe4c565cb59b27f5b2bdc7", "version-string": "6.2.1", From daf75e7a361b347471bb3b3f24e5f0332374fa52 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 11 Mar 2022 00:16:12 +0100 Subject: [PATCH 05/22] trying patching some symbols for dynamic builds --- ports/gmp/msvc_symbol.patch | 28 ++++++++++++++++++++++++++++ ports/gmp/portfile.cmake | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 ports/gmp/msvc_symbol.patch diff --git a/ports/gmp/msvc_symbol.patch b/ports/gmp/msvc_symbol.patch new file mode 100644 index 00000000000000..c416595b30e655 --- /dev/null +++ b/ports/gmp/msvc_symbol.patch @@ -0,0 +1,28 @@ +diff --git a/configure.ac b/configure.ac +index cafdb3c71..bd92bc4bb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2703,8 +2703,8 @@ Use "--disable-static --enable-shared" to build just a DLL.]) + # + if test "$enable_shared" = yes; then + GMP_LDFLAGS="$GMP_LDFLAGS -no-undefined -Wl,--export-all-symbols" +- LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def" +- LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def" ++ #LIBGMP_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmp-3.dll.def" ++ #LIBGMPXX_LDFLAGS="$LIBGMP_LDFLAGS -Wl,--output-def,.libs/libgmpxx-3.dll.def" + LIBGMP_DLL=1 + fi + ;; +diff --git a/gmp-h.in b/gmp-h.in +index 3d449d427..18a03b753 100644 +--- a/gmp-h.in ++++ b/gmp-h.in +@@ -398,7 +398,7 @@ typedef __mpq_struct *mpq_ptr; + + /* Microsoft's C compiler accepts __inline */ + #ifdef _MSC_VER +-#define __GMP_EXTERN_INLINE __inline ++#define __GMP_EXTERN_INLINE static __inline + #endif + + /* Recent enough Sun C compilers want "inline" */ diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index 4dd78583179768..538940d5561f58 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -10,7 +10,8 @@ vcpkg_download_distfile( ) if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - set(PATCHES yasm.patch) + set(PATCHES yasm.patch + msvc_symbol.patch) endif() vcpkg_extract_source_archive_ex( From a53a489bc0a10172a5f41976dd774ad3c2019e3e Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 11 Mar 2022 11:35:49 +0100 Subject: [PATCH 06/22] fix nettle build --- ports/nettle/gmp.patch | 8 +++---- ports/nettle/name.dir.patch | 8 +++---- ports/nettle/portfile.cmake | 3 ++- ports/nettle/remove_gmpd.patch | 44 ++++++++++++++++++++++++++++++++++ ports/nettle/vcpkg.json | 2 +- 5 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 ports/nettle/remove_gmpd.patch diff --git a/ports/nettle/gmp.patch b/ports/nettle/gmp.patch index c54298a28c5288..b9eec5e1e64935 100644 --- a/ports/nettle/gmp.patch +++ b/ports/nettle/gmp.patch @@ -20,7 +20,7 @@ index 476f7a7..308bd0b 100644 libhogweed.def - nettled_winrt.lib;gmpd_winrt.lib;%(AdditionalDependencies) -+ nettled_winrt.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled_winrt.lib;gmp.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -29,7 +29,7 @@ index 476f7a7..308bd0b 100644 libhogweed.def - nettled_winrt.lib;gmpd_winrt.lib;%(AdditionalDependencies) -+ nettled_winrt.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled_winrt.lib;gmp.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -136,7 +136,7 @@ index cb650ab..188f67a 100644 libnettle.def - gmpd_winrt.lib;%(AdditionalDependencies) -+ gmpd.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) mkdir "$(OutDir)"\include @@ -145,7 +145,7 @@ index cb650ab..188f67a 100644 libnettle.def - gmpd_winrt.lib;%(AdditionalDependencies) -+ gmpd.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) mkdir "$(OutDir)"\include diff --git a/ports/nettle/name.dir.patch b/ports/nettle/name.dir.patch index 834a0440978740..ff1ce206afd115 100644 --- a/ports/nettle/name.dir.patch +++ b/ports/nettle/name.dir.patch @@ -82,8 +82,8 @@ index 308bd0b..a436c69 100644 libhogweed.def -- nettled_winrt.lib;gmpd.lib;%(AdditionalDependencies) -+ nettled.lib;gmpd.lib;%(AdditionalDependencies) +- nettled_winrt.lib;gmp.lib;%(AdditionalDependencies) ++ nettled.lib;gmp.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) @@ -91,8 +91,8 @@ index 308bd0b..a436c69 100644 libhogweed.def -- nettled_winrt.lib;gmpd.lib;%(AdditionalDependencies) -+ nettled.lib;gmpd.lib;%(AdditionalDependencies) +- nettled_winrt.lib;gmp.lib;%(AdditionalDependencies) ++ nettled.lib;gmp.lib;%(AdditionalDependencies) /IGNORE:4006,4221,4078 %(AdditionalOptions) diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index 731017de7be79d..5f0fba4f24163d 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -9,6 +9,7 @@ if(VCPKG_TARGET_IS_WINDOWS) gmp.patch name.dir.patch runtime.patch + remove_gmpd.patch ) include(${CURRENT_INSTALLED_DIR}/share/yasm-tool-helper/yasm-tool-helper.cmake) @@ -88,7 +89,7 @@ if(VCPKG_TARGET_IS_WINDOWS) set(exec_prefix "\${prefix}") set(libdir "\${prefix}/lib") set(includedir "\${prefix}/../include") - set(LIBS "-lnettled -lgmpd") + set(LIBS "-lnettled -lgmp") configure_file("${SOURCE_PATH}/nettle.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/nettle.pc" @ONLY) set(LIBS -lnettled) set(HOGWEED -lhogweedd) diff --git a/ports/nettle/remove_gmpd.patch b/ports/nettle/remove_gmpd.patch new file mode 100644 index 00000000000000..a248d81e2422c1 --- /dev/null +++ b/ports/nettle/remove_gmpd.patch @@ -0,0 +1,44 @@ +diff --git a/SMP/libnettle.vcxproj b/SMP/libnettle.vcxproj +index 51fa24113..5d418b53e 100644 +--- a/SMP/libnettle.vcxproj ++++ b/SMP/libnettle.vcxproj +@@ -245,7 +245,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + + + libnettle.def +- gmpd.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +@@ -359,7 +359,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + + + libnettle.def +- gmpd.lib;%(AdditionalDependencies) ++ gmp.lib;%(AdditionalDependencies) + + + mkdir "$(OutDir)"\include +diff --git a/SMP/libhogweed.vcxproj b/SMP/libhogweed.vcxproj +index 8f2f433bc..dae3458d8 100644 +--- a/SMP/libhogweed.vcxproj ++++ b/SMP/libhogweed.vcxproj +@@ -247,7 +247,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + + + libhogweed.def +- nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + +@@ -362,7 +362,7 @@ del /f /q $(OutDir)\licenses\nettle.txt + + + libhogweed.def +- nettled.lib;gmpd.lib;%(AdditionalDependencies) ++ nettled.lib;gmp.lib;%(AdditionalDependencies) + /IGNORE:4006,4221,4078 %(AdditionalOptions) + + diff --git a/ports/nettle/vcpkg.json b/ports/nettle/vcpkg.json index 1a653be5ff7681..9687c502463b57 100644 --- a/ports/nettle/vcpkg.json +++ b/ports/nettle/vcpkg.json @@ -1,7 +1,7 @@ { "name": "nettle", "version-string": "3.6", - "port-version": 1, + "port-version": 2, "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.", "homepage": "https://git.lysator.liu.se/nettle/nettle", "dependencies": [ From af9a9c6e914820cab175734d8f7467750fa2a348 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 11 Mar 2022 11:36:12 +0100 Subject: [PATCH 07/22] fix more dependent ports using gmpd --- ports/mpc/gmpd.patch | 15 --------------- ports/mpc/portfile.cmake | 1 - ports/mpc/vcpkg.json | 4 ++-- ports/mpfr/portfile.cmake | 4 ---- 4 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 ports/mpc/gmpd.patch diff --git a/ports/mpc/gmpd.patch b/ports/mpc/gmpd.patch deleted file mode 100644 index b08625777c365f..00000000000000 --- a/ports/mpc/gmpd.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index ab3da6092..2533df1d8 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -151,7 +151,9 @@ AC_CHECK_FUNCS([dup dup2],, - - AC_CHECK_LIB([gmp], [__gmpz_init], - [LIBS="-lgmp $LIBS"], -- [AC_MSG_ERROR([libgmp not found or uses a different ABI (including static vs shared).])]) -+ [AC_CHECK_LIB([gmpd], [__gmpz_init], -+ [LIBS="-lgmpd $LIBS"], -+ [AC_MSG_ERROR([libgmp not found or uses a different ABI (including static vs shared).])])]) - - AC_MSG_CHECKING(for MPFR) - LIBS="-lmpfr $LIBS" diff --git a/ports/mpc/portfile.cmake b/ports/mpc/portfile.cmake index 66aeb9f18fd987..7ecd9b325bca0d 100644 --- a/ports/mpc/portfile.cmake +++ b/ports/mpc/portfile.cmake @@ -7,7 +7,6 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} - PATCHES gmpd.patch ) vcpkg_configure_make( diff --git a/ports/mpc/vcpkg.json b/ports/mpc/vcpkg.json index 2c8e38d1da1f30..9f79c44a801646 100644 --- a/ports/mpc/vcpkg.json +++ b/ports/mpc/vcpkg.json @@ -1,7 +1,7 @@ { "name": "mpc", - "version-string": "1.2.0", - "port-version": 1, + "version": "1.2.0", + "port-version": 2, "description": "GNU MPC is a C library for the arithmetic of complex numbers with arbitrarily high precision and correct rounding of the result.", "homepage": "http://www.multiprecision.org/mpc/", "dependencies": [ diff --git a/ports/mpfr/portfile.cmake b/ports/mpfr/portfile.cmake index 59354a99e5b050..36eb91d535488e 100644 --- a/ports/mpfr/portfile.cmake +++ b/ports/mpfr/portfile.cmake @@ -27,10 +27,6 @@ vcpkg_configure_make( vcpkg_install_make() vcpkg_copy_pdbs() - -if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/mpfr.pc" AND VCPKG_TARGET_IS_WINDOWS) - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/mpfr.pc" " -lgmp" " -lgmpd") -endif() vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") From a811f21c9e7a84d81ff0815c9c337086016469f7 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 11 Mar 2022 14:00:14 +0100 Subject: [PATCH 08/22] fix uwp builds by copying tools --- ports/gmp/portfile.cmake | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ports/gmp/portfile.cmake b/ports/gmp/portfile.cmake index 538940d5561f58..b4acb3047bfb94 100644 --- a/ports/gmp/portfile.cmake +++ b/ports/gmp/portfile.cmake @@ -36,6 +36,13 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) ) endif() + +if(VCPKG_CROSSCOMPILING) + # Silly trick to make configure accept CC_FOR_BUILD but in reallity CC_FOR_BUILD is deactivated. + set(ENV{CC_FOR_BUILD} "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true") + set(ENV{CPP_FOR_BUILD} "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true") +endif() + vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" AUTOCONFIG @@ -44,7 +51,25 @@ vcpkg_configure_make( --enable-cxx ) +set(tool_names bases fac fib jacobitab psqr trialdivtab) +list(TRANSFORM tool_names PREPEND "gen-") +list(TRANSFORM tool_names APPEND "${VCPKG_HOST_EXECUTABLE_SUFFIX}") + +if(VCPKG_CROSSCOMPILING) + list(TRANSFORM tool_names PREPEND "${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}/") + file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/" ) + if(NOT VCPKG_BUILD_TYPE) + file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/" ) + endif() +endif() + vcpkg_install_make() + +if(NOT VCPKG_CROSSCOMPILING) + list(TRANSFORM tool_names PREPEND "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/") + file(COPY ${tool_names} DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}" ) +endif() + vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") From 8cf4e43dbae616f861a466429be01c197b9f255c Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 11 Mar 2022 14:18:51 +0100 Subject: [PATCH 09/22] missing host dep --- ports/gmp/vcpkg.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/gmp/vcpkg.json b/ports/gmp/vcpkg.json index adce9edfb4c242..8393feed120dcb 100644 --- a/ports/gmp/vcpkg.json +++ b/ports/gmp/vcpkg.json @@ -6,6 +6,10 @@ "homepage": "https://gmplib.org", "supports": "!(windows & (arm | arm64))", "dependencies": [ + { + "name": "gmp", + "host": true + }, { "name": "yasm", "host": true, From 760b730ba541a641a5ad7af9934ccc4d701a77de Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 11 Mar 2022 14:19:43 +0100 Subject: [PATCH 10/22] fix mpfr --- ports/mpfr/gmpd.patch | 15 --------------- ports/mpfr/vcpkg.json | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 ports/mpfr/gmpd.patch diff --git a/ports/mpfr/gmpd.patch b/ports/mpfr/gmpd.patch deleted file mode 100644 index d34027d36496b1..00000000000000 --- a/ports/mpfr/gmpd.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index ea92c1f97..9621a70e5 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -693,8 +693,9 @@ See 'config.log' for details (search for GMP_NUMB_BITS).])], - - dnl Check if we can link with GMP - AC_CHECK_LIB(gmp, __gmpz_init, [LIBS="-lgmp $LIBS"], -+ [AC_CHECK_LIB(gmpd, __gmpz_init, [LIBS="-lgmpd $LIBS"], - [AC_MSG_ERROR([libgmp not found or uses a different ABI (including static vs shared). --Please read the INSTALL file -- see "In case of problem".])]) -+Please read the INSTALL file -- see "In case of problem".])])]) - - dnl Check for corresponding 'gmp.h' and libgmp - AC_MSG_CHECKING(if gmp.h version and libgmp version are the same) diff --git a/ports/mpfr/vcpkg.json b/ports/mpfr/vcpkg.json index 2033a12bb1551d..279d06875ec9b5 100644 --- a/ports/mpfr/vcpkg.json +++ b/ports/mpfr/vcpkg.json @@ -1,6 +1,6 @@ { "name": "mpfr", - "version-string": "4.1.0", + "version": "4.1.0", "port-version": 3, "description": "The MPFR library is a C library for multiple-precision floating-point computations with correct rounding", "homepage": "https://www.mpfr.org", From 0f5f9022e254837fba090e1682e9c76a22e16ae3 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 11 Mar 2022 14:20:09 +0100 Subject: [PATCH 11/22] version-string nettle --- ports/nettle/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nettle/vcpkg.json b/ports/nettle/vcpkg.json index 9687c502463b57..87833d1211cc79 100644 --- a/ports/nettle/vcpkg.json +++ b/ports/nettle/vcpkg.json @@ -1,6 +1,6 @@ { "name": "nettle", - "version-string": "3.6", + "version": "3.6", "port-version": 2, "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.", "homepage": "https://git.lysator.liu.se/nettle/nettle", From 9849682050b2c1fcfd2217812a54e072cb043b2a Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 11 Mar 2022 14:21:50 +0100 Subject: [PATCH 12/22] port-version mpfr --- ports/mpfr/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mpfr/vcpkg.json b/ports/mpfr/vcpkg.json index 279d06875ec9b5..195d7efbee3d6a 100644 --- a/ports/mpfr/vcpkg.json +++ b/ports/mpfr/vcpkg.json @@ -1,7 +1,7 @@ { "name": "mpfr", "version": "4.1.0", - "port-version": 3, + "port-version": 4, "description": "The MPFR library is a C library for multiple-precision floating-point computations with correct rounding", "homepage": "https://www.mpfr.org", "license": "LGPL-3.0-or-later", From 6a76224b4ee00bde60c3135b04c270cf14e4f5e6 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 11 Mar 2022 14:23:10 +0100 Subject: [PATCH 13/22] version stuff --- versions/baseline.json | 6 +++--- versions/g-/gmp.json | 2 +- versions/m-/mpc.json | 5 +++++ versions/m-/mpfr.json | 5 +++++ versions/n-/nettle.json | 5 +++++ 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index d3bd4a1695247e..c118670f5f1da7 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4570,11 +4570,11 @@ }, "mpc": { "baseline": "1.2.0", - "port-version": 1 + "port-version": 2 }, "mpfr": { "baseline": "4.1.0", - "port-version": 3 + "port-version": 4 }, "mpg123": { "baseline": "1.29.2", @@ -4758,7 +4758,7 @@ }, "nettle": { "baseline": "3.6", - "port-version": 1 + "port-version": 2 }, "networkdirect-sdk": { "baseline": "2.0.1", diff --git a/versions/g-/gmp.json b/versions/g-/gmp.json index f6ad9ad56ccb0e..9505d80d19d521 100644 --- a/versions/g-/gmp.json +++ b/versions/g-/gmp.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "66917e3a6421c994cf676763cd48c30f8117c8ec", + "git-tree": "7b9a71843073bf4a86bb64ddf219c9900ebb3dbd", "version": "6.2.1", "port-version": 9 }, diff --git a/versions/m-/mpc.json b/versions/m-/mpc.json index 209ac786cb76a8..da45380dc8aaac 100644 --- a/versions/m-/mpc.json +++ b/versions/m-/mpc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c38230459b115da37fe9fe0161c7462de85549d5", + "version": "1.2.0", + "port-version": 2 + }, { "git-tree": "8ef4f1423bd95ed6bbe514de46fc9f4c8884ae5e", "version-string": "1.2.0", diff --git a/versions/m-/mpfr.json b/versions/m-/mpfr.json index 65d2472d1ca639..a1907ee7bc95a3 100644 --- a/versions/m-/mpfr.json +++ b/versions/m-/mpfr.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "4f90f472a7a6e40ec04070c592a810825c13f985", + "version": "4.1.0", + "port-version": 4 + }, { "git-tree": "9f38beb4c3179d0b08008af901d05c2a70afaa1b", "version-string": "4.1.0", diff --git a/versions/n-/nettle.json b/versions/n-/nettle.json index 00096cd8d2ec10..07261c08a58e40 100644 --- a/versions/n-/nettle.json +++ b/versions/n-/nettle.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2d7735edc12e985fbe6bae0489a8c01ff18413cd", + "version": "3.6", + "port-version": 2 + }, { "git-tree": "87e3211d256198eb00d854b24b2043efb0fe892d", "version-string": "3.6", From d754efedd4d4aa6da201650bbe44226ba51d74ba Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 11 Mar 2022 14:42:13 +0100 Subject: [PATCH 14/22] remove patch from portfile --- ports/mpfr/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/mpfr/portfile.cmake b/ports/mpfr/portfile.cmake index 36eb91d535488e..83354d7d93a4a1 100644 --- a/ports/mpfr/portfile.cmake +++ b/ports/mpfr/portfile.cmake @@ -13,7 +13,6 @@ vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE "${ARCHIVE}" PATCHES - gmpd.patch dll.patch src-only.patch ) From f11866d093105cc01b7b1ab5f64e02bc54f5a5ff Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 11 Mar 2022 14:42:31 +0100 Subject: [PATCH 15/22] version stuff --- versions/m-/mpfr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/m-/mpfr.json b/versions/m-/mpfr.json index a1907ee7bc95a3..e3316b5bb20f4f 100644 --- a/versions/m-/mpfr.json +++ b/versions/m-/mpfr.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "4f90f472a7a6e40ec04070c592a810825c13f985", + "git-tree": "af50e086428e7b7b1e1e5969a296a770a32ff88d", "version": "4.1.0", "port-version": 4 }, From a86500743e49947d7c1fd9395db5357c112c7949 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 12 Mar 2022 09:20:20 +0100 Subject: [PATCH 16/22] [nettle] use native build system --- ports/nettle/compile.patch | 39 +++ ports/nettle/gmp.patch | 205 ------------ ports/nettle/hogweed-x64.def | 288 ++++++++++++++++ ports/nettle/libname-windows.patch | 67 ++++ ports/nettle/name.dir.patch | 381 --------------------- ports/nettle/nettle-x64.def | 509 +++++++++++++++++++++++++++++ ports/nettle/portfile.cmake | 205 +++++------- ports/nettle/remove_gmpd.patch | 44 --- ports/nettle/runtime.patch | 168 ---------- ports/nettle/vcpkg.json | 15 +- ports/nettle/yasm.patch | 96 ++++++ 11 files changed, 1091 insertions(+), 926 deletions(-) create mode 100644 ports/nettle/compile.patch delete mode 100644 ports/nettle/gmp.patch create mode 100644 ports/nettle/hogweed-x64.def create mode 100644 ports/nettle/libname-windows.patch delete mode 100644 ports/nettle/name.dir.patch create mode 100644 ports/nettle/nettle-x64.def delete mode 100644 ports/nettle/remove_gmpd.patch delete mode 100644 ports/nettle/runtime.patch create mode 100644 ports/nettle/yasm.patch diff --git a/ports/nettle/compile.patch b/ports/nettle/compile.patch new file mode 100644 index 00000000000000..2aa1891c811b74 --- /dev/null +++ b/ports/nettle/compile.patch @@ -0,0 +1,39 @@ +diff --git a/examples/Makefile.in b/examples/Makefile.in +index eb6a81790..1d927079c 100644 +--- a/examples/Makefile.in ++++ b/examples/Makefile.in +@@ -11,7 +11,7 @@ PRE_CPPFLAGS = -I.. -I$(top_srcdir) + PRE_LDFLAGS = -L.. + + OPENSSL_LIBFLAGS = @OPENSSL_LIBFLAGS@ +-BENCH_LIBS = @BENCH_LIBS@ -lm ++BENCH_LIBS = @BENCH_LIBS@ + + HOGWEED_TARGETS = rsa-keygen$(EXEEXT) rsa-sign$(EXEEXT) \ + rsa-verify$(EXEEXT) rsa-encrypt$(EXEEXT) rsa-decrypt$(EXEEXT) \ +diff --git a/streebog.c b/streebog.c +index 7ad619d5e..85609a473 100644 +--- a/streebog.c ++++ b/streebog.c +@@ -1233,7 +1233,7 @@ streebog512_compress (struct streebog512_ctx *ctx, const uint8_t *input, uint64_ + static void + streebog_final (struct streebog512_ctx *ctx) + { +- uint64_t Z[8] = {}; ++ uint64_t Z[8] = {0,0,0,0,0,0,0,0}; + unsigned int i; + + /* PAD. It does not count towards message length */ +diff --git a/Makefile.in b/Makefile.in +index b65ff4960..3887d0c8f 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -322,7 +322,7 @@ $(LIBHOGWEED_FORLINK): $(hogweed_OBJS) $(LIBNETTLE_FORLINK) + + # For building the various *data.c programs. -lm needed for shadata. + %$(EXEEXT_FOR_BUILD): %.c +- $(CC_FOR_BUILD) $< $(CFLAGS) -lm -o $@ ++ $(CC_FOR_BUILD) $< $(CFLAGS) -o $@ + + # Explicit dependency. + eccdata$(EXEEXT_FOR_BUILD): mini-gmp.c mini-gmp.h diff --git a/ports/nettle/gmp.patch b/ports/nettle/gmp.patch deleted file mode 100644 index b9eec5e1e64935..00000000000000 --- a/ports/nettle/gmp.patch +++ /dev/null @@ -1,205 +0,0 @@ -diff --git a/SMP/config.h b/SMP/config.h -index e4de0f1..ba41eb4 100644 ---- a/SMP/config.h -+++ b/SMP/config.h -@@ -102,7 +102,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_winrt.vcxproj b/SMP/libhogweed_winrt.vcxproj -index 476f7a7..308bd0b 100644 ---- a/SMP/libhogweed_winrt.vcxproj -+++ b/SMP/libhogweed_winrt.vcxproj -@@ -247,7 +247,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- nettled_winrt.lib;gmpd_winrt.lib;%(AdditionalDependencies) -+ nettled_winrt.lib;gmp.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -362,7 +362,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- nettled_winrt.lib;gmpd_winrt.lib;%(AdditionalDependencies) -+ nettled_winrt.lib;gmp.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -705,7 +705,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- nettle_winrt.lib;gmp_winrt.lib;%(AdditionalDependencies) -+ nettle_winrt.lib;gmp.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -935,7 +935,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- nettle_winrt.lib;gmp_winrt.lib;%(AdditionalDependencies) -+ nettle_winrt.lib;gmp.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -diff --git a/SMP/libnettle.vcxproj b/SMP/libnettle.vcxproj -index 088cb85..cc2cbeb 100644 ---- a/SMP/libnettle.vcxproj -+++ b/SMP/libnettle.vcxproj -@@ -18,7 +18,7 @@ - 4244;4146;4267;4098;%(DisableSpecificWarnings) - - -- libgmpd.lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -131,7 +131,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4244;4146;4267;4098;%(DisableSpecificWarnings) - - -- libgmpd.lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -472,7 +472,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4244;4146;4267;4098;%(DisableSpecificWarnings) - - -- libgmp.lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -586,7 +586,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4244;4146;4267;4098;%(DisableSpecificWarnings) - - -- libgmp.lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -815,7 +815,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libnettle.def -- libgmp.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -1043,7 +1043,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libnettle.def -- libgmp.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -diff --git a/SMP/libnettle_winrt.vcxproj b/SMP/libnettle_winrt.vcxproj -index cb650ab..188f67a 100644 ---- a/SMP/libnettle_winrt.vcxproj -+++ b/SMP/libnettle_winrt.vcxproj -@@ -18,7 +18,7 @@ - 4244;4146;4267;4098;%(DisableSpecificWarnings) - - -- libgmpd_winrt.lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -131,7 +131,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4244;4146;4267;4098;%(DisableSpecificWarnings) - - -- libgmpd_winrt.lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -245,7 +245,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libnettle.def -- gmpd_winrt.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -359,7 +359,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libnettle.def -- gmpd_winrt.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -472,7 +472,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4244;4146;4267;4098;%(DisableSpecificWarnings) - - -- libgmp_winrt.lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -585,7 +585,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4244;4146;4267;4098;%(DisableSpecificWarnings) - - -- libgmp_winrt.lib;%(AdditionalDependencies) -+ %(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -699,7 +699,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libnettle.def -- gmp_winrt.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -813,7 +813,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libnettle.def -- libgmp_winrt.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -927,7 +927,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libnettle.def -- gmp_winrt.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -1041,7 +1041,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libnettle.def -- libgmp_winrt.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) - - - mkdir "$(OutDir)"\include diff --git a/ports/nettle/hogweed-x64.def b/ports/nettle/hogweed-x64.def new file mode 100644 index 00000000000000..14a8bcad7ea8ed --- /dev/null +++ b/ports/nettle/hogweed-x64.def @@ -0,0 +1,288 @@ +EXPORTS + _nettle_ecc_curve448_modp + _nettle_ecc_curve25519_modp + _nettle_ecc_secp521r1_modp + _nettle_ecc_secp384r1_modp + _nettle_ecc_secp256r1_redc + _nettle_ecc_secp224r1_modp + _nettle_ecc_secp192r1_modp + nettle_ed448_shake256_verify + nettle_ed448_shake256_sign + nettle_ed448_shake256_public_key + _nettle_ed448_shake256 + nettle_ed25519_sha512_verify + nettle_ed25519_sha512_sign + nettle_ed25519_sha512_public_key + _nettle_ed25519_sha512 + _nettle_eddsa_verify + _nettle_eddsa_verify_itch + _nettle_eddsa_sign + _nettle_eddsa_sign_itch + _nettle_eddsa_public_key + _nettle_eddsa_public_key_itch + _nettle_eddsa_hash + _nettle_eddsa_expand_key + _nettle_eddsa_decompress + _nettle_eddsa_decompress_itch + _nettle_eddsa_compress + _nettle_eddsa_compress_itch + _nettle_curve448_eh_to_x + nettle_curve448_mul + nettle_curve448_mul_g + _nettle_curve25519_eh_to_x + nettle_curve25519_mul + nettle_curve25519_mul_g + nettle_gostdsa_vko + nettle_gostdsa_verify + nettle_ecc_gostdsa_verify + nettle_ecc_gostdsa_verify_itch + nettle_gostdsa_sign + nettle_ecc_gostdsa_sign + nettle_ecc_gostdsa_sign_itch + nettle_ecdsa_generate_keypair + nettle_ecdsa_verify + nettle_ecc_ecdsa_verify + nettle_ecc_ecdsa_verify_itch + nettle_ecdsa_sign + nettle_ecc_ecdsa_sign + nettle_ecc_ecdsa_sign_itch + nettle_ecc_point_mul_g + nettle_ecc_point_mul + nettle_ecc_scalar_clear + nettle_ecc_scalar_get + nettle_ecc_scalar_init + nettle_ecc_scalar_set + nettle_ecc_point_clear + nettle_ecc_point_get + nettle_ecc_point_init + nettle_ecc_point_set + _nettle_ecc_mod_random + nettle_ecc_scalar_random + _nettle_ecc_hash + _nettle_gost_hash + _nettle_ecc_mul_a + _nettle_ecc_mul_g + _nettle_ecc_mul_m + _nettle_ecc_mul_a_eh + _nettle_ecc_mul_g_eh + _nettle_ecc_add_thh + _nettle_ecc_add_th + _nettle_ecc_dup_th + _nettle_ecc_add_ehh + _nettle_ecc_add_eh + _nettle_ecc_dup_eh + _nettle_ecc_eh_to_a + _nettle_ecc_add_jjj + _nettle_ecc_add_jja + _nettle_ecc_dup_jj + _nettle_ecc_a_to_j + _nettle_ecc_j_to_a + nettle_ecc_bit_size + nettle_ecc_size + nettle_ecc_size_a + nettle_ecc_size_j + _nettle_secp_521r1 + nettle_get_secp_521r1 + _nettle_secp_384r1 + nettle_get_secp_384r1 + _nettle_secp_256r1 + nettle_get_secp_256r1 + _nettle_secp_224r1 + nettle_get_secp_224r1 + _nettle_secp_192r1 + nettle_get_secp_192r1 + _nettle_gost_gc512a + nettle_get_gost_gc512a + _nettle_gost_gc256b + nettle_get_gost_gc256b + _nettle_curve448 + _nettle_curve25519 + _nettle_ecc_pm1_redc + _nettle_ecc_pp1_redc + _nettle_ecc_mod_add + _nettle_ecc_mod_addmul_1 + _nettle_ecc_mod_mul + _nettle_ecc_mod_mul_1 + _nettle_ecc_mod_mul_canonical + _nettle_ecc_mod_pow_2k + _nettle_ecc_mod_pow_2k_mul + _nettle_ecc_mod_sqr + _nettle_ecc_mod_sqr_canonical + _nettle_ecc_mod_sub + _nettle_ecc_mod_submul_1 + _nettle_ecc_mod_inv + _nettle_ecc_mod + _nettle_cnd_copy + _nettle_gmp_alloc + _nettle_gmp_alloc_limbs + _nettle_gmp_free + _nettle_gmp_free_limbs + _nettle_mpn_get_base256 + _nettle_mpn_get_base256_le + _nettle_mpn_set_base256 + _nettle_mpn_set_base256_le + _nettle_mpz_limbs_cmp + _nettle_mpz_limbs_copy + _nettle_mpz_limbs_read_n + _nettle_mpz_set_n + _nettle_sec_tabselect + _nettle_sec_sub_1 + _nettle_sec_add_1 + nettle_dsa_openssl_private_key_from_der_iterator + nettle_dsa_params_from_der_iterator + nettle_dsa_public_key_from_der_iterator + nettle_openssl_provate_key_from_der + nettle_rsa_keypair_from_der + nettle_rsa_private_key_from_der_iterator + nettle_rsa_public_key_from_der_iterator + nettle_asn1_der_decode_bitstring + nettle_asn1_der_decode_bitstring_last + nettle_asn1_der_decode_constructed + nettle_asn1_der_decode_constructed_last + nettle_asn1_der_get_bignum + nettle_asn1_der_get_uint32 + nettle_asn1_der_iterator_first + nettle_asn1_der_iterator_next + nettle_rsa_keypair_to_openpgp + nettle_pgp_armor + nettle_pgp_crc24 + nettle_pgp_put_header + nettle_pgp_put_header_length + nettle_pgp_put_length + nettle_pgp_put_mpi + nettle_pgp_put_public_rsa_key + nettle_pgp_put_rsa_sha1_signature + nettle_pgp_put_string + nettle_pgp_put_sub_packet + nettle_pgp_put_uint16 + nettle_pgp_put_uint32 + nettle_pgp_put_userid + nettle_pgp_sub_packet_end + nettle_pgp_sub_packet_start + nettle_dsa_keypair_from_sexp_alist + nettle_dsa_sha1_keypair_from_sexp + nettle_dsa_sha256_keypair_from_sexp + nettle_dsa_signature_from_sexp + nettle_dsa_keypair_to_sexp + nettle_dsa_sha256_verify + nettle_dsa_sha256_verify_digest + nettle_dsa_sha256_sign + nettle_dsa_sha256_sign_digest + nettle_dsa_sha1_verify + nettle_dsa_sha1_verify_digest + nettle_dsa_sha1_sign + nettle_dsa_sha1_sign_digest + _nettle_dsa_hash + nettle_dsa_generate_keypair + nettle_dsa_verify + nettle_dsa_sign + nettle_dsa_generate_params + nettle_dsa_compat_generate_keypair + nettle_dsa_private_key_clear + nettle_dsa_private_key_init + nettle_dsa_public_key_clear + nettle_dsa_public_key_init + nettle_dsa_params_clear + nettle_dsa_params_init + nettle_dsa_signature_clear + nettle_dsa_signature_init + nettle_rsa_keypair_from_sexp + nettle_rsa_keypair_from_sexp_alist + nettle_rsa_keypair_to_sexp + _nettle_rsa_blind + _nettle_rsa_unblind + nettle_rsa_generate_keypair + nettle_rsa_decrypt_tr + nettle_rsa_sec_decrypt + nettle_rsa_decrypt + nettle_rsa_encrypt + nettle_rsa_pss_sha384_verify_digest + nettle_rsa_pss_sha512_verify_digest + nettle_rsa_pss_sha384_sign_digest_tr + nettle_rsa_pss_sha512_sign_digest_tr + nettle_rsa_pss_sha256_verify_digest + nettle_rsa_pss_sha256_sign_digest_tr + nettle_rsa_sha512_verify + nettle_rsa_sha512_verify_digest + nettle_rsa_sha512_sign_digest_tr + nettle_rsa_sha512_sign_tr + nettle_rsa_sha512_sign + nettle_rsa_sha512_sign_digest + nettle_rsa_sha256_verify + nettle_rsa_sha256_verify_digest + nettle_rsa_sha256_sign_digest_tr + nettle_rsa_sha256_sign_tr + nettle_rsa_sha256_sign + nettle_rsa_sha256_sign_digest + nettle_rsa_sha1_verify + nettle_rsa_sha1_verify_digest + nettle_rsa_sha1_sign_digest_tr + nettle_rsa_sha1_sign_tr + nettle_rsa_sha1_sign + nettle_rsa_sha1_sign_digest + nettle_rsa_md5_verify + nettle_rsa_md5_verify_digest + nettle_rsa_md5_sign_digest_tr + nettle_rsa_md5_sign_tr + nettle_rsa_md5_sign + nettle_rsa_md5_sign_digest + nettle_rsa_pkcs1_verify + nettle_rsa_pkcs1_sign_tr + nettle_rsa_pkcs1_sign + _nettle_rsa_sec_compute_root + _nettle_rsa_sec_compute_root_itch + _nettle_rsa_verify + _nettle_rsa_verify_recover + _nettle_rsa_sec_compute_root_tr + nettle_rsa_compute_root_tr + nettle_rsa_compute_root + nettle_rsa_private_key_clear + nettle_rsa_private_key_init + nettle_rsa_private_key_prepare + _nettle_rsa_check_size + nettle_rsa_public_key_clear + nettle_rsa_public_key_init + nettle_rsa_public_key_prepare + nettle_pss_mgf1 + nettle_pss_encode_mgf1 + nettle_pss_verify_mgf1 + nettle_pkcs1_rsa_sha512_encode + nettle_pkcs1_rsa_sha512_encode_digest + nettle_pkcs1_rsa_sha256_encode + nettle_pkcs1_rsa_sha256_encode_digest + nettle_pkcs1_rsa_sha1_encode + nettle_pkcs1_rsa_sha1_encode_digest + nettle_pkcs1_rsa_md5_encode + nettle_pkcs1_rsa_md5_encode_digest + nettle_pkcs1_rsa_digest_encode + _nettle_pkcs1_sec_decrypt + _nettle_pkcs1_sec_decrypt_variable + nettle_pkcs1_decrypt + nettle_pkcs1_encrypt + _nettle_pkcs1_signature_prefix + nettle_mpz_set_sexp + _nettle_generate_pocklington_prime + nettle_random_prime + nettle_mpz_random + nettle_mpz_random_size + nettle_mpz_get_str_256 + nettle_mpz_init_set_str_256_s + nettle_mpz_init_set_str_256_u + nettle_mpz_set_str_256_s + nettle_mpz_set_str_256_u + nettle_mpz_sizeinbase_256_s + nettle_mpz_sizeinbase_256_u + nettle_sexp_transport_format + nettle_sexp_transport_vformat + nettle_sexp_transport_iterator_first + nettle_sexp_format + nettle_sexp_vformat + nettle_sexp_iterator_assoc + nettle_sexp_iterator_check_type + nettle_sexp_iterator_check_types + nettle_sexp_iterator_enter_list + nettle_sexp_iterator_exit_list + nettle_sexp_iterator_first + nettle_sexp_iterator_get_uint32 + nettle_sexp_iterator_next + nettle_sexp_iterator_subexpr diff --git a/ports/nettle/libname-windows.patch b/ports/nettle/libname-windows.patch new file mode 100644 index 00000000000000..6a4e38cf4b4194 --- /dev/null +++ b/ports/nettle/libname-windows.patch @@ -0,0 +1,67 @@ +diff --git a/Makefile.in b/Makefile.in +index b65ff4960..3887d0c8f 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -27,7 +27,7 @@ PRE_CPPFLAGS = -I. + EXTRA_CFLAGS = $(CCPIC) + + # FIXME: Add configuration of LIBEXT? +-LIBTARGETS = @IF_STATIC@ libnettle.a @IF_HOGWEED@ libhogweed.a ++LIBTARGETS = @IF_STATIC@ $(LIBNETTLE_FILE) @IF_HOGWEED@ $(LIBHOGWEED_FILE) + SHLIBTARGETS = @IF_SHARED@ $(LIBNETTLE_FORLINK) @IF_HOGWEED@ $(LIBHOGWEED_FORLINK) + + getopt_SOURCES = getopt.c getopt1.c +@@ -277,13 +277,13 @@ nettle_OBJS = $(nettle_SOURCES:.c=.$(OBJEXT)) \ + hogweed_OBJS = $(hogweed_SOURCES:.c=.$(OBJEXT)) \ + $(OPT_HOGWEED_OBJS) @IF_MINI_GMP@ mini-gmp.$(OBJEXT) + +-libnettle.a: $(nettle_OBJS) ++$(LIBNETTLE_FILE): $(nettle_OBJS) + -rm -f $@ + $(AR) $(ARFLAGS) $@ $(nettle_OBJS) + $(RANLIB) $@ + echo nettle > libnettle.stamp + +-libhogweed.a: $(hogweed_OBJS) ++$(LIBHOGWEED_FILE): $(hogweed_OBJS) + -rm -f $@ + $(AR) $(ARFLAGS) $@ $(hogweed_OBJS) + $(RANLIB) $@ +diff --git a/configure.ac b/configure.ac +index e95f1c825..1d7ef36bb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -662,8 +665,8 @@ case "$host_os" in + # linking to the DLL, is installed into the lib dir. + case "$host_os" in + mingw32*) +- LIBNETTLE_FORLINK='libnettle-$(LIBNETTLE_MAJOR).dll' +- LIBHOGWEED_FORLINK='libhogweed-$(LIBHOGWEED_MAJOR).dll' ++ LIBNETTLE_FORLINK='nettle-$(LIBNETTLE_MAJOR).dll' ++ LIBHOGWEED_FORLINK='hogweed-$(LIBHOGWEED_MAJOR).dll' + ;; + cygwin*) + LIBNETTLE_FORLINK='cygnettle-$(LIBNETTLE_MAJOR).dll' +@@ -684,16 +687,16 @@ case "$host_os" in + W64_ABI=yes + fi + LIBNETTLE_SONAME='' +- LIBNETTLE_FILE='libnettle.dll.a' ++ LIBNETTLE_FILE='nettle.lib' + LIBNETTLE_FILE_SRC='$(LIBNETTLE_FILE)' +- LIBNETTLE_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBNETTLE_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive' ++ LIBNETTLE_LINK='$(CC) $(CPPFLAGS) -Wl,$(LDFLAGS) -Wl,-DLL -Wl,-IMPLIB:$(LIBNETTLE_FILE) -Wl,-DEF:nettle.def' +- LIBNETTLE_LIBS='-Wl,--no-whole-archive $(LIBS)' ++ LIBNETTLE_LIBS='$(LIBS)' + + LIBHOGWEED_SONAME='' +- LIBHOGWEED_FILE='libhogweed.dll.a' ++ LIBHOGWEED_FILE='hogweed.lib' + LIBHOGWEED_FILE_SRC='$(LIBHOGWEED_FILE)' +- LIBHOGWEED_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBHOGWEED_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive' ++ LIBHOGWEED_LINK='$(CC) $(CPPFLAGS) -Wl,$(LDFLAGS) -Wl,-DLL -Wl,-IMPLIB:$(LIBHOGWEED_FILE) -Wl,-DEF:hogweed.def' +- LIBHOGWEED_LIBS='-Wl,--no-whole-archive $(LIBS) libnettle.dll.a' ++ LIBHOGWEED_LIBS='$(LIBS) $(LIBNETTLE_FILE)' + IF_DLL='' + ;; + darwin*) diff --git a/ports/nettle/name.dir.patch b/ports/nettle/name.dir.patch deleted file mode 100644 index ff1ce206afd115..00000000000000 --- a/ports/nettle/name.dir.patch +++ /dev/null @@ -1,381 +0,0 @@ -diff --git a/SMP/libhogweed.vcxproj b/SMP/libhogweed.vcxproj -index 976d9fc..5fd42ba 100644 ---- a/SMP/libhogweed.vcxproj -+++ b/SMP/libhogweed.vcxproj -@@ -18,7 +18,7 @@ - 4146;4267;4028;4244;%(DisableSpecificWarnings) - - -- libnettled.lib;%(AdditionalDependencies) -+ nettled.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -132,7 +132,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4146;4267;4028;4244;%(DisableSpecificWarnings) - - -- libnettled.lib;%(AdditionalDependencies) -+ nettled.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -476,7 +476,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4146;4267;4028;4244;%(DisableSpecificWarnings) - - -- libnettle.lib;%(AdditionalDependencies) -+ nettle.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -590,7 +590,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4146;4267;4028;4244;%(DisableSpecificWarnings) - - -- libnettle.lib;%(AdditionalDependencies) -+ nettle.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -820,7 +820,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- libnettle.lib;%(AdditionalDependencies) -+ nettle.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -1050,7 +1050,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- libnettle.lib;%(AdditionalDependencies) -+ nettle.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -diff --git a/SMP/libhogweed_winrt.vcxproj b/SMP/libhogweed_winrt.vcxproj -index 308bd0b..a436c69 100644 ---- a/SMP/libhogweed_winrt.vcxproj -+++ b/SMP/libhogweed_winrt.vcxproj -@@ -18,7 +18,7 @@ - 4146;4267;4028;4244;%(DisableSpecificWarnings) - - -- libnettled_winrt.lib;%(AdditionalDependencies) -+ nettled.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -132,7 +132,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4146;4267;4028;4244;%(DisableSpecificWarnings) - - -- libnettled_winrt.lib;%(AdditionalDependencies) -+ nettled.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -247,7 +247,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- nettled_winrt.lib;gmp.lib;%(AdditionalDependencies) -+ nettled.lib;gmp.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -362,7 +362,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- nettled_winrt.lib;gmp.lib;%(AdditionalDependencies) -+ nettled.lib;gmp.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -476,7 +476,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4146;4267;4028;4244;%(DisableSpecificWarnings) - - -- libnettle_winrt.lib;%(AdditionalDependencies) -+ nettle.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -590,7 +590,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - 4146;4267;4028;4244;%(DisableSpecificWarnings) - - -- libnettle_winrt.lib;%(AdditionalDependencies) -+ nettle.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -705,7 +705,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- nettle_winrt.lib;gmp.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -820,7 +820,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- libnettle_winrt.lib;%(AdditionalDependencies) -+ nettle.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -935,7 +935,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- nettle_winrt.lib;gmp.lib;%(AdditionalDependencies) -+ nettle.lib;gmp.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -1050,7 +1050,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- libnettle_winrt.lib;%(AdditionalDependencies) -+ nettle.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -diff --git a/SMP/smp_deps.props b/SMP/smp_deps.props -index 487099d..1eade47 100644 ---- a/SMP/smp_deps.props -+++ b/SMP/smp_deps.props -@@ -104,16 +104,16 @@ - - - -- lib$(RootNamespace)d -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace)d -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- lib$(RootNamespace)d -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace)d -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -121,7 +121,7 @@ - - - $(RootNamespace)d -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -129,23 +129,23 @@ - - - $(RootNamespace)d -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- lib$(RootNamespace) -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace) -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- lib$(RootNamespace) -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace) -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -153,7 +153,7 @@ - - - $(RootNamespace) -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -161,7 +161,7 @@ - - - $(RootNamespace) -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -169,7 +169,7 @@ - - - $(RootNamespace) -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -@@ -177,7 +177,7 @@ - - - $(RootNamespace) -- $(ProjectDir)..\..\..\msvc\ -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -diff --git a/SMP/smp_winrt_deps.props b/SMP/smp_winrt_deps.props -index d44408a..b44482c 100644 ---- a/SMP/smp_winrt_deps.props -+++ b/SMP/smp_winrt_deps.props -@@ -115,80 +115,80 @@ - - - -- lib$(RootNamespace)d_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace)d -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- lib$(RootNamespace)d_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace)d -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- $(RootNamespace)d_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace)d -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- $(RootNamespace)d_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace)d -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- lib$(RootNamespace)_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace) -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- lib$(RootNamespace)_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace) -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- $(RootNamespace)_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace) -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- $(RootNamespace)_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace) -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- $(RootNamespace)_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace) -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean - MSB8012 - - -- $(RootNamespace)_winrt -- $(ProjectDir)..\..\..\msvc\ -+ $(RootNamespace) -+ $(ProjectDir)..\msvc\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\ - $(ProjectDir)obj\Generated - Clean -diff --git a/hogweed.pc.in b/hogweed.pc.in -index 97fb9d4..ce977c0 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 eb0020c..6e3ed1e 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/nettle-x64.def b/ports/nettle/nettle-x64.def new file mode 100644 index 00000000000000..e202f46fb5fc57 --- /dev/null +++ b/ports/nettle/nettle-x64.def @@ -0,0 +1,509 @@ +EXPORTS + _nettle_sha256_compress_sha_ni + _nettle_sha1_compress_sha_ni + _nettle_salsa20_2core + _nettle_memxor_sse2 + _nettle_aes_decrypt_aesni + _nettle_aes_encrypt_aesni + _nettle_cpuid + _nettle_gcm_hash8 + _nettle_aes_decrypt + _nettle_aes_encrypt + _nettle_sha256_compress + nettle_memxor + nettle_sha1_compress + nettle_xts_aes256_decrypt_message + nettle_xts_aes256_encrypt_message + nettle_xts_aes256_set_decrypt_key + nettle_xts_aes256_set_encrypt_key + nettle_xts_aes128_decrypt_message + nettle_xts_aes128_encrypt_message + nettle_xts_aes128_set_decrypt_key + nettle_xts_aes128_set_encrypt_key + nettle_xts_decrypt_message + nettle_xts_encrypt_message + nettle_yarrow_key_event_estimate + nettle_yarrow_key_event_init + nettle_yarrow256_fast_reseed + nettle_yarrow256_init + nettle_yarrow256_is_seeded + nettle_yarrow256_needed_sources + nettle_yarrow256_random + nettle_yarrow256_seed + nettle_yarrow256_slow_reseed + nettle_yarrow256_update + _nettle_write_le64 + _nettle_write_le32 + _nettle_write_be32 + nettle_version_major + nettle_version_minor + nettle_umac128_digest + nettle_umac128_set_key + nettle_umac128_set_nonce + nettle_umac128_update + nettle_umac96_digest + nettle_umac96_set_key + nettle_umac96_set_nonce + nettle_umac96_update + nettle_umac64_digest + nettle_umac64_set_key + nettle_umac64_set_nonce + nettle_umac64_update + nettle_umac32_digest + nettle_umac32_set_key + nettle_umac32_set_nonce + nettle_umac32_update + _nettle_umac_set_key + _nettle_umac_poly128 + _nettle_umac_poly64 + _nettle_umac_l3 + _nettle_umac_l3_init + _nettle_umac_l2 + _nettle_umac_l2_final + _nettle_umac_l2_init + _nettle_umac_nh_n + _nettle_umac_nh + nettle_twofish128 + nettle_twofish192 + nettle_twofish256 + nettle_twofish128_set_key + nettle_twofish192_set_key + nettle_twofish256_set_key + nettle_twofish_decrypt + nettle_twofish_encrypt + nettle_twofish_set_key + nettle_streebog256 + nettle_streebog512 + nettle_streebog256_digest + nettle_streebog256_init + nettle_streebog512_digest + nettle_streebog512_init + nettle_streebog512_update + nettle_serpent128 + nettle_serpent192 + nettle_serpent256 + nettle_serpent_decrypt + nettle_serpent_encrypt + nettle_serpent128_set_key + nettle_serpent192_set_key + nettle_serpent256_set_key + nettle_serpent_set_key + nettle_sha3_256_shake + nettle_sha3_512 + nettle_sha3_512_digest + nettle_sha3_512_init + nettle_sha3_512_update + nettle_sha3_384 + nettle_sha3_384_digest + nettle_sha3_384_init + nettle_sha3_384_update + nettle_sha3_256 + nettle_sha3_256_digest + nettle_sha3_256_init + nettle_sha3_256_update + nettle_sha3_224 + nettle_sha3_224_digest + nettle_sha3_224_init + nettle_sha3_224_update + nettle_sha3_permute + _nettle_sha3_pad + _nettle_sha3_update + nettle_sha512_256 + nettle_sha512_224 + nettle_sha512 + nettle_sha384 + _nettle_sha512_compress + nettle_sha384_digest + nettle_sha384_init + nettle_sha512_224_digest + nettle_sha512_224_init + nettle_sha512_256_digest + nettle_sha512_256_init + nettle_sha512_digest + nettle_sha512_init + nettle_sha512_update + nettle_sha256 + nettle_sha224 + _nettle_sha256_compress_x86_64 + nettle_sha224_digest + nettle_sha224_init + nettle_sha256_digest + nettle_sha256_init + nettle_sha256_update + nettle_sha1 + _nettle_sha1_compress_x86_64 + nettle_sha1_digest + nettle_sha1_init + nettle_sha1_update + nettle_salsa20_256_set_key + nettle_salsa20_128_set_key + nettle_salsa20_set_nonce + nettle_salsa20_set_key + nettle_salsa20r12_crypt + nettle_salsa20_crypt + _nettle_salsa20_crypt + _nettle_salsa20_core + nettle_ripemd160 + _nettle_ripemd160_compress + nettle_ripemd160_digest + nettle_ripemd160_init + nettle_ripemd160_update + nettle_realloc + nettle_xrealloc + _nettle_poly1305_block + _nettle_poly1305_digest + _nettle_poly1305_set_key + nettle_poly1305_aes_digest + nettle_poly1305_aes_set_key + nettle_poly1305_aes_set_nonce + nettle_poly1305_aes_update + nettle_pbkdf2_hmac_sha512 + nettle_pbkdf2_hmac_sha384 + nettle_pbkdf2_hmac_sha256 + nettle_pbkdf2_hmac_sha1 + nettle_pbkdf2_hmac_gosthash94cp + nettle_pbkdf2 + _nettle_macs + nettle_get_macs + _nettle_hashes + nettle_get_hashes + _nettle_ciphers + nettle_get_ciphers + _nettle_armors + nettle_get_armors + _nettle_aeads + nettle_get_aeads + nettle_lookup_hash + nettle_memxor3 + _nettle_memxor_x86_64 + nettle_memeql_sec + nettle_md5 + nettle_MD5Final + nettle_MD5Init + nettle_MD5Update + nettle_md5_compress + nettle_md5_digest + nettle_md5_init + nettle_md5_update + nettle_md4 + nettle_md4_digest + nettle_md4_init + nettle_md4_update + nettle_md2 + nettle_md2_digest + nettle_md2_init + nettle_md2_update + nettle_hkdf_expand + nettle_hkdf_extract + nettle_knuth_lfib_get + nettle_knuth_lfib_get_array + nettle_knuth_lfib_init + nettle_knuth_lfib_random + nettle_hmac_streebog256 + nettle_hmac_streebog512 + nettle_hmac_sha512 + nettle_hmac_sha384 + nettle_hmac_sha256 + nettle_hmac_sha224 + nettle_hmac_sha1 + nettle_hmac_ripemd160 + nettle_hmac_md5 + nettle_hmac_streebog256_digest + nettle_hmac_streebog256_set_key + nettle_hmac_streebog512_digest + nettle_hmac_streebog512_set_key + nettle_hmac_streebog512_update + nettle_hmac_sha512_digest + nettle_hmac_sha512_set_key + nettle_hmac_sha512_update + nettle_hmac_sha384_digest + nettle_hmac_sha384_set_key + nettle_hmac_sha256_digest + nettle_hmac_sha256_set_key + nettle_hmac_sha256_update + nettle_hmac_sha224_digest + nettle_hmac_sha224_set_key + nettle_hmac_sha1_digest + nettle_hmac_sha1_set_key + nettle_hmac_sha1_update + nettle_hmac_ripemd160_digest + nettle_hmac_ripemd160_set_key + nettle_hmac_ripemd160_update + nettle_hmac_md5_digest + nettle_hmac_md5_set_key + nettle_hmac_md5_update + nettle_hmac_gosthash94_digest + nettle_hmac_gosthash94_set_key + nettle_hmac_gosthash94_update + nettle_hmac_gosthash94cp_digest + nettle_hmac_gosthash94cp_set_key + nettle_hmac_gosthash94cp_update + nettle_hmac_digest + nettle_hmac_set_key + nettle_hmac_update + nettle_gosthash94 + nettle_gosthash94cp + nettle_gosthash94_digest + nettle_gosthash94_init + nettle_gosthash94_update + nettle_gosthash94cp_digest + nettle_gosthash94cp_update + _nettle_gost28147_encrypt_block + _nettle_gost28147_param_CryptoPro_3411 + _nettle_gost28147_param_test_3411 + nettle_cmac_des3 + nettle_cmac_aes256 + nettle_cmac_aes128 + nettle_cmac_des3_digest + nettle_cmac_des3_set_key + nettle_cmac_des3_update + nettle_cmac_aes256_digest + nettle_cmac_aes256_set_key + nettle_cmac_aes256_update + nettle_cmac_aes128_digest + nettle_cmac_aes128_set_key + nettle_cmac_aes128_update + nettle_cmac64_digest + nettle_cmac64_init + nettle_cmac64_set_key + nettle_cmac64_update + nettle_cmac128_digest + nettle_cmac128_init + nettle_cmac128_set_key + nettle_cmac128_update + nettle_gcm_camellia256 + nettle_gcm_camellia256_decrypt + nettle_gcm_camellia256_digest + nettle_gcm_camellia256_encrypt + nettle_gcm_camellia256_set_iv + nettle_gcm_camellia256_set_key + nettle_gcm_camellia256_update + nettle_gcm_camellia128 + nettle_gcm_camellia128_decrypt + nettle_gcm_camellia128_digest + nettle_gcm_camellia128_encrypt + nettle_gcm_camellia128_set_iv + nettle_gcm_camellia128_set_key + nettle_gcm_camellia128_update + nettle_gcm_aes256 + nettle_gcm_aes256_decrypt + nettle_gcm_aes256_digest + nettle_gcm_aes256_encrypt + nettle_gcm_aes256_set_iv + nettle_gcm_aes256_set_key + nettle_gcm_aes256_update + nettle_gcm_aes192 + nettle_gcm_aes192_decrypt + nettle_gcm_aes192_digest + nettle_gcm_aes192_encrypt + nettle_gcm_aes192_set_iv + nettle_gcm_aes192_set_key + nettle_gcm_aes192_update + nettle_gcm_aes128 + nettle_gcm_aes128_decrypt + nettle_gcm_aes128_digest + nettle_gcm_aes128_encrypt + nettle_gcm_aes128_set_iv + nettle_gcm_aes128_set_key + nettle_gcm_aes128_update + nettle_gcm_aes_decrypt + nettle_gcm_aes_digest + nettle_gcm_aes_encrypt + nettle_gcm_aes_set_iv + nettle_gcm_aes_set_key + nettle_gcm_aes_update + nettle_gcm_decrypt + nettle_gcm_digest + nettle_gcm_encrypt + nettle_gcm_set_iv + nettle_gcm_set_key + nettle_gcm_update + nettle_eax_aes128 + nettle_eax_aes128_decrypt + nettle_eax_aes128_digest + nettle_eax_aes128_encrypt + nettle_eax_aes128_set_key + nettle_eax_aes128_set_nonce + nettle_eax_aes128_update + nettle_eax_decrypt + nettle_eax_digest + nettle_eax_encrypt + nettle_eax_set_key + nettle_eax_set_nonce + nettle_eax_update + nettle_des3_decrypt + nettle_des3_encrypt + nettle_des3_set_key + nettle_des_check_parity + nettle_des_decrypt + nettle_des_encrypt + nettle_des_fix_parity + nettle_des_set_key + _nettle_ctr_crypt16 + nettle_ctr_crypt + nettle_chacha_set_counter + nettle_chacha_set_counter32 + nettle_chacha_set_nonce + nettle_chacha_set_nonce96 + nettle_chacha_set_key + nettle_chacha_poly1305 + nettle_chacha_poly1305_decrypt + nettle_chacha_poly1305_digest + nettle_chacha_poly1305_encrypt + nettle_chacha_poly1305_set_key + nettle_chacha_poly1305_set_nonce + nettle_chacha_poly1305_update + _nettle_chacha_core + nettle_chacha_crypt + nettle_chacha_crypt32 + nettle_cnd_memcpy + nettle_siv_cmac_aes256_decrypt_message + nettle_siv_cmac_aes256_encrypt_message + nettle_siv_cmac_aes256_set_key + nettle_siv_cmac_aes128_decrypt_message + nettle_siv_cmac_aes128_encrypt_message + nettle_siv_cmac_aes128_set_key + nettle_siv_cmac_decrypt_message + nettle_siv_cmac_encrypt_message + nettle_siv_cmac_set_key + nettle_cfb8_decrypt + nettle_cfb8_encrypt + nettle_cfb_decrypt + nettle_cfb_encrypt + nettle_ccm_aes256_decrypt + nettle_ccm_aes256_decrypt_message + nettle_ccm_aes256_digest + nettle_ccm_aes256_encrypt + nettle_ccm_aes256_encrypt_message + nettle_ccm_aes256_set_key + nettle_ccm_aes256_set_nonce + nettle_ccm_aes256_update + nettle_ccm_aes192_decrypt + nettle_ccm_aes192_decrypt_message + nettle_ccm_aes192_digest + nettle_ccm_aes192_encrypt + nettle_ccm_aes192_encrypt_message + nettle_ccm_aes192_set_key + nettle_ccm_aes192_set_nonce + nettle_ccm_aes192_update + nettle_ccm_aes128_decrypt + nettle_ccm_aes128_decrypt_message + nettle_ccm_aes128_digest + nettle_ccm_aes128_encrypt + nettle_ccm_aes128_encrypt_message + nettle_ccm_aes128_set_key + nettle_ccm_aes128_set_nonce + nettle_ccm_aes128_update + nettle_ccm_decrypt + nettle_ccm_decrypt_message + nettle_ccm_digest + nettle_ccm_encrypt + nettle_ccm_encrypt_message + nettle_ccm_set_nonce + nettle_ccm_update + nettle_cbc_decrypt + nettle_cbc_encrypt + nettle_cast128 + nettle_cast128_decrypt + nettle_cast128_encrypt + nettle_cast128_set_key + nettle_cast5_set_key + nettle_camellia256 + nettle_camellia192_set_decrypt_key + nettle_camellia256_invert_key + nettle_camellia256_set_decrypt_key + nettle_camellia256_crypt + nettle_camellia192_set_encrypt_key + nettle_camellia256_set_encrypt_key + nettle_camellia192 + nettle_camellia128 + nettle_camellia128_invert_key + nettle_camellia_set_decrypt_key + nettle_camellia128_crypt + nettle_camellia128_set_encrypt_key + _nettle_camellia_invert_key + _nettle_camellia_absorb + _nettle_camellia_table + _nettle_camellia_crypt + nettle_buffer_init + nettle_buffer_clear + nettle_buffer_copy + nettle_buffer_grow + nettle_buffer_init_realloc + nettle_buffer_init_size + nettle_buffer_reset + nettle_buffer_space + nettle_buffer_write + nettle_base64url + nettle_base64url_decode_init + nettle_base64url_encode_init + nettle_base64 + nettle_base64_decode_final + nettle_base64_decode_init + nettle_base64_decode_single + nettle_base64_decode_update + nettle_base64_encode_final + nettle_base64_encode_group + nettle_base64_encode_init + nettle_base64_encode_raw + nettle_base64_encode_single + nettle_base64_encode_update + nettle_base16 + nettle_base16_decode_final + nettle_base16_decode_init + nettle_base16_decode_single + nettle_base16_decode_update + nettle_base16_encode_single + nettle_base16_encode_update + nettle_blowfish_bcrypt_hash + nettle_blowfish_bcrypt_verify + _nettle_blowfish_encround + _nettle_blowfish_initial_ctx + nettle_blowfish128_set_key + nettle_blowfish_decrypt + nettle_blowfish_encrypt + nettle_blowfish_set_key + nettle_arctwo128 + nettle_arctwo40 + nettle_arctwo64 + nettle_arctwo_gutmann128 + nettle_arctwo128_set_key + nettle_arctwo128_set_key_gutmann + nettle_arctwo40_set_key + nettle_arctwo64_set_key + nettle_arctwo_decrypt + nettle_arctwo_encrypt + nettle_arctwo_set_key + nettle_arctwo_set_key_ekb + nettle_arctwo_set_key_gutmann + nettle_arcfour_crypt + nettle_arcfour128_set_key + nettle_arcfour_set_key + nettle_aes256 + nettle_aes256_invert_key + nettle_aes256_set_decrypt_key + nettle_aes256_set_encrypt_key + nettle_aes192 + nettle_aes192_invert_key + nettle_aes192_set_decrypt_key + nettle_aes192_set_encrypt_key + nettle_aes128 + nettle_aes128_invert_key + nettle_aes128_set_decrypt_key + nettle_aes128_set_encrypt_key + nettle_aes_invert_key + nettle_aes_set_decrypt_key + nettle_aes_set_encrypt_key + _nettle_aes_set_key + _nettle_aes_invert + _nettle_aes_encrypt_table + nettle_aes128_encrypt + nettle_aes192_encrypt + nettle_aes256_encrypt + nettle_aes_encrypt + _nettle_aes_encrypt_x86_64 + nettle_aes128_decrypt + nettle_aes192_decrypt + nettle_aes256_decrypt + nettle_aes_decrypt + _nettle_aes_decrypt_x86_64 diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index 5f0fba4f24163d..bd21dc7769ac96 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -1,137 +1,98 @@ -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO ShiftMediaProject/nettle - REF bf483378326c67d634977287dd576279734b7acc #v3.6 - SHA512 ba125a27c81a800be8bc8d1b0d4f3125587330ef64d8a605b4d3ae211fb675c5ef89e9bf4bcf63b07d0f004c6c5ff851630690cdd1eda6b5b8a526d84edffe73 - HEAD_REF master - PATCHES - gmp.patch - name.dir.patch - runtime.patch - remove_gmpd.patch - ) - - include(${CURRENT_INSTALLED_DIR}/share/yasm-tool-helper/yasm-tool-helper.cmake) - yasm_tool_helper(OUT_VAR YASM) - file(TO_NATIVE_PATH "${YASM}" YASM) +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + set(patches yasm.patch # the asm changes are a downgrade to an older version + compile.patch + libname-windows.patch # Apply common libtool rules for lib naming. + ) +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() +vcpkg_from_gitlab( + GITLAB_URL https://git.lysator.liu.se/ + OUT_SOURCE_PATH SOURCE_PATH + REPO nettle/nettle + REF 52bacacaf4339fd78289f58919732f1f35bea1c1 #v3.7.3 + SHA512 0130d14195274eeec11e8299793e3037f4b84d8fb4b5c5c9392b63ee693ed5713434070744b1a44e14a6a5090d655917c1dd296e2011cd99e3c316ef5d8ee395 + HEAD_REF master + PATCHES + fix-InstallLibPath.patch + flags.patch + ${patches} +) - if(VCPKG_TARGET_IS_UWP) - string(APPEND CONFIGURATION_RELEASE WinRT) - string(APPEND CONFIGURATION_DEBUG WinRT) - endif() +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(OPTIONS --disable-static) +else() + set(OPTIONS --disable-shared) +endif() - #Setup YASM integration - set(_nettleproject) - set(_hogweedproject) - if(VCPKG_TARGET_IS_UWP) - set(_nettleproject "${SOURCE_PATH}/SMP/libnettle_winrt.vcxproj") - set(_hogweedproject "${SOURCE_PATH}/SMP/libhogweed_winrt.vcxproj") - else() - set(_nettleproject "${SOURCE_PATH}/SMP/libnettle.vcxproj") - set(_hogweedproject "${SOURCE_PATH}/SMP/libhogweed.vcxproj") +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + set(ENV{CCAS} "${CURRENT_HOST_INSTALLED_DIR}/tools/yasm/yasm${VCPKG_HOST_EXECUTABLE_SUFFIX}") + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(asmflag win64) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(asmflag win32) endif() + set(ENV{ASMFLAGS} "-Xvc -f ${asmflag} -pgas -rraw") + list(APPEND OPTIONS ac_cv_func_memset=yes + "nettle_cv_asm_type_percent_function=no" + "nettle_cv_asm_align_log=no" + ) +endif() - file(READ "${_nettleproject}" _contents) - string(REPLACE [[]] - "" - _contents "${_contents}") - string(REPLACE [[]] - "" - _contents "${_contents}") - string(REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_INSTALLED_DIR}/share" _contents "${_contents}") # Above already - file(WRITE "${_nettleproject}" "${_contents}") - - file(READ "${_hogweedproject}" _contents) - string(REPLACE [[]] - "" - _contents "${_contents}") - string(REPLACE [[]] - "" - _contents "${_contents}") - string(REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_INSTALLED_DIR}/share" _contents "${_contents}") # Above already - file(WRITE "${_hogweedproject}" "${_contents}") +if(VCPKG_CROSSCOMPILING) + # Silly trick to make configure accept CC_FOR_BUILD but in reallity CC_FOR_BUILD is deactivated. + set(ENV{CC_FOR_BUILD} "touch a.out | touch conftest${VCPKG_HOST_EXECUTABLE_SUFFIX} | true") +endif() - vcpkg_install_msbuild( - USE_VCPKG_INTEGRATION - SOURCE_PATH ${SOURCE_PATH} - PROJECT_SUBPATH SMP/libnettle.sln - PLATFORM ${TRIPLET_SYSTEM_ARCH} - LICENSE_SUBPATH COPYING.LESSERv3 - TARGET Rebuild - RELEASE_CONFIGURATION ${CONFIGURATION_RELEASE} - DEBUG_CONFIGURATION ${CONFIGURATION_DEBUG} - SKIP_CLEAN - OPTIONS "/p:YasmPath=${YASM}" - ) +vcpkg_configure_make( + SOURCE_PATH ${SOURCE_PATH} + AUTOCONFIG + OPTIONS + --disable-documentation + --disable-openssl + ${OPTIONS} +) - 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.6) - 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 -lgmp") - 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_from_gitlab( - GITLAB_URL https://git.lysator.liu.se/ - OUT_SOURCE_PATH SOURCE_PATH - REPO nettle/nettle - REF 9e2bea82b9fb606bffd2d3f648e05248e146e54f #v3.6 - SHA512 008089eba2ef197a0ec6a266baac485e72051e646d19861f3fb605915a591bc2dd38edcb4ea7eaad958ea5d56f7744d42c25b691b49921a1285edd22f9c90b7f - HEAD_REF master - PATCHES - fix-InstallLibPath.patch - flags.patch - ) +set(tool_names des ecc ) # aes gcm sha twofish ? +list(TRANSFORM tool_names APPEND "data") +list(TRANSFORM tool_names APPEND "${VCPKG_HOST_EXECUTABLE_SUFFIX}") +if(VCPKG_CROSSCOMPILING) + list(TRANSFORM tool_names PREPEND "${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}/") + foreach() + endforeach() + file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/" ) + if(NOT VCPKG_BUILD_TYPE) + file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/" ) + endif() +endif() +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(OPTIONS --disable-static) - else() - set(OPTIONS --disable-shared) + # def files are created by running 'llvm-nm | findstr /R /C:"[RT] _*nettle_"' on the static build and replacing '00[0-9abcdef]+ [RT]' with spaces + # please update the defs if the version is bumped + set(build_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/") + configure_file("${CURRENT_PORT_DIR}/nettle-${VCPKG_TARGET_ARCHITECTURE}.def" "${build_dir}/nettle.def" COPYONLY) + configure_file("${CURRENT_PORT_DIR}/hogweed-${VCPKG_TARGET_ARCHITECTURE}.def" "${build_dir}/hogweed.def" COPYONLY) + if(NOT VCPKG_BUILD_TYPE) + set(build_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/") + configure_file("${CURRENT_PORT_DIR}/nettle-${VCPKG_TARGET_ARCHITECTURE}.def" "${build_dir}/nettle.def" COPYONLY) + configure_file("${CURRENT_PORT_DIR}/hogweed-${VCPKG_TARGET_ARCHITECTURE}.def" "${build_dir}/hogweed.def" COPYONLY) + endif() endif() +endif() +vcpkg_install_make() - vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} - AUTOCONFIG - OPTIONS - --disable-documentation - --disable-openssl - ${OPTIONS} - ) +if(NOT VCPKG_CROSSCOMPILING) + list(TRANSFORM tool_names PREPEND "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/") + file(COPY ${tool_names} DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}" ) +endif() - vcpkg_install_make() - vcpkg_fixup_pkgconfig() - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +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) +# # Handle copyright +file(INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_IS_LINUX) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") - endif() +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_IS_LINUX) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") endif() diff --git a/ports/nettle/remove_gmpd.patch b/ports/nettle/remove_gmpd.patch deleted file mode 100644 index a248d81e2422c1..00000000000000 --- a/ports/nettle/remove_gmpd.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/SMP/libnettle.vcxproj b/SMP/libnettle.vcxproj -index 51fa24113..5d418b53e 100644 ---- a/SMP/libnettle.vcxproj -+++ b/SMP/libnettle.vcxproj -@@ -245,7 +245,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libnettle.def -- gmpd.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -@@ -359,7 +359,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libnettle.def -- gmpd.lib;%(AdditionalDependencies) -+ gmp.lib;%(AdditionalDependencies) - - - mkdir "$(OutDir)"\include -diff --git a/SMP/libhogweed.vcxproj b/SMP/libhogweed.vcxproj -index 8f2f433bc..dae3458d8 100644 ---- a/SMP/libhogweed.vcxproj -+++ b/SMP/libhogweed.vcxproj -@@ -247,7 +247,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- nettled.lib;gmpd.lib;%(AdditionalDependencies) -+ nettled.lib;gmp.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - -@@ -362,7 +362,7 @@ del /f /q $(OutDir)\licenses\nettle.txt - - - libhogweed.def -- nettled.lib;gmpd.lib;%(AdditionalDependencies) -+ nettled.lib;gmp.lib;%(AdditionalDependencies) - /IGNORE:4006,4221,4078 %(AdditionalOptions) - - diff --git a/ports/nettle/runtime.patch b/ports/nettle/runtime.patch deleted file mode 100644 index 3c232d882a7e06..00000000000000 --- a/ports/nettle/runtime.patch +++ /dev/null @@ -1,168 +0,0 @@ -diff --git a/SMP/smp_deps.props b/SMP/smp_deps.props -index 1eade47..ab279f4 100644 ---- a/SMP/smp_deps.props -+++ b/SMP/smp_deps.props -@@ -193,6 +193,7 @@ - $(OutDir)\lib\x86\$(TargetName).pdb - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebug - - - $(OutDir)\lib\x86\$(TargetName)$(TargetExt) -@@ -211,6 +212,7 @@ - $(OutDir)\lib\x64\$(TargetName).pdb - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebug - - - $(OutDir)\lib\x64\$(TargetName)$(TargetExt) -@@ -230,6 +232,7 @@ - $(IntDir)$(TargetName).pdb - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebugDLL - - - $(OutDir)\bin\x86\$(TargetName)$(TargetExt) -@@ -253,6 +256,7 @@ - $(IntDir)$(TargetName).pdb - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebugDLL - - - $(OutDir)\bin\x64\$(TargetName)$(TargetExt) -@@ -282,6 +286,7 @@ - SingleFile - $(OutDir)\lib\x86\$(TargetName).pdb - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreaded - - - $(OutDir)\lib\x86\$(TargetName)$(TargetExt) -@@ -307,6 +312,7 @@ - SingleFile - $(OutDir)\lib\x64\$(TargetName).pdb - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreaded - - - $(OutDir)\lib\x64\$(TargetName)$(TargetExt) -@@ -331,6 +337,7 @@ - $(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories) - $(IntDir)$(TargetName).pdb - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDLL - - - true -@@ -362,6 +369,7 @@ - $(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories) - $(IntDir)$(TargetName).pdb - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDLL - - - true -@@ -392,6 +400,7 @@ - $(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories) - $(IntDir)$(TargetName).pdb - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDLL - - - true -@@ -423,6 +432,7 @@ - $(OutDir)\include;$(ProjectDir)\..\..\prebuilt\include;%(AdditionalIncludeDirectories) - $(IntDir)$(TargetName).pdb - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDLL - - - true -diff --git a/SMP/smp_winrt_deps.props b/SMP/smp_winrt_deps.props -index b44482c..35ae231 100644 ---- a/SMP/smp_winrt_deps.props -+++ b/SMP/smp_winrt_deps.props -@@ -206,6 +206,7 @@ - NotUsing - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebug - - - $(OutDir)\lib\x86\$(TargetName)$(TargetExt) -@@ -226,6 +227,7 @@ - NotUsing - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebug - - - $(OutDir)\lib\x64\$(TargetName)$(TargetExt) -@@ -247,6 +249,7 @@ - NotUsing - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebugDLL - - - $(OutDir)\bin\x86\$(TargetName)$(TargetExt) -@@ -274,6 +277,7 @@ - NotUsing - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDebugDLL - - - $(OutDir)\bin\x64\$(TargetName)$(TargetExt) -@@ -307,6 +311,7 @@ - NotUsing - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreaded - - - $(OutDir)\lib\x86\$(TargetName)$(TargetExt) -@@ -335,6 +340,7 @@ - NotUsing - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreaded - - - $(OutDir)\lib\x64\$(TargetName)$(TargetExt) -@@ -361,6 +367,7 @@ - NotUsing - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDLL - - - true -@@ -396,6 +403,7 @@ - NotUsing - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDLL - - - true -@@ -430,6 +438,7 @@ - NotUsing - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDLL - - - true -@@ -465,6 +474,7 @@ - NotUsing - false - 4113;%(TreatSpecificWarningsAsErrors) -+ MultiThreadedDLL - - - true diff --git a/ports/nettle/vcpkg.json b/ports/nettle/vcpkg.json index 87833d1211cc79..95cea806411a65 100644 --- a/ports/nettle/vcpkg.json +++ b/ports/nettle/vcpkg.json @@ -1,18 +1,21 @@ { "name": "nettle", - "version": "3.6", - "port-version": 2, + "version": "3.7.3", "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.", "homepage": "https://git.lysator.liu.se/nettle/nettle", "dependencies": [ "gmp", { - "name": "vs-yasm", + "name": "yasm", + "host": true, + "features": [ + "tools" + ], "platform": "windows" }, - { - "name": "yasm-tool-helper", - "platform": "windows" + { + "name": "nettle", + "host": true } ] } diff --git a/ports/nettle/yasm.patch b/ports/nettle/yasm.patch new file mode 100644 index 00000000000000..4fa449f32f4220 --- /dev/null +++ b/ports/nettle/yasm.patch @@ -0,0 +1,96 @@ +diff --git a/Makefile.in b/Makefile.in +index b65ff4960..3887d0c8f 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -291,7 +291,7 @@ libhogweed.a: $(hogweed_OBJS) + + %.$(OBJEXT): %.asm $(srcdir)/m4-utils.m4 $(srcdir)/asm.m4 config.m4 machine.m4 + $(M4) $(srcdir)/m4-utils.m4 $(srcdir)/asm.m4 config.m4 machine.m4 $< >$*.s +- $(COMPILE) -c $*.s ++ $(COMPILE_AS) -o $*.$(OBJEXT) $*.s + + %.$(OBJEXT): %.c + $(COMPILE) -c $< \ +diff --git a/config.make.in b/config.make.in +index f8e1f74ef..3ae593385 100644 +--- a/config.make.in ++++ b/config.make.in +@@ -73,6 +73,7 @@ TEST_SHLIB_DIR = ${abs_top_builddir}/.lib + # flags before CPPFLAGS and LDFLAGS. While EXTRA_CFLAGS are added at the end. + + COMPILE = $(CC) $(PRE_CPPFLAGS) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(DEP_FLAGS) ++COMPILE_AS = $(CCAS) $(PRE_CPPFLAGS) $(CPPFLAGS) $(DEFS) $(ASMFLAGS) $(DEP_FLAGS) + COMPILE_CXX = $(CXX) $(PRE_CPPFLAGS) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DEP_FLAGS) + LINK = $(CC) $(CFLAGS) $(PRE_LDFLAGS) $(LDFLAGS) + LINK_CXX = $(CXX) $(CXXFLAGS) $(PRE_LDFLAGS) $(LDFLAGS) +diff --git a/configure.ac b/configure.ac +index e95f1c825..1d7ef36bb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -118,6 +118,9 @@ LSH_RPATH_INIT([`echo $with_lib_path | sed 's/:/ /g'` \ + + # Checks for programs. + AC_PROG_CC ++# Copied from gmp ++test -n "$CCAS" || CCAS="$CC -c" ++AC_SUBST(CCAS) + + NETTLE_CHECK_IFUNC + +@@ -302,7 +305,7 @@ ABI=standard + case "$host_cpu" in + [x86_64 | amd64]) + AC_TRY_COMPILE([ +-#if defined(__x86_64__) || defined(__arch64__) ++#if defined(__x86_64__) || defined(__arch64__) || defined(_M_AMD64) + #error 64-bit x86 + #endif + ], [], [ +diff --git a/x86_64/aes.m4 b/x86_64/aes.m4 +index 3bec9eae2..85cafc046 100644 +--- a/x86_64/aes.m4 ++++ b/x86_64/aes.m4 +@@ -77,9 +77,9 @@ define(`AES_STORE', ` + dnl AES_ROUND(table,a,b,c,d,out,ptr) + dnl Computes one word of the AES round. Leaves result in $6. + define(`AES_ROUND', ` +- movzb LREG($2), $7 ++ movzbq LREG($2), $7 + movl AES_TABLE0 ($1, $7, 4),$6 +- movzb HREG($3), XREG($7) ++ movzbq HREG($3), XREG($7) + xorl AES_TABLE1 ($1, $7, 4),$6 + movl $4,XREG($7) + shr `$'16,$7 +@@ -94,7 +94,7 @@ dnl Computes one word of the final round. Leaves result in $6. Also + dnl performs the first substitution step, on the least significant + dnl byte, and rotates 8 bits. + define(`AES_FINAL_ROUND', ` +- movzb LREG($1),$7 ++ movzbq LREG($1),$7 + movzbl ($5, $7), $6 + movl $2,XREG($7) + andl `$'0x0000ff00,XREG($7) +@@ -113,18 +113,18 @@ dnl each of eax, ebx, ecx and edx, and also rotates + dnl the words one byte to the left. + dnl Uses that AES_SBOX == 0 + define(`AES_SUBST_BYTE', ` +- movzb LREG($1),$6 ++ movzbq LREG($1),$6 + movb ($5, $6),LREG($1) + roll `$'8,$1 + +- movzb LREG($2),$6 ++ movzbq LREG($2),$6 + movb ($5, $6),LREG($2) + roll `$'8,$2 + +- movzb LREG($3),$6 ++ movzbq LREG($3),$6 + movb ($5, $6),LREG($3) + roll `$'8,$3 + +- movzb LREG($4),$6 ++ movzbq LREG($4),$6 + movb ($5, $6),LREG($4) + roll `$'8,$4')dnl From d894d87a29043df040746debf45e4e89220ecb05 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 12 Mar 2022 10:26:21 +0100 Subject: [PATCH 17/22] fix cross build --- ports/nettle/hogweed-x86.def | 281 ++++++++++++++++++++ ports/nettle/nettle-x86.def | 496 +++++++++++++++++++++++++++++++++++ ports/nettle/portfile.cmake | 2 - 3 files changed, 777 insertions(+), 2 deletions(-) create mode 100644 ports/nettle/hogweed-x86.def create mode 100644 ports/nettle/nettle-x86.def diff --git a/ports/nettle/hogweed-x86.def b/ports/nettle/hogweed-x86.def new file mode 100644 index 00000000000000..8824a537c841bb --- /dev/null +++ b/ports/nettle/hogweed-x86.def @@ -0,0 +1,281 @@ +EXPORTS + nettle_ed448_shake256_verify + nettle_ed448_shake256_sign + nettle_ed448_shake256_public_key + _nettle_ed448_shake256 + nettle_ed25519_sha512_verify + nettle_ed25519_sha512_sign + nettle_ed25519_sha512_public_key + _nettle_ed25519_sha512 + _nettle_eddsa_verify + _nettle_eddsa_verify_itch + _nettle_eddsa_sign + _nettle_eddsa_sign_itch + _nettle_eddsa_public_key + _nettle_eddsa_public_key_itch + _nettle_eddsa_hash + _nettle_eddsa_expand_key + _nettle_eddsa_decompress + _nettle_eddsa_decompress_itch + _nettle_eddsa_compress + _nettle_eddsa_compress_itch + _nettle_curve448_eh_to_x + nettle_curve448_mul + nettle_curve448_mul_g + _nettle_curve25519_eh_to_x + nettle_curve25519_mul + nettle_curve25519_mul_g + nettle_gostdsa_vko + nettle_gostdsa_verify + nettle_ecc_gostdsa_verify + nettle_ecc_gostdsa_verify_itch + nettle_gostdsa_sign + nettle_ecc_gostdsa_sign + nettle_ecc_gostdsa_sign_itch + nettle_ecdsa_generate_keypair + nettle_ecdsa_verify + nettle_ecc_ecdsa_verify + nettle_ecc_ecdsa_verify_itch + nettle_ecdsa_sign + nettle_ecc_ecdsa_sign + nettle_ecc_ecdsa_sign_itch + nettle_ecc_point_mul_g + nettle_ecc_point_mul + nettle_ecc_scalar_clear + nettle_ecc_scalar_get + nettle_ecc_scalar_init + nettle_ecc_scalar_set + nettle_ecc_point_clear + nettle_ecc_point_get + nettle_ecc_point_init + nettle_ecc_point_set + _nettle_ecc_mod_random + nettle_ecc_scalar_random + _nettle_ecc_hash + _nettle_gost_hash + _nettle_ecc_mul_a + _nettle_ecc_mul_g + _nettle_ecc_mul_m + _nettle_ecc_mul_a_eh + _nettle_ecc_mul_g_eh + _nettle_ecc_add_thh + _nettle_ecc_add_th + _nettle_ecc_dup_th + _nettle_ecc_add_ehh + _nettle_ecc_add_eh + _nettle_ecc_dup_eh + _nettle_ecc_eh_to_a + _nettle_ecc_add_jjj + _nettle_ecc_add_jja + _nettle_ecc_dup_jj + _nettle_ecc_a_to_j + _nettle_ecc_j_to_a + nettle_ecc_bit_size + nettle_ecc_size + nettle_ecc_size_a + nettle_ecc_size_j + _nettle_secp_521r1 + nettle_get_secp_521r1 + _nettle_secp_384r1 + nettle_get_secp_384r1 + _nettle_secp_256r1 + nettle_get_secp_256r1 + _nettle_secp_224r1 + nettle_get_secp_224r1 + _nettle_secp_192r1 + nettle_get_secp_192r1 + _nettle_gost_gc512a + nettle_get_gost_gc512a + _nettle_gost_gc256b + nettle_get_gost_gc256b + _nettle_curve448 + _nettle_curve25519 + _nettle_ecc_pm1_redc + _nettle_ecc_pp1_redc + _nettle_ecc_mod_add + _nettle_ecc_mod_addmul_1 + _nettle_ecc_mod_mul + _nettle_ecc_mod_mul_1 + _nettle_ecc_mod_mul_canonical + _nettle_ecc_mod_pow_2k + _nettle_ecc_mod_pow_2k_mul + _nettle_ecc_mod_sqr + _nettle_ecc_mod_sqr_canonical + _nettle_ecc_mod_sub + _nettle_ecc_mod_submul_1 + _nettle_ecc_mod_inv + _nettle_ecc_mod + _nettle_cnd_copy + _nettle_gmp_alloc + _nettle_gmp_alloc_limbs + _nettle_gmp_free + _nettle_gmp_free_limbs + _nettle_mpn_get_base256 + _nettle_mpn_get_base256_le + _nettle_mpn_set_base256 + _nettle_mpn_set_base256_le + _nettle_mpz_limbs_cmp + _nettle_mpz_limbs_copy + _nettle_mpz_limbs_read_n + _nettle_mpz_set_n + _nettle_sec_tabselect + _nettle_sec_sub_1 + _nettle_sec_add_1 + nettle_dsa_openssl_private_key_from_der_iterator + nettle_dsa_params_from_der_iterator + nettle_dsa_public_key_from_der_iterator + nettle_openssl_provate_key_from_der + nettle_rsa_keypair_from_der + nettle_rsa_private_key_from_der_iterator + nettle_rsa_public_key_from_der_iterator + nettle_asn1_der_decode_bitstring + nettle_asn1_der_decode_bitstring_last + nettle_asn1_der_decode_constructed + nettle_asn1_der_decode_constructed_last + nettle_asn1_der_get_bignum + nettle_asn1_der_get_uint32 + nettle_asn1_der_iterator_first + nettle_asn1_der_iterator_next + nettle_rsa_keypair_to_openpgp + nettle_pgp_armor + nettle_pgp_crc24 + nettle_pgp_put_header + nettle_pgp_put_header_length + nettle_pgp_put_length + nettle_pgp_put_mpi + nettle_pgp_put_public_rsa_key + nettle_pgp_put_rsa_sha1_signature + nettle_pgp_put_string + nettle_pgp_put_sub_packet + nettle_pgp_put_uint16 + nettle_pgp_put_uint32 + nettle_pgp_put_userid + nettle_pgp_sub_packet_end + nettle_pgp_sub_packet_start + nettle_dsa_keypair_from_sexp_alist + nettle_dsa_sha1_keypair_from_sexp + nettle_dsa_sha256_keypair_from_sexp + nettle_dsa_signature_from_sexp + nettle_dsa_keypair_to_sexp + nettle_dsa_sha256_verify + nettle_dsa_sha256_verify_digest + nettle_dsa_sha256_sign + nettle_dsa_sha256_sign_digest + nettle_dsa_sha1_verify + nettle_dsa_sha1_verify_digest + nettle_dsa_sha1_sign + nettle_dsa_sha1_sign_digest + _nettle_dsa_hash + nettle_dsa_generate_keypair + nettle_dsa_verify + nettle_dsa_sign + nettle_dsa_generate_params + nettle_dsa_compat_generate_keypair + nettle_dsa_private_key_clear + nettle_dsa_private_key_init + nettle_dsa_public_key_clear + nettle_dsa_public_key_init + nettle_dsa_params_clear + nettle_dsa_params_init + nettle_dsa_signature_clear + nettle_dsa_signature_init + nettle_rsa_keypair_from_sexp + nettle_rsa_keypair_from_sexp_alist + nettle_rsa_keypair_to_sexp + _nettle_rsa_blind + _nettle_rsa_unblind + nettle_rsa_generate_keypair + nettle_rsa_decrypt_tr + nettle_rsa_sec_decrypt + nettle_rsa_decrypt + nettle_rsa_encrypt + nettle_rsa_pss_sha384_verify_digest + nettle_rsa_pss_sha512_verify_digest + nettle_rsa_pss_sha384_sign_digest_tr + nettle_rsa_pss_sha512_sign_digest_tr + nettle_rsa_pss_sha256_verify_digest + nettle_rsa_pss_sha256_sign_digest_tr + nettle_rsa_sha512_verify + nettle_rsa_sha512_verify_digest + nettle_rsa_sha512_sign_digest_tr + nettle_rsa_sha512_sign_tr + nettle_rsa_sha512_sign + nettle_rsa_sha512_sign_digest + nettle_rsa_sha256_verify + nettle_rsa_sha256_verify_digest + nettle_rsa_sha256_sign_digest_tr + nettle_rsa_sha256_sign_tr + nettle_rsa_sha256_sign + nettle_rsa_sha256_sign_digest + nettle_rsa_sha1_verify + nettle_rsa_sha1_verify_digest + nettle_rsa_sha1_sign_digest_tr + nettle_rsa_sha1_sign_tr + nettle_rsa_sha1_sign + nettle_rsa_sha1_sign_digest + nettle_rsa_md5_verify + nettle_rsa_md5_verify_digest + nettle_rsa_md5_sign_digest_tr + nettle_rsa_md5_sign_tr + nettle_rsa_md5_sign + nettle_rsa_md5_sign_digest + nettle_rsa_pkcs1_verify + nettle_rsa_pkcs1_sign_tr + nettle_rsa_pkcs1_sign + _nettle_rsa_sec_compute_root + _nettle_rsa_sec_compute_root_itch + _nettle_rsa_verify + _nettle_rsa_verify_recover + _nettle_rsa_sec_compute_root_tr + nettle_rsa_compute_root_tr + nettle_rsa_compute_root + nettle_rsa_private_key_clear + nettle_rsa_private_key_init + nettle_rsa_private_key_prepare + _nettle_rsa_check_size + nettle_rsa_public_key_clear + nettle_rsa_public_key_init + nettle_rsa_public_key_prepare + nettle_pss_mgf1 + nettle_pss_encode_mgf1 + nettle_pss_verify_mgf1 + nettle_pkcs1_rsa_sha512_encode + nettle_pkcs1_rsa_sha512_encode_digest + nettle_pkcs1_rsa_sha256_encode + nettle_pkcs1_rsa_sha256_encode_digest + nettle_pkcs1_rsa_sha1_encode + nettle_pkcs1_rsa_sha1_encode_digest + nettle_pkcs1_rsa_md5_encode + nettle_pkcs1_rsa_md5_encode_digest + nettle_pkcs1_rsa_digest_encode + _nettle_pkcs1_sec_decrypt + _nettle_pkcs1_sec_decrypt_variable + nettle_pkcs1_decrypt + nettle_pkcs1_encrypt + _nettle_pkcs1_signature_prefix + nettle_mpz_set_sexp + _nettle_generate_pocklington_prime + nettle_random_prime + nettle_mpz_random + nettle_mpz_random_size + nettle_mpz_get_str_256 + nettle_mpz_init_set_str_256_s + nettle_mpz_init_set_str_256_u + nettle_mpz_set_str_256_s + nettle_mpz_set_str_256_u + nettle_mpz_sizeinbase_256_s + nettle_mpz_sizeinbase_256_u + nettle_sexp_transport_format + nettle_sexp_transport_vformat + nettle_sexp_transport_iterator_first + nettle_sexp_format + nettle_sexp_vformat + nettle_sexp_iterator_assoc + nettle_sexp_iterator_check_type + nettle_sexp_iterator_check_types + nettle_sexp_iterator_enter_list + nettle_sexp_iterator_exit_list + nettle_sexp_iterator_first + nettle_sexp_iterator_get_uint32 + nettle_sexp_iterator_next + nettle_sexp_iterator_subexpr diff --git a/ports/nettle/nettle-x86.def b/ports/nettle/nettle-x86.def new file mode 100644 index 00000000000000..213449531518ce --- /dev/null +++ b/ports/nettle/nettle-x86.def @@ -0,0 +1,496 @@ +EXPORTS + nettle_xts_aes256_decrypt_message + nettle_xts_aes256_encrypt_message + nettle_xts_aes256_set_decrypt_key + nettle_xts_aes256_set_encrypt_key + nettle_xts_aes128_decrypt_message + nettle_xts_aes128_encrypt_message + nettle_xts_aes128_set_decrypt_key + nettle_xts_aes128_set_encrypt_key + nettle_xts_decrypt_message + nettle_xts_encrypt_message + nettle_yarrow_key_event_estimate + nettle_yarrow_key_event_init + nettle_yarrow256_fast_reseed + nettle_yarrow256_init + nettle_yarrow256_is_seeded + nettle_yarrow256_needed_sources + nettle_yarrow256_random + nettle_yarrow256_seed + nettle_yarrow256_slow_reseed + nettle_yarrow256_update + _nettle_write_le64 + _nettle_write_le32 + _nettle_write_be32 + nettle_version_major + nettle_version_minor + nettle_umac128_digest + nettle_umac128_set_key + nettle_umac128_set_nonce + nettle_umac128_update + nettle_umac96_digest + nettle_umac96_set_key + nettle_umac96_set_nonce + nettle_umac96_update + nettle_umac64_digest + nettle_umac64_set_key + nettle_umac64_set_nonce + nettle_umac64_update + nettle_umac32_digest + nettle_umac32_set_key + nettle_umac32_set_nonce + nettle_umac32_update + _nettle_umac_set_key + _nettle_umac_poly128 + _nettle_umac_poly64 + _nettle_umac_l3 + _nettle_umac_l3_init + _nettle_umac_l2 + _nettle_umac_l2_final + _nettle_umac_l2_init + _nettle_umac_nh_n + _nettle_umac_nh + nettle_twofish128 + nettle_twofish192 + nettle_twofish256 + nettle_twofish128_set_key + nettle_twofish192_set_key + nettle_twofish256_set_key + nettle_twofish_decrypt + nettle_twofish_encrypt + nettle_twofish_set_key + nettle_streebog256 + nettle_streebog512 + nettle_streebog256_digest + nettle_streebog256_init + nettle_streebog512_digest + nettle_streebog512_init + nettle_streebog512_update + nettle_serpent128 + nettle_serpent192 + nettle_serpent256 + nettle_serpent_decrypt + nettle_serpent_encrypt + nettle_serpent128_set_key + nettle_serpent192_set_key + nettle_serpent256_set_key + nettle_serpent_set_key + nettle_sha3_256_shake + nettle_sha3_512 + nettle_sha3_512_digest + nettle_sha3_512_init + nettle_sha3_512_update + nettle_sha3_384 + nettle_sha3_384_digest + nettle_sha3_384_init + nettle_sha3_384_update + nettle_sha3_256 + nettle_sha3_256_digest + nettle_sha3_256_init + nettle_sha3_256_update + nettle_sha3_224 + nettle_sha3_224_digest + nettle_sha3_224_init + nettle_sha3_224_update + nettle_sha3_permute + _nettle_sha3_pad + _nettle_sha3_update + nettle_sha512_256 + nettle_sha512_224 + nettle_sha512 + nettle_sha384 + _nettle_sha512_compress + nettle_sha384_digest + nettle_sha384_init + nettle_sha512_224_digest + nettle_sha512_224_init + nettle_sha512_256_digest + nettle_sha512_256_init + nettle_sha512_digest + nettle_sha512_init + nettle_sha512_update + nettle_sha256 + nettle_sha224 + _nettle_sha256_compress + nettle_sha224_digest + nettle_sha224_init + nettle_sha256_digest + nettle_sha256_init + nettle_sha256_update + nettle_sha1 + nettle_sha1_compress + nettle_sha1_digest + nettle_sha1_init + nettle_sha1_update + nettle_salsa20_256_set_key + nettle_salsa20_128_set_key + nettle_salsa20_set_nonce + nettle_salsa20_set_key + nettle_salsa20r12_crypt + nettle_salsa20_crypt + _nettle_salsa20_crypt + _nettle_salsa20_core + nettle_ripemd160 + _nettle_ripemd160_compress + nettle_ripemd160_digest + nettle_ripemd160_init + nettle_ripemd160_update + nettle_realloc + nettle_xrealloc + _nettle_poly1305_block + _nettle_poly1305_digest + _nettle_poly1305_set_key + nettle_poly1305_aes_digest + nettle_poly1305_aes_set_key + nettle_poly1305_aes_set_nonce + nettle_poly1305_aes_update + nettle_pbkdf2_hmac_sha512 + nettle_pbkdf2_hmac_sha384 + nettle_pbkdf2_hmac_sha256 + nettle_pbkdf2_hmac_sha1 + nettle_pbkdf2_hmac_gosthash94cp + nettle_pbkdf2 + _nettle_macs + nettle_get_macs + _nettle_hashes + nettle_get_hashes + _nettle_ciphers + nettle_get_ciphers + _nettle_armors + nettle_get_armors + _nettle_aeads + nettle_get_aeads + nettle_lookup_hash + nettle_memxor3 + nettle_memxor + nettle_memeql_sec + nettle_md5 + nettle_MD5Final + nettle_MD5Init + nettle_MD5Update + nettle_md5_compress + nettle_md5_digest + nettle_md5_init + nettle_md5_update + nettle_md4 + nettle_md4_digest + nettle_md4_init + nettle_md4_update + nettle_md2 + nettle_md2_digest + nettle_md2_init + nettle_md2_update + nettle_hkdf_expand + nettle_hkdf_extract + nettle_knuth_lfib_get + nettle_knuth_lfib_get_array + nettle_knuth_lfib_init + nettle_knuth_lfib_random + nettle_hmac_streebog256 + nettle_hmac_streebog512 + nettle_hmac_sha512 + nettle_hmac_sha384 + nettle_hmac_sha256 + nettle_hmac_sha224 + nettle_hmac_sha1 + nettle_hmac_ripemd160 + nettle_hmac_md5 + nettle_hmac_streebog256_digest + nettle_hmac_streebog256_set_key + nettle_hmac_streebog512_digest + nettle_hmac_streebog512_set_key + nettle_hmac_streebog512_update + nettle_hmac_sha512_digest + nettle_hmac_sha512_set_key + nettle_hmac_sha512_update + nettle_hmac_sha384_digest + nettle_hmac_sha384_set_key + nettle_hmac_sha256_digest + nettle_hmac_sha256_set_key + nettle_hmac_sha256_update + nettle_hmac_sha224_digest + nettle_hmac_sha224_set_key + nettle_hmac_sha1_digest + nettle_hmac_sha1_set_key + nettle_hmac_sha1_update + nettle_hmac_ripemd160_digest + nettle_hmac_ripemd160_set_key + nettle_hmac_ripemd160_update + nettle_hmac_md5_digest + nettle_hmac_md5_set_key + nettle_hmac_md5_update + nettle_hmac_gosthash94_digest + nettle_hmac_gosthash94_set_key + nettle_hmac_gosthash94_update + nettle_hmac_gosthash94cp_digest + nettle_hmac_gosthash94cp_set_key + nettle_hmac_gosthash94cp_update + nettle_hmac_digest + nettle_hmac_set_key + nettle_hmac_update + nettle_gosthash94 + nettle_gosthash94cp + nettle_gosthash94_digest + nettle_gosthash94_init + nettle_gosthash94_update + nettle_gosthash94cp_digest + nettle_gosthash94cp_update + _nettle_gost28147_encrypt_block + _nettle_gost28147_param_CryptoPro_3411 + _nettle_gost28147_param_test_3411 + nettle_cmac_des3 + nettle_cmac_aes256 + nettle_cmac_aes128 + nettle_cmac_des3_digest + nettle_cmac_des3_set_key + nettle_cmac_des3_update + nettle_cmac_aes256_digest + nettle_cmac_aes256_set_key + nettle_cmac_aes256_update + nettle_cmac_aes128_digest + nettle_cmac_aes128_set_key + nettle_cmac_aes128_update + nettle_cmac64_digest + nettle_cmac64_init + nettle_cmac64_set_key + nettle_cmac64_update + nettle_cmac128_digest + nettle_cmac128_init + nettle_cmac128_set_key + nettle_cmac128_update + nettle_gcm_camellia256 + nettle_gcm_camellia256_decrypt + nettle_gcm_camellia256_digest + nettle_gcm_camellia256_encrypt + nettle_gcm_camellia256_set_iv + nettle_gcm_camellia256_set_key + nettle_gcm_camellia256_update + nettle_gcm_camellia128 + nettle_gcm_camellia128_decrypt + nettle_gcm_camellia128_digest + nettle_gcm_camellia128_encrypt + nettle_gcm_camellia128_set_iv + nettle_gcm_camellia128_set_key + nettle_gcm_camellia128_update + nettle_gcm_aes256 + nettle_gcm_aes256_decrypt + nettle_gcm_aes256_digest + nettle_gcm_aes256_encrypt + nettle_gcm_aes256_set_iv + nettle_gcm_aes256_set_key + nettle_gcm_aes256_update + nettle_gcm_aes192 + nettle_gcm_aes192_decrypt + nettle_gcm_aes192_digest + nettle_gcm_aes192_encrypt + nettle_gcm_aes192_set_iv + nettle_gcm_aes192_set_key + nettle_gcm_aes192_update + nettle_gcm_aes128 + nettle_gcm_aes128_decrypt + nettle_gcm_aes128_digest + nettle_gcm_aes128_encrypt + nettle_gcm_aes128_set_iv + nettle_gcm_aes128_set_key + nettle_gcm_aes128_update + nettle_gcm_aes_decrypt + nettle_gcm_aes_digest + nettle_gcm_aes_encrypt + nettle_gcm_aes_set_iv + nettle_gcm_aes_set_key + nettle_gcm_aes_update + nettle_gcm_decrypt + nettle_gcm_digest + nettle_gcm_encrypt + nettle_gcm_set_iv + nettle_gcm_set_key + nettle_gcm_update + nettle_eax_aes128 + nettle_eax_aes128_decrypt + nettle_eax_aes128_digest + nettle_eax_aes128_encrypt + nettle_eax_aes128_set_key + nettle_eax_aes128_set_nonce + nettle_eax_aes128_update + nettle_eax_decrypt + nettle_eax_digest + nettle_eax_encrypt + nettle_eax_set_key + nettle_eax_set_nonce + nettle_eax_update + nettle_des3_decrypt + nettle_des3_encrypt + nettle_des3_set_key + nettle_des_check_parity + nettle_des_decrypt + nettle_des_encrypt + nettle_des_fix_parity + nettle_des_set_key + _nettle_ctr_crypt16 + nettle_ctr_crypt + nettle_chacha_set_counter + nettle_chacha_set_counter32 + nettle_chacha_set_nonce + nettle_chacha_set_nonce96 + nettle_chacha_set_key + nettle_chacha_poly1305 + nettle_chacha_poly1305_decrypt + nettle_chacha_poly1305_digest + nettle_chacha_poly1305_encrypt + nettle_chacha_poly1305_set_key + nettle_chacha_poly1305_set_nonce + nettle_chacha_poly1305_update + _nettle_chacha_core + nettle_chacha_crypt + nettle_chacha_crypt32 + nettle_cnd_memcpy + nettle_siv_cmac_aes256_decrypt_message + nettle_siv_cmac_aes256_encrypt_message + nettle_siv_cmac_aes256_set_key + nettle_siv_cmac_aes128_decrypt_message + nettle_siv_cmac_aes128_encrypt_message + nettle_siv_cmac_aes128_set_key + nettle_siv_cmac_decrypt_message + nettle_siv_cmac_encrypt_message + nettle_siv_cmac_set_key + nettle_cfb8_decrypt + nettle_cfb8_encrypt + nettle_cfb_decrypt + nettle_cfb_encrypt + nettle_ccm_aes256_decrypt + nettle_ccm_aes256_decrypt_message + nettle_ccm_aes256_digest + nettle_ccm_aes256_encrypt + nettle_ccm_aes256_encrypt_message + nettle_ccm_aes256_set_key + nettle_ccm_aes256_set_nonce + nettle_ccm_aes256_update + nettle_ccm_aes192_decrypt + nettle_ccm_aes192_decrypt_message + nettle_ccm_aes192_digest + nettle_ccm_aes192_encrypt + nettle_ccm_aes192_encrypt_message + nettle_ccm_aes192_set_key + nettle_ccm_aes192_set_nonce + nettle_ccm_aes192_update + nettle_ccm_aes128_decrypt + nettle_ccm_aes128_decrypt_message + nettle_ccm_aes128_digest + nettle_ccm_aes128_encrypt + nettle_ccm_aes128_encrypt_message + nettle_ccm_aes128_set_key + nettle_ccm_aes128_set_nonce + nettle_ccm_aes128_update + nettle_ccm_decrypt + nettle_ccm_decrypt_message + nettle_ccm_digest + nettle_ccm_encrypt + nettle_ccm_encrypt_message + nettle_ccm_set_nonce + nettle_ccm_update + nettle_cbc_decrypt + nettle_cbc_encrypt + nettle_cast128 + nettle_cast128_decrypt + nettle_cast128_encrypt + nettle_cast128_set_key + nettle_cast5_set_key + nettle_camellia256 + nettle_camellia192_set_decrypt_key + nettle_camellia256_invert_key + nettle_camellia256_set_decrypt_key + nettle_camellia256_crypt + nettle_camellia192_set_encrypt_key + nettle_camellia256_set_encrypt_key + nettle_camellia192 + nettle_camellia128 + nettle_camellia128_invert_key + nettle_camellia_set_decrypt_key + nettle_camellia128_crypt + nettle_camellia128_set_encrypt_key + _nettle_camellia_invert_key + _nettle_camellia_absorb + _nettle_camellia_table + _nettle_camellia_crypt + nettle_buffer_init + nettle_buffer_clear + nettle_buffer_copy + nettle_buffer_grow + nettle_buffer_init_realloc + nettle_buffer_init_size + nettle_buffer_reset + nettle_buffer_space + nettle_buffer_write + nettle_base64url + nettle_base64url_decode_init + nettle_base64url_encode_init + nettle_base64 + nettle_base64_decode_final + nettle_base64_decode_init + nettle_base64_decode_single + nettle_base64_decode_update + nettle_base64_encode_final + nettle_base64_encode_group + nettle_base64_encode_init + nettle_base64_encode_raw + nettle_base64_encode_single + nettle_base64_encode_update + nettle_base16 + nettle_base16_decode_final + nettle_base16_decode_init + nettle_base16_decode_single + nettle_base16_decode_update + nettle_base16_encode_single + nettle_base16_encode_update + nettle_blowfish_bcrypt_hash + nettle_blowfish_bcrypt_verify + _nettle_blowfish_encround + _nettle_blowfish_initial_ctx + nettle_blowfish128_set_key + nettle_blowfish_decrypt + nettle_blowfish_encrypt + nettle_blowfish_set_key + nettle_arctwo128 + nettle_arctwo40 + nettle_arctwo64 + nettle_arctwo_gutmann128 + nettle_arctwo128_set_key + nettle_arctwo128_set_key_gutmann + nettle_arctwo40_set_key + nettle_arctwo64_set_key + nettle_arctwo_decrypt + nettle_arctwo_encrypt + nettle_arctwo_set_key + nettle_arctwo_set_key_ekb + nettle_arctwo_set_key_gutmann + nettle_arcfour_crypt + nettle_arcfour128_set_key + nettle_arcfour_set_key + nettle_aes256 + nettle_aes256_invert_key + nettle_aes256_set_decrypt_key + nettle_aes256_set_encrypt_key + nettle_aes192 + nettle_aes192_invert_key + nettle_aes192_set_decrypt_key + nettle_aes192_set_encrypt_key + nettle_aes128 + nettle_aes128_invert_key + nettle_aes128_set_decrypt_key + nettle_aes128_set_encrypt_key + nettle_aes_invert_key + nettle_aes_set_decrypt_key + nettle_aes_set_encrypt_key + _nettle_aes_set_key + _nettle_aes_invert + _nettle_aes_encrypt_table + nettle_aes128_encrypt + nettle_aes192_encrypt + nettle_aes256_encrypt + nettle_aes_encrypt + _nettle_aes_encrypt + nettle_aes128_decrypt + nettle_aes192_decrypt + nettle_aes256_decrypt + nettle_aes_decrypt + _nettle_aes_decrypt diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index bd21dc7769ac96..86f3b6e59698b4 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -58,8 +58,6 @@ list(TRANSFORM tool_names APPEND "${VCPKG_HOST_EXECUTABLE_SUFFIX}") if(VCPKG_CROSSCOMPILING) list(TRANSFORM tool_names PREPEND "${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}/") - foreach() - endforeach() file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/" ) if(NOT VCPKG_BUILD_TYPE) file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/" ) From 242c22d0b909714d307b9c8c1d3091f22ebf6312 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 12 Mar 2022 10:42:50 +0100 Subject: [PATCH 18/22] manifest format --- ports/nettle/vcpkg.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/nettle/vcpkg.json b/ports/nettle/vcpkg.json index 95cea806411a65..2df3fd06c9535f 100644 --- a/ports/nettle/vcpkg.json +++ b/ports/nettle/vcpkg.json @@ -5,6 +5,10 @@ "homepage": "https://git.lysator.liu.se/nettle/nettle", "dependencies": [ "gmp", + { + "name": "nettle", + "host": true + }, { "name": "yasm", "host": true, @@ -12,10 +16,6 @@ "tools" ], "platform": "windows" - }, - { - "name": "nettle", - "host": true } ] } From 06833a7cae3d1df94d834f5f579e276f6964f382 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 12 Mar 2022 10:46:13 +0100 Subject: [PATCH 19/22] add license --- ports/nettle/vcpkg.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nettle/vcpkg.json b/ports/nettle/vcpkg.json index 2df3fd06c9535f..e9f7830bdb5941 100644 --- a/ports/nettle/vcpkg.json +++ b/ports/nettle/vcpkg.json @@ -3,6 +3,7 @@ "version": "3.7.3", "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.", "homepage": "https://git.lysator.liu.se/nettle/nettle", + "license": null, "dependencies": [ "gmp", { From b64b1829191786a539f3ba9764cd065fe829a820 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 12 Mar 2022 10:46:28 +0100 Subject: [PATCH 20/22] version stuff --- versions/baseline.json | 4 ++-- versions/n-/nettle.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index c118670f5f1da7..94d2a9f6656ce7 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4757,8 +4757,8 @@ "port-version": 2 }, "nettle": { - "baseline": "3.6", - "port-version": 2 + "baseline": "3.7.3", + "port-version": 0 }, "networkdirect-sdk": { "baseline": "2.0.1", diff --git a/versions/n-/nettle.json b/versions/n-/nettle.json index 07261c08a58e40..f6dc5578da2638 100644 --- a/versions/n-/nettle.json +++ b/versions/n-/nettle.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b82f0087de9f55fbebd2f735bef60d72c0e10e0b", + "version": "3.7.3", + "port-version": 0 + }, { "git-tree": "2d7735edc12e985fbe6bae0489a8c01ff18413cd", "version": "3.6", From 6566af3b10a1be15fbfd8123f874122816cbc43a Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 23 Mar 2022 20:54:04 +0100 Subject: [PATCH 21/22] version stuff --- versions/baseline.json | 4 ++-- versions/n-/nettle.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index b05230c159b1cd..8eb5631554dd57 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4785,8 +4785,8 @@ "port-version": 2 }, "nettle": { - "baseline": "3.6", - "port-version": 2 + "baseline": "3.7.3", + "port-version": 0 }, "networkdirect-sdk": { "baseline": "2.0.1", diff --git a/versions/n-/nettle.json b/versions/n-/nettle.json index 07261c08a58e40..cc4149516cc254 100644 --- a/versions/n-/nettle.json +++ b/versions/n-/nettle.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "30b1029b114c4909b001317ab3c416245d1b3ed2", + "version": "3.7.3", + "port-version": 0 + }, { "git-tree": "2d7735edc12e985fbe6bae0489a8c01ff18413cd", "version": "3.6", From 9f284e111417da467d6d4abbd56e5aa9da7be803 Mon Sep 17 00:00:00 2001 From: nicole mazzuca Date: Mon, 28 Mar 2022 11:30:45 -0700 Subject: [PATCH 22/22] @Thomas1664's suggestions --- ports/nettle/portfile.cmake | 72 +++++++++++++++++++++++-------------- versions/n-/nettle.json | 2 +- 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/ports/nettle/portfile.cmake b/ports/nettle/portfile.cmake index 86f3b6e59698b4..329cbddc13b5b6 100644 --- a/ports/nettle/portfile.cmake +++ b/ports/nettle/portfile.cmake @@ -1,27 +1,29 @@ +vcpkg_list(SET patches) if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - set(patches yasm.patch # the asm changes are a downgrade to an older version - compile.patch - libname-windows.patch # Apply common libtool rules for lib naming. - ) + vcpkg_list(SET patches + yasm.patch # the asm changes are a downgrade to an older version + compile.patch + libname-windows.patch # Apply common libtool rules for lib naming. + ) endif() vcpkg_from_gitlab( GITLAB_URL https://git.lysator.liu.se/ OUT_SOURCE_PATH SOURCE_PATH REPO nettle/nettle - REF 52bacacaf4339fd78289f58919732f1f35bea1c1 #v3.7.3 + REF 52bacacaf4339fd78289f58919732f1f35bea1c1 #v3.7.3 SHA512 0130d14195274eeec11e8299793e3037f4b84d8fb4b5c5c9392b63ee693ed5713434070744b1a44e14a6a5090d655917c1dd296e2011cd99e3c316ef5d8ee395 HEAD_REF master PATCHES - fix-InstallLibPath.patch - flags.patch - ${patches} + fix-InstallLibPath.patch + flags.patch + ${patches} ) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(OPTIONS --disable-static) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_list(SET OPTIONS --disable-static) else() - set(OPTIONS --disable-shared) + vcpkg_list(SET OPTIONS --disable-shared) endif() if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) @@ -32,10 +34,11 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) set(asmflag win32) endif() set(ENV{ASMFLAGS} "-Xvc -f ${asmflag} -pgas -rraw") - list(APPEND OPTIONS ac_cv_func_memset=yes - "nettle_cv_asm_type_percent_function=no" - "nettle_cv_asm_align_log=no" - ) + vcpkg_list(APPEND OPTIONS + ac_cv_func_memset=yes + nettle_cv_asm_type_percent_function=no + nettle_cv_asm_align_log=no + ) endif() if(VCPKG_CROSSCOMPILING) @@ -52,28 +55,43 @@ vcpkg_configure_make( ${OPTIONS} ) -set(tool_names des ecc ) # aes gcm sha twofish ? +set(tool_names des ecc) # aes gcm sha twofish? list(TRANSFORM tool_names APPEND "data") list(TRANSFORM tool_names APPEND "${VCPKG_HOST_EXECUTABLE_SUFFIX}") if(VCPKG_CROSSCOMPILING) list(TRANSFORM tool_names PREPEND "${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}/") - file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/" ) + file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/") if(NOT VCPKG_BUILD_TYPE) - file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/" ) + file(COPY ${tool_names} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/") endif() endif() if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") # def files are created by running 'llvm-nm | findstr /R /C:"[RT] _*nettle_"' on the static build and replacing '00[0-9abcdef]+ [RT]' with spaces # please update the defs if the version is bumped set(build_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/") - configure_file("${CURRENT_PORT_DIR}/nettle-${VCPKG_TARGET_ARCHITECTURE}.def" "${build_dir}/nettle.def" COPYONLY) - configure_file("${CURRENT_PORT_DIR}/hogweed-${VCPKG_TARGET_ARCHITECTURE}.def" "${build_dir}/hogweed.def" COPYONLY) + configure_file( + "${CURRENT_PORT_DIR}/nettle-${VCPKG_TARGET_ARCHITECTURE}.def" + "${build_dir}/nettle.def" + COPYONLY + ) + configure_file( + "${CURRENT_PORT_DIR}/hogweed-${VCPKG_TARGET_ARCHITECTURE}.def" + "${build_dir}/hogweed.def" + COPYONLY + ) if(NOT VCPKG_BUILD_TYPE) set(build_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/") - configure_file("${CURRENT_PORT_DIR}/nettle-${VCPKG_TARGET_ARCHITECTURE}.def" "${build_dir}/nettle.def" COPYONLY) - configure_file("${CURRENT_PORT_DIR}/hogweed-${VCPKG_TARGET_ARCHITECTURE}.def" "${build_dir}/hogweed.def" COPYONLY) + configure_file( + "${CURRENT_PORT_DIR}/nettle-${VCPKG_TARGET_ARCHITECTURE}.def" + "${build_dir}/nettle.def" + COPYONLY + ) + configure_file("${CURRENT_PORT_DIR}/hogweed-${VCPKG_TARGET_ARCHITECTURE}.def" + "${build_dir}/hogweed.def" + COPYONLY + ) endif() endif() endif() @@ -81,15 +99,17 @@ vcpkg_install_make() if(NOT VCPKG_CROSSCOMPILING) list(TRANSFORM tool_names PREPEND "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/") - file(COPY ${tool_names} DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}" ) + file(COPY ${tool_names} DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}") endif() 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) +file(INSTALL "${SOURCE_PATH}/COPYINGv3" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" + RENAME copyright +) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_IS_LINUX) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") diff --git a/versions/n-/nettle.json b/versions/n-/nettle.json index cc4149516cc254..45061924536ceb 100644 --- a/versions/n-/nettle.json +++ b/versions/n-/nettle.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "30b1029b114c4909b001317ab3c416245d1b3ed2", + "git-tree": "17fa323aae2ecee658549bd9a8951a2ce6c9880a", "version": "3.7.3", "port-version": 0 },