2022-03-29 02:46:02 +08:00
vcpkg_list ( SET patches )
if ( VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW )
vcpkg_list ( SET patches
y a s m . p a t c h # the asm changes are a downgrade to an older version
c o m p i l e . p a t c h
l i b n a m e - w i n d o w s . p a t c h # Apply common libtool rules for lib naming.
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
R E F 5 2 b a c a c a f 4 3 3 9 f d 7 8 2 8 9 f 5 8 9 1 9 7 3 2 f 1 f 3 5 b e a 1 c 1 #v3.7.3
S H A 5 1 2 0 1 3 0 d 1 4 1 9 5 2 7 4 e e e c 1 1 e 8 2 9 9 7 9 3 e 3 0 3 7 f 4 b 8 4 d 8 f b 4 b 5 c 5 c 9 3 9 2 b 6 3 e e 6 9 3 e d 5 7 1 3 4 3 4 0 7 0 7 4 4 b 1 a 4 4 e 1 4 a 6 a 5 0 9 0 d 6 5 5 9 1 7 c 1 d d 2 9 6 e 2 0 1 1 c d 9 9 e 3 c 3 1 6 e f 5 d 8 e e 3 9 5
H E A D _ R E F m a s t e r
P A T C H E S
f i x - I n s t a l l L i b P a t h . p a t c h
f l a g s . p a t c h
$ { p a t c h e s }
)
2020-05-09 04:55:11 +08:00
2022-03-29 02:46:02 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
vcpkg_list ( SET OPTIONS --disable-static )
else ( )
vcpkg_list ( SET OPTIONS --disable-shared )
endif ( )
2020-05-09 04:55:11 +08:00
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
)
endif ( )
2020-12-29 03:26:40 +08:00
2022-03-29 02:46:02 +08:00
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 ( )
2020-12-29 03:26:40 +08:00
2022-03-29 02:46:02 +08:00
vcpkg_configure_make (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
A U T O C O N F I G
O P T I O N S
- - 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
$ { O P T I O N S }
)
2020-10-29 05:26:41 +08:00
2022-03-29 02:46:02 +08:00
set ( tool_names des ecc ) # aes gcm sha twofish?
list ( TRANSFORM tool_names APPEND "data" )
list ( TRANSFORM tool_names APPEND "${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
2020-05-09 04:55:11 +08:00
2022-03-29 02:46:02 +08:00
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 ( )
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
2022-03-29 02:46:02 +08:00
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 ( )
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
2022-03-29 02:46:02 +08:00
file ( INSTALL "${SOURCE_PATH}/COPYINGv3"
D E S T I N A T I O N " $ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / $ { P O R T } "
R E N A M E c o p y r i g h t
)
2020-05-09 04:55:11 +08:00
2022-03-29 02:46:02 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_IS_LINUX )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin" )
2020-05-09 04:55:11 +08:00
endif ( )