2023-03-03 04:02:04 +08:00
vcpkg_list ( SET extra_patches )
2022-03-29 02:46:02 +08:00
if ( VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW )
2023-03-03 04:02:04 +08:00
vcpkg_list ( APPEND extra_patches
2022-03-29 02:46:02 +08:00
y a s m . p a t c h # the asm changes are a downgrade to an older version
2023-03-03 04:02:04 +08:00
l i b n a m e - w i n d o w s . p a t c h # libtool rules for lib naming, exports
2020-05-09 04:55:11 +08:00
)
2022-03-29 02:46:02 +08:00
endif ( )
2020-10-29 05:26:41 +08:00
2022-03-29 02:46:02 +08:00
vcpkg_from_gitlab (
G I T L A B _ U R L h t t p s : / / g i t . l y s a t o r . l i u . s e /
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O n e t t l e / n e t t l e
2023-03-22 03:50:51 +08:00
R E F n e t t l e _ 3 . 8 . 1 _ r e l e a s e _ 2 0 2 2 0 7 2 7
S H A 5 1 2 e d 1 f a 1 b 7 7 a f d 6 1 f a f a 1 5 b 6 3 f 4 3 2 4 8 0 9 f a 6 9 5 6 9 6 9 1 d 1 6 b 9 3 f 4 0 3 c 8 3 7 9 4 6 7 2 8 5 9 a 1 7 6 0 d 1 0 2 9 0 2 3 4 9 f 9 3 b 1 6 3 2 d e 5 6 8 c 3 6 e 0 6 a 0 e 2 b 5 b 6 1 8 7 7 0 8 2 b 1 9 8 2 d f c f 2 c 5 2 1 7 2
2022-03-29 02:46:02 +08:00
H E A D _ R E F m a s t e r
P A T C H E S
2023-03-22 03:50:51 +08:00
s u b d i r s . p a t c h
2023-03-03 04:02:04 +08:00
f i x - l i b d i r . p a t c h
c o m p i l e . p a t c h
h o s t - t o o l s . p a t c h
c c a s . p a t c h
2023-03-22 03:50:51 +08:00
i n s t a l l - d l l . p a t c h
2023-03-03 04:02:04 +08:00
$ { e x t r a _ p a t c h e s }
2022-03-29 02:46:02 +08:00
)
2020-05-09 04:55:11 +08:00
2023-03-22 03:50:51 +08:00
# Temporarily set to 1 to re-generate the lists of exported symbols.
# This is needed when the version is bumped.
set ( GENERATE_SYMBOLS 0 )
if ( GENERATE_SYMBOLS )
if ( VCPKG_TARGET_IS_MINGW OR NOT VCPKG_TARGET_IS_WINDOWS )
set ( GENERATE_SYMBOLS 0 )
else ( )
vcpkg_check_linkage ( ONLY_STATIC_LIBRARY )
endif ( )
endif ( )
2023-03-03 04:02:04 +08:00
vcpkg_list ( SET OPTIONS )
2022-03-29 02:46:02 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
2023-03-03 04:02:04 +08:00
vcpkg_list ( APPEND OPTIONS --disable-static )
2022-03-29 02:46:02 +08:00
else ( )
2023-03-03 04:02:04 +08:00
vcpkg_list ( APPEND OPTIONS --disable-shared )
2022-03-29 02:46:02 +08:00
endif ( )
2020-05-09 04:55:11 +08:00
2023-03-22 03:50:51 +08:00
if ( "tools" IN_LIST FEATURES )
vcpkg_list ( APPEND OPTIONS --enable-tools )
endif ( )
2022-03-29 02:46:02 +08:00
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 )
2020-12-29 03:26:40 +08:00
endif ( )
2022-03-29 02:46:02 +08:00
set ( ENV{ASMFLAGS} "-Xvc -f ${asmflag} -pgas -rraw" )
vcpkg_list ( APPEND OPTIONS
a c _ c v _ f u n c _ m e m s e t = y e s
n e t t l e _ c v _ a s m _ t y p e _ p e r c e n t _ f u n c t i o n = n o
n e t t l e _ c v _ a s m _ a l i g n _ l o g = n o
)
2023-03-22 03:50:51 +08:00
else ( )
vcpkg_list ( APPEND OPTIONS "CCAS=" ) # configure will use CC
2022-03-29 02:46:02 +08:00
endif ( )
2020-12-29 03:26:40 +08:00
2022-03-29 02:46:02 +08:00
if ( VCPKG_CROSSCOMPILING )
2023-03-03 04:02:04 +08:00
set ( ENV{HOST_TOOLS_PREFIX} "${CURRENT_HOST_INSTALLED_DIR}/manual-tools/${PORT}" )
2022-03-29 02:46:02 +08:00
endif ( )
2020-12-29 03:26:40 +08:00
2022-03-29 02:46:02 +08:00
vcpkg_configure_make (
2023-03-03 04:02:04 +08:00
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2022-03-29 02:46:02 +08:00
A U T O C O N F I G
O P T I O N S
2023-03-03 04:02:04 +08:00
$ { O P T I O N S }
2022-03-29 02:46:02 +08:00
- - d i s a b l e - d o c u m e n t a t i o n
- - d i s a b l e - o p e n s s l
2023-03-03 04:02:04 +08:00
" g m p _ c v _ p r o g _ e x e e x t _ f o r _ b u i l d = $ { V C P K G _ H O S T _ E X E C U T A B L E _ S U F F I X } "
2023-03-22 03:50:51 +08:00
O P T I O N S _ D E B U G
- - d i s a b l e - t o o l s
2022-03-29 02:46:02 +08:00
)
2020-10-29 05:26:41 +08:00
2022-03-29 02:46:02 +08:00
if ( VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
# def files are created by running 'llvm-nm <libname> | 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 (
" $ { C U R R E N T _ P O R T _ D I R } / n e t t l e - $ { V C P K G _ T A R G E T _ A R C H I T E C T U R E } . d e f "
" $ { b u i l d _ d i r } / n e t t l e . d e f "
C O P Y O N L Y
)
configure_file (
" $ { C U R R E N T _ P O R T _ D I R } / h o g w e e d - $ { V C P K G _ T A R G E T _ A R C H I T E C T U R E } . d e f "
" $ { b u i l d _ d i r } / h o g w e e d . d e f "
C O P Y O N L Y
)
if ( NOT VCPKG_BUILD_TYPE )
set ( build_dir "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/" )
configure_file (
" $ { C U R R E N T _ P O R T _ D I R } / n e t t l e - $ { V C P K G _ T A R G E T _ A R C H I T E C T U R E } . d e f "
" $ { b u i l d _ d i r } / n e t t l e . d e f "
C O P Y O N L Y
)
configure_file ( "${CURRENT_PORT_DIR}/hogweed-${VCPKG_TARGET_ARCHITECTURE}.def"
" $ { b u i l d _ d i r } / h o g w e e d . d e f "
C O P Y O N L Y
)
endif ( )
2020-10-13 06:22:48 +08:00
endif ( )
2022-03-29 02:46:02 +08:00
endif ( )
vcpkg_install_make ( )
2020-05-09 04:55:11 +08:00
2023-03-22 03:50:51 +08:00
vcpkg_copy_tool_dependencies ( "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug" )
2022-03-29 02:46:02 +08:00
if ( NOT VCPKG_CROSSCOMPILING )
2023-03-03 04:02:04 +08:00
set ( tool_names desdata eccdata ) # aes gcm sha twofish?
2022-03-29 02:46:02 +08:00
list ( TRANSFORM tool_names PREPEND "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/" )
2023-03-03 04:02:04 +08:00
list ( TRANSFORM tool_names APPEND "${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
2022-03-29 02:46:02 +08:00
file ( COPY ${ tool_names } DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}" )
2023-03-03 04:02:04 +08:00
vcpkg_copy_tool_dependencies ( "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}" )
2022-03-29 02:46:02 +08:00
endif ( )
2020-05-09 04:55:11 +08:00
2022-03-29 02:46:02 +08:00
vcpkg_fixup_pkgconfig ( )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
2020-05-09 04:55:11 +08:00
2023-03-03 04:02:04 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/COPYINGv3" )
2023-03-22 03:50:51 +08:00
if ( GENERATE_SYMBOLS )
include ( "${CMAKE_CURRENT_LIST_DIR}/lib-to-def.cmake" )
lib_to_def ( BASENAME nettle REGEX "_*nettle_" )
lib_to_def ( BASENAME hogweed REGEX "_*nettle_" )
endif ( )