2020-02-05 03:32:03 +08:00
if ( VCPKG_TARGET_IS_LINUX )
2019-05-03 13:57:43 +08:00
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
2020-02-11 08:08:57 +08:00
R E F 6 0 0 1 8 8 8 0 4 9 c b 4 2 6 5 6 f 8 6 4 9 d b 0 2 0 e 8 0 4 b c d e c a 6 a 7 # v2.5.0
S H A 5 1 2 f f b c 7 f 1 b 1 6 b 7 4 6 9 d d f c 0 a f 0 0 5 4 a 7 8 9 1 f f d a 1 2 8 c c 0 9 9 e 6 9 3 7 7 3 c 6 b 4 5 9 7 e e 6 a 9 6 f 8 a 0 8 d 3 5 4 f 7 a 7 c f 3 a 1 f 1 6 3 6 9 b e f 7 b 7 a 9 4 c 2 6 7 0 a 6 1 7 e c 0 3 5 5 c c 3 6 1 4 f 5 6 e 1 6 6 8 d c 4
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
2023-03-07 07:44:04 +08:00
file ( COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}" )
file ( COPY "${CMAKE_CURRENT_LIST_DIR}/duktapeConfig.cmake.in" DESTINATION "${SOURCE_PATH}" )
file ( COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
2019-05-03 13:57:43 +08:00
2020-02-05 03:32:03 +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}" )
2020-02-05 03:32:03 +08:00
2023-03-07 07:44:04 +08:00
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 ( )
2020-02-05 03:32:03 +08:00
vcpkg_execute_required_process (
C O M M A N D $ { P Y T H O N 2 } t o o l s / c o n f i g u r e . p y - - s o u r c e - d i r e c t o r y s r c - i n p u t - - o u t p u t - d i r e c t o r y s r c - - c o n f i g - m e t a d a t a c o n f i g - D D U K _ U S E _ F A S T I N T
W O R K I N G _ D I R E C T O R Y $ { S O U R C E _ P A T H }
L O G N A M E p r e - c o n f i g u r e
)
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" )
2023-03-07 07:44:04 +08:00
file ( READ "${DUK_CONFIG_H_PATH}" CONTENT )
2019-10-08 01:35:13 +08:00
string ( REPLACE "#undef DUK_F_DLL_BUILD" "#define DUK_F_DLL_BUILD" CONTENT "${CONTENT}" )
2023-03-07 07:44:04 +08:00
file ( WRITE "${DUK_CONFIG_H_PATH}" "${CONTENT}" )
2019-10-08 01:35:13 +08:00
else ( )
set ( DUK_CONFIG_H_PATH "${SOURCE_PATH}/src/duk_config.h" )
2023-03-07 07:44:04 +08:00
file ( READ "${DUK_CONFIG_H_PATH}" CONTENT )
2019-10-08 01:35:13 +08:00
string ( REPLACE "#define DUK_F_DLL_BUILD" "#undef DUK_F_DLL_BUILD" CONTENT "${CONTENT}" )
2023-03-07 07:44:04 +08:00
file ( WRITE "${DUK_CONFIG_H_PATH}" "${CONTENT}" )
2019-10-08 01:35:13 +08:00
endif ( )
2017-07-15 02:37:25 +08:00
2023-03-07 07:44:04 +08:00
vcpkg_cmake_configure (
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
2023-03-07 07:44:04 +08:00
vcpkg_cmake_install ( )
2020-02-05 03:32:03 +08:00
vcpkg_copy_pdbs ( )
2017-07-15 02:37:25 +08:00
2023-03-07 07:44:04 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
2017-07-15 02:37:25 +08:00
2023-03-07 07:44:04 +08:00
vcpkg_cmake_config_fixup ( )
2017-07-15 02:37:25 +08:00
vcpkg_copy_pdbs ( )
2019-10-08 01:35:13 +08:00
2023-03-07 07:44:04 +08:00
file ( INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )