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
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 "
2019-05-07 01:03:39 +08:00
S H A 5 1 2 9 9 5 2 0 d 2 2 3 8 1 9 7 0 8 b 8 f 6 e 4 b 8 3 9 d 1 f a 2 1 5 e 4 e 8 a d c 7 f c d 0 d b 6 c 2 5 a 0 3 9 9 c f 2 f a 1 0 0 3 4 b 3 5 6 7 3 c f 4 5 0 6 0 9 3 0 3 6 4 6 d 1 2 4 9 7 f 3 0 1 e f 5 3 b 7 e 7 c c 6 5 c 7 8 e 7 b c e 4 a f 0 c 6 7 3 5 5 5 a d
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-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 ( )