mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-24 03:27:12 +01:00
Merge pull request #1460 from IntelOrca/ports/add-duktape
[duktape] Add port for duktape 2.0.3
This commit is contained in:
commit
e876a561aa
20
ports/duktape/CMakeLists.txt
Normal file
20
ports/duktape/CMakeLists.txt
Normal file
@ -0,0 +1,20 @@
|
||||
# CMAKE project for duktape
|
||||
option(SOURCE_PATH "Root directory.")
|
||||
|
||||
project (duktape)
|
||||
|
||||
file(GLOB_RECURSE DUKTAPE_SOURCES "${SOURCE_PATH}/src/*.c")
|
||||
file(GLOB_RECURSE DUKTAPE_HEADERS "${SOURCE_PATH}/src/*.h")
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_definitions(-DDUK_F_DLL_BUILD)
|
||||
endif ()
|
||||
|
||||
add_library(duktape ${DUKTAPE_SOURCES} ${DUKTAPE_HEADERS})
|
||||
|
||||
set_target_properties("duktape" PROPERTIES PUBLIC_HEADER "${DUKTAPE_HEADERS}")
|
||||
|
||||
install(TARGETS duktape
|
||||
ARCHIVE DESTINATION "lib"
|
||||
RUNTIME DESTINATION "bin"
|
||||
PUBLIC_HEADER DESTINATION "include")
|
4
ports/duktape/CONTROL
Normal file
4
ports/duktape/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: duktape
|
||||
Version: 2.0.3-3
|
||||
Description: Embeddable Javascript engine with a focus on portability and compact footprint.
|
||||
Build-Depends:
|
13
ports/duktape/duk_config.h.patch
Normal file
13
ports/duktape/duk_config.h.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/src/duk_config.h b/src/duk_config.h
|
||||
index a942563..8d3d309 100644
|
||||
--- a/src/duk_config.h
|
||||
+++ b/src/duk_config.h
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
/* DLL build detection */
|
||||
/* not configured for DLL build */
|
||||
-#undef DUK_F_DLL_BUILD
|
||||
+// #undef DUK_F_DLL_BUILD
|
||||
|
||||
/* Apple OSX, iOS */
|
||||
#if defined(__APPLE__)
|
38
ports/duktape/portfile.cmake
Normal file
38
ports/duktape/portfile.cmake
Normal file
@ -0,0 +1,38 @@
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/duktape-2.0.3)
|
||||
set(CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||
vcpkg_download_distfile(ARCHIVE_FILE
|
||||
URLS "https://github.com/svaarala/duktape/releases/download/v2.0.3/duktape-2.0.3.tar.xz"
|
||||
FILENAME "duktape-2.0.3.tar.xz"
|
||||
SHA512 ba21731242d953d82c677e1205e3596e270e6d57156a0bca8068fc3b6a35996af69bcfac979b871a7e3eab31f28a06cb99078f0b3eaac54be9c5899f57f4100e
|
||||
)
|
||||
vcpkg_extract_source_archive(${ARCHIVE_FILE})
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/duk_config.h.patch"
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${CMAKE_PATH}
|
||||
OPTIONS -DSOURCE_PATH=${SOURCE_PATH}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
set(DUK_CONFIG_H_PATH "${CURRENT_PACKAGES_DIR}/include/duk_config.h")
|
||||
file(READ ${DUK_CONFIG_H_PATH} CONTENT)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
string(REPLACE "// #undef DUK_F_DLL_BUILD" "#undef DUK_F_DLL_BUILD\n#define DUK_F_DLL_BUILD 1" CONTENT "${CONTENT}")
|
||||
else()
|
||||
string(REPLACE "// #undef DUK_F_DLL_BUILD" "#undef DUK_F_DLL_BUILD\n#define DUK_F_DLL_BUILD 0" CONTENT "${CONTENT}")
|
||||
endif()
|
||||
file(WRITE ${DUK_CONFIG_H_PATH} "${CONTENT}")
|
||||
|
||||
# Remove debug include
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Copy copright information
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/duktape" RENAME "copyright")
|
||||
|
||||
vcpkg_copy_pdbs()
|
Loading…
x
Reference in New Issue
Block a user