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
2019-05-22 12:00:24 +08:00
R E F v 2 . 3 . 0
S H A 5 1 2 d d 7 1 5 e a b 4 8 1 b 9 4 8 c f 7 1 d 3 a d 1 6 d 2 5 4 4 1 6 6 e b 5 3 d a 0 d f 8 9 3 6 a 4 a c 9 c 3 3 e 1 f 1 2 7 7 e f 6 e f e 5 4 2 7 8 2 a 4 c 7 f 6 8 9 f 6 c 0 c 8 9 6 3 d 7 0 9 4 7 4 9 a f 4 5 5 f f 6 a 8 c 5 9 5 9 3 a a 5 6 e b b 5 7 e 5 c 6 f
2019-05-03 13:57:43 +08:00
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 } )
2019-07-07 15:25:09 +08:00
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /duktapeConfig.cmake DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } )
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /usage DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } )
2019-05-03 13:57:43 +08:00
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
2019-08-17 08:22:04 +08:00
U R L S " h t t p s : / / b o o t s t r a p . p y p a . i o / 3 . 3 / g e t - p i p . p y "
2019-05-03 13:57:43 +08:00
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 "
2019-08-17 08:22:04 +08:00
S H A 5 1 2 9 2 e 6 8 5 2 5 8 3 0 b b 2 3 9 5 5 a 3 1 c b 1 9 e b c 3 0 2 1 e f 1 6 b 6 3 3 7 e a b 8 3 d 5 d b 2 9 6 1 b 7 9 1 2 8 3 d 2 8 6 7 2 0 7 5 4 5 f a f 8 3 6 3 5 f 6 0 2 7 f 2 f 7 b 7 f 8 f e e 2 c 8 5 f 2 c f d 8 e 8 2 6 7 d f 2 5 4 0 6 4 7 4 5 7 1 c 7 4 1
2019-05-03 13:57:43 +08:00
)
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-08-01 04:01:02 +08:00
P R E F E R _ N I N J A
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 ( )