2020-05-09 04:55:11 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
vcpkg_from_github (
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 S h i f t M e d i a P r o j e c t / n e t t l e
2020-10-29 05:26:41 +08:00
R E F 1 d 0 a 6 e 6 4 e 0 1 4 5 8 f d f 3 7 e a f 5 d 9 0 9 7 5 d e b 5 2 c 3 d a 4 1 #v3.5.1
2020-05-09 04:55:11 +08:00
S H A 5 1 2 6 1 2 4 f b d 2 2 3 e 6 5 1 9 d 8 8 2 9 0 c 3 f 4 e 3 b 8 c c 3 9 9 e 0 3 8 c 9 c 7 7 c f e c 3 8 e 6 a b 1 7 b 0 7 5 8 4 6 e 6 6 2 f d 0 3 6 0 d 6 2 c 1 3 2 c 8 8 2 5 3 6 4 8 9 c 8 a 8 6 5 7 9 5 f 6 4 0 5 9 e 2 d 2 b 2 1 4 6 7 f 6 5 d 9 0 3 2 0 e 5 c 3 9
H E A D _ R E F m a s t e r
P A T C H E S g m p . p a t c h
n a m e . d i r . p a t c h
r u n t i m e . n e t t l e . p a t c h
r u n t i m e . h o g w e e d . p a t c h
)
2020-10-29 05:26:41 +08:00
include ( ${ CURRENT_INSTALLED_DIR } /share/yasm-tool-helper/yasm-tool-helper.cmake )
yasm_tool_helper ( OUT_VAR YASM )
file ( TO_NATIVE_PATH "${YASM}" YASM )
2020-05-09 04:55:11 +08:00
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 ( )
2020-10-29 05:26:41 +08:00
#Setup YASM integration
2020-05-09 04:55:11 +08:00
set ( _file "${SOURCE_PATH}/SMP/libnettle.vcxproj" )
file ( READ "${_file}" _contents )
string ( REPLACE [[<Import Project= "$(VCTargetsPath)\BuildCustomizations\yasm.props" />]]
" < I m p o r t P r o j e c t = \ " $ { C U R R E N T _ I N S T A L L E D _ D I R } / s h a r e / v s - y a s m / y a s m . p r o p s \ " / > "
_ c o n t e n t s " $ { _ c o n t e n t s } " )
string ( REPLACE [[<Import Project= "$(VCTargetsPath)\BuildCustomizations\yasm.targets" />]]
" < I m p o r t P r o j e c t = \ " $ { C U R R E N T _ I N S T A L L E D _ D I R } / s h a r e / v s - y a s m / y a s m . t a r g e t s \ " / > "
_ c o n t e n t s " $ { _ c o n t e n t s } " )
string ( REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_INSTALLED_DIR}/share" _contents "${_contents}" ) # Above already replaced by another triplet
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
STRING ( REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}" )
STRING ( REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}" )
else ( )
STRING ( REPLACE ">MultiThreadedDebug<" ">MultiThreadedDebugDLL<" _contents "${_contents}" )
STRING ( REPLACE ">MultiThreaded<" ">MultiThreadedDLL<" _contents "${_contents}" )
endif ( )
file ( WRITE "${_file}" "${_contents}" )
set ( _file "${SOURCE_PATH}/SMP/libhogweed.vcxproj" )
file ( READ "${_file}" _contents )
string ( REPLACE [[<Import Project= "$(VCTargetsPath)\BuildCustomizations\yasm.props" />]]
" < I m p o r t P r o j e c t = \ " $ { C U R R E N T _ I N S T A L L E D _ D I R } / s h a r e / v s - y a s m / y a s m . p r o p s \ " / > "
_ c o n t e n t s " $ { _ c o n t e n t s } " )
string ( REPLACE [[<Import Project= "$(VCTargetsPath)\BuildCustomizations\yasm.targets" />]]
" < I m p o r t P r o j e c t = \ " $ { C U R R E N T _ I N S T A L L E D _ D I R } / s h a r e / v s - y a s m / y a s m . t a r g e t s \ " / > "
_ c o n t e n t s " $ { _ c o n t e n t s } " )
string ( REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_INSTALLED_DIR}/share" _contents "${_contents}" ) # Above already replaced by another triplet
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
STRING ( REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}" )
STRING ( REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}" )
else ( )
STRING ( REPLACE ">MultiThreadedDebug<" ">MultiThreadedDebugDLL<" _contents "${_contents}" )
STRING ( REPLACE ">MultiThreaded<" ">MultiThreadedDLL<" _contents "${_contents}" )
endif ( )
file ( WRITE "${_file}" "${_contents}" )
2020-10-29 05:26:41 +08:00
2020-05-09 04:55:11 +08:00
vcpkg_install_msbuild (
U S E _ V C P K G _ I N T E G R A T I O N
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
P R O J E C T _ S U B P A T H S M P / l i b n e t t l e . s l n
P L A T F O R M $ { T R I P L E T _ S Y S T E M _ A R C H }
L I C E N S E _ S U B P A T H C O P Y I N G . L E S S E R v 3
T A R G E T R e b u i l d
R E L E A S E _ C O N F I G U R A T I O N $ { C O N F I G U R A T I O N _ R E L E A S E }
D E B U G _ C O N F I G U R A T I O N $ { C O N F I G U R A T I O N _ D E B U G }
S K I P _ C L E A N
2020-10-29 05:26:41 +08:00
O P T I O N S " / p : Y a s m P a t h = $ { Y A S M } "
2020-05-09 04:55:11 +08:00
)
get_filename_component ( SOURCE_PATH_SUFFIX "${SOURCE_PATH}" NAME )
file ( RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/include" "${CURRENT_PACKAGES_DIR}/include" )
set ( PACKAGE_VERSION 3.5.1 )
set ( prefix "${CURRENT_INSTALLED_DIR}" )
set ( exec_prefix "\${prefix}" )
set ( libdir "\${prefix}/lib" )
set ( includedir "\${prefix}/include" )
set ( LIBS -lnettle -lgmp )
configure_file ( "${SOURCE_PATH}/nettle.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/nettle.pc" @ONLY )
set ( HOGWEED -lhogweed )
set ( LIBS -lnettle )
configure_file ( "${SOURCE_PATH}/hogweed.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libhogweed.pc" @ONLY )
set ( prefix "${CURRENT_INSTALLED_DIR}/debug" )
set ( exec_prefix "\${prefix}" )
set ( libdir "\${prefix}/lib" )
set ( includedir "\${prefix}/../include" )
set ( LIBS -lnettled -lgmpd )
configure_file ( "${SOURCE_PATH}/nettle.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/nettle.pc" @ONLY )
set ( LIBS -lnettled )
set ( HOGWEED -lhogweedd )
configure_file ( "${SOURCE_PATH}/hogweed.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libhogweed.pc" @ONLY )
vcpkg_fixup_pkgconfig ( )
else ( )
vcpkg_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
2020-10-29 05:26:41 +08:00
R E F e e 5 d 6 2 8 9 8 c f 0 7 0 f 0 8 b e e d c 4 1 0 a 8 d 7 c 4 1 8 5 8 8 b d 9 5 #v3.5.1
2020-05-09 04:55:11 +08:00
S H A 5 1 2 8 8 1 9 1 2 5 4 8 f 4 a b b 2 1 4 6 0 f 4 4 3 3 4 d e 1 1 4 3 9 7 4 9 c 8 a 0 5 5 8 3 0 8 4 9 a 8 b e b 4 3 3 2 0 7 1 d 1 1 d 9 1 9 6 d 9 e e c a e b a 5 b f 8 2 2 8 1 9 d 2 4 2 3 5 6 0 8 3 f b a 9 1 e b 8 7 1 9 a 6 4 f 9 0 e 4 1 7 6 6 8 2 6 e 6 d 7 5 e 1
H E A D _ R E F m a s t e r # branch name
2020-09-28 09:27:49 +08:00
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
2020-05-09 04:55:11 +08:00
)
2020-10-29 05:26:41 +08:00
2020-10-13 06:22:48 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL dynamic )
set ( OPTIONS --disable-static )
else ( )
set ( OPTIONS --disable-shared )
endif ( )
2020-05-09 04:55:11 +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
2020-10-13 06:22:48 +08:00
- - d i s a b l e - o p e n s s l
2020-05-09 04:55:11 +08:00
$ { O P T I O N S }
)
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 )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_IS_LINUX )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin" )
endif ( )
endif ( )