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)" )
2019-10-08 01:35:13 +08:00
endif ( )
2019-05-03 13:57:43 +08:00
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-08-29 04:10:44 +08:00
R E F v 2 . 4 . 0
S H A 5 1 2 5 f 4 2 f f 6 f a a b 8 d 4 9 5 3 1 4 2 3 e 1 9 9 c 0 3 2 f d 2 d e 4 9 5 2 4 b a b 7 1 f 3 9 d 1 c f 8 2 2 e 6 f 9 e e 8 2 a 6 0 8 9 c 9 a 9 3 8 3 7 a e 7 8 4 9 d 1 9 a 9 5 6 9 3 3 1 8 a 8 4 8 0 9 8 6 e 4 6 7 2 f 6 f 7 3 f 3 1 8 2 b 4 9 0 2 e 6 b 2 d a a
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-10-08 01:35:13 +08:00
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /duktapeConfig.cmake.in DESTINATION ${ SOURCE_PATH } )
2019-07-07 15:25:09 +08:00
file ( COPY ${ CMAKE_CURRENT_LIST_DIR } /usage DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } )
2019-05-03 13:57:43 +08:00
2019-10-29 02:03:30 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
2019-05-03 13:57:43 +08:00
set ( EXECUTABLE_SUFFIX ".exe" )
2019-10-29 02:03:30 +08:00
set ( PYTHON_OPTION "" )
2019-05-03 13:57:43 +08:00
else ( )
set ( EXECUTABLE_SUFFIX "" )
2019-10-29 02:03:30 +08:00
set ( PYTHON_OPTION "--user" )
2019-05-03 13:57:43 +08:00
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 } )
2019-10-08 01:35:13 +08:00
vcpkg_from_github (
O U T _ S O U R C E _ P A T H P Y F I L E _ P A T H
R E P O p y p a / g e t - p i p
R E F 3 0 9 a 5 6 c 5 f d 9 4 b d 1 1 3 4 0 5 3 a 5 4 1 c b 4 6 5 7 a 4 e 4 7 e 0 9 d #2019-08-25
S H A 5 1 2 b b 4 b 0 7 4 5 9 9 8 a 3 2 0 5 c d 0 f 0 9 6 3 c 0 4 f b 4 5 f 4 6 1 4 b a 3 b 6 f c b e 9 7 e f e 8 f 8 6 1 4 1 9 2 f 2 4 4 b 7 a e 6 2 7 0 5 4 8 3 a 5 3 0 5 9 4 3 d 6 c 8 f e d e c a 5 3 b 2 e 9 9 0 5 a e d 9 1 8 d 2 c 6 1 0 6 f 8 a 9 6 8 0 1 8 4 c 7 a
H E A D _ R E F m a s t e r
)
2019-10-29 02:03:30 +08:00
execute_process ( COMMAND ${ PYTHON2_DIR } /python ${ EXECUTABLE_SUFFIX } ${ PYFILE_PATH } /get-pip.py ${ PYTHON_OPTION } )
2019-05-03 13:57:43 +08:00
endif ( )
2019-10-29 02:03:30 +08:00
execute_process ( COMMAND ${ PYTHON2_DIR } /Scripts/pip ${ EXECUTABLE_SUFFIX } install pyyaml ${ PYTHON_OPTION } )
2019-05-03 13:57:43 +08:00
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
2019-10-08 01:35:13 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL dynamic )
set ( DUK_CONFIG_H_PATH "${SOURCE_PATH}/src/duk_config.h" )
file ( READ ${ DUK_CONFIG_H_PATH } CONTENT )
string ( REPLACE "#undef DUK_F_DLL_BUILD" "#define DUK_F_DLL_BUILD" CONTENT "${CONTENT}" )
file ( WRITE ${ DUK_CONFIG_H_PATH } "${CONTENT}" )
else ( )
set ( DUK_CONFIG_H_PATH "${SOURCE_PATH}/src/duk_config.h" )
file ( READ ${ DUK_CONFIG_H_PATH } CONTENT )
string ( REPLACE "#define DUK_F_DLL_BUILD" "#undef DUK_F_DLL_BUILD" CONTENT "${CONTENT}" )
file ( WRITE ${ DUK_CONFIG_H_PATH } "${CONTENT}" )
endif ( )
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 ( )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
2019-10-08 01:35:13 +08:00
vcpkg_fixup_cmake_targets ( )
2017-07-15 02:37:25 +08:00
vcpkg_copy_pdbs ( )
2019-10-08 01:35:13 +08:00
file ( INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )