2017-07-15 02:37:25 +08:00
include ( vcpkg_common_functions )
2019-05-03 13:57:43 +08:00
if ( VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" )
message ( "${PORT} currently requires the following tools from the system package manager:\n python-yaml\n\nThis can be installed on Ubuntu systems via apt-get install python-yaml PYTHON2-yaml (depending on your current python default interpreter)" )
endif ( )
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 v a a r a l a / d u k t a p e
R E F v 2 . 0 . 3
S H A 5 1 2 6 a d 1 8 9 f 6 f 9 2 9 1 c b d 7 e b 7 2 2 7 1 1 3 3 0 2 f d 0 c 2 0 4 0 1 8 6 1 1 b b 3 7 b f 4 a c d 7 f 6 b 0 e b 2 a 7 5 8 3 7 d a c 8 f b 9 f b a 4 4 1 a 0 d 7 6 e 6 f 1 d b a d 6 2 e 4 7 5 0 a 6 6 4 5 f 6 5 d e 3 1 6 1 1 b 0 8 9 f 6 9 2 2 b a d 2 6
H E A D _ R E F m a s t e r
2017-07-15 02:37:25 +08:00
)
2019-05-03 13:57:43 +08:00
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /CMakeLists.txt DESTINATION ${ SOURCE_PATH } )
if ( CMAKE_HOST_WIN32 )
set ( EXECUTABLE_SUFFIX ".exe" )
else ( )
set ( EXECUTABLE_SUFFIX "" )
endif ( )
vcpkg_find_acquire_program ( PYTHON2 )
get_filename_component ( PYTHON2_DIR "${PYTHON2}" DIRECTORY )
vcpkg_add_to_path ( "${PYTHON2_DIR}" )
if ( NOT EXISTS ${ PYTHON2_DIR } /easy_install ${ EXECUTABLE_SUFFIX } )
if ( NOT EXISTS ${ PYTHON2_DIR } /Scripts/pip ${ EXECUTABLE_SUFFIX } )
vcpkg_download_distfile ( GET_PIP
U R L S " h t t p s : / / b o o t s t r a p . p y p a . i o / g e t - p i p . p y "
F I L E N A M E " t o o l s / p y t h o n / p y t h o n 2 / g e t - p i p . p y "
S H A 5 1 2 f d b c e f 1 0 3 7 d c a 7 c c 9 1 4 e 2 3 0 4 a f 6 5 7 e b d 0 8 2 3 9 c d 1 8 c 3 e 7 9 7 8 6 d c 2 5 c 8 e a 3 9 9 5 7 6 7 4 e 0 1 2 d 7 e a 8 a e 2 c 9 9 0 0 6 e 4 b 6 1 d 3 a 5 e 2 4 6 6 9 a c 5 7 7 1 d c 1 8 6 6 9 7 f d 9 f d b 4 0 b 6 c c 0 7 a e
)
execute_process ( COMMAND ${ PYTHON2_DIR } /python ${ EXECUTABLE_SUFFIX } ${ PYTHON2_DIR } /get-pip.py )
endif ( )
execute_process ( COMMAND ${ PYTHON2_DIR } /Scripts/pip ${ EXECUTABLE_SUFFIX } install pyyaml )
else ( )
execute_process ( COMMAND ${ PYTHON2_DIR } /easy_install ${ EXECUTABLE_SUFFIX } pyyaml )
endif ( )
execute_process ( COMMAND ${ PYTHON2 } ${ SOURCE_PATH } /tools/configure.py --source-directory ${ SOURCE_PATH } /src-input --output-directory ${ SOURCE_PATH } /src --config-metadata ${ SOURCE_PATH } /config -DDUK_USE_FASTINT )
2017-07-15 02:37:25 +08:00
2017-07-19 08:20:01 +08:00
vcpkg_apply_patches (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
2019-05-03 13:57:43 +08:00
P A T C H E S
d u k _ c o n f i g . h . p a t c h
2017-07-19 08:20:01 +08:00
)
2017-07-15 02:37:25 +08:00
2017-07-15 04:36:48 +08:00
vcpkg_configure_cmake (
2019-05-03 13:57:43 +08:00
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
2017-07-15 04:36:48 +08:00
)
2017-07-15 02:37:25 +08:00
vcpkg_install_cmake ( )
2017-07-15 06:45:04 +08:00
set ( DUK_CONFIG_H_PATH "${CURRENT_PACKAGES_DIR}/include/duk_config.h" )
file ( READ ${ DUK_CONFIG_H_PATH } CONTENT )
2017-07-19 08:20:01 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL dynamic )
2018-05-08 07:30:48 +08:00
string ( REPLACE "// #undef DUK_F_DLL_BUILD" "#undef DUK_F_DLL_BUILD\n#define DUK_F_DLL_BUILD" CONTENT "${CONTENT}" )
2017-07-19 08:20:01 +08:00
else ( )
2018-05-08 07:30:48 +08:00
string ( REPLACE "// #undef DUK_F_DLL_BUILD" "#undef DUK_F_DLL_BUILD" CONTENT "${CONTENT}" )
2017-07-19 08:20:01 +08:00
endif ( )
2017-07-15 06:45:04 +08:00
file ( WRITE ${ DUK_CONFIG_H_PATH } "${CONTENT}" )
2017-07-15 02:37:25 +08:00
# Remove debug include
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
# Copy copright information
2017-07-15 04:38:37 +08:00
file ( INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/duktape" RENAME "copyright" )
2017-07-15 02:37:25 +08:00
vcpkg_copy_pdbs ( )