aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed John <ted@brambles.org>2017-07-14 19:37:25 +0100
committerTed John <ted@brambles.org>2017-07-14 19:54:41 +0100
commit94e262d3f635b557ffde09e97bbca2c173a8f440 (patch)
tree8f4da3eb2c3316523a4f210bf23909e425c39f0d
parent6950aeb6378adb47ff467a79d58ae8d4b5abe9cb (diff)
downloadvcpkg-94e262d3f635b557ffde09e97bbca2c173a8f440.tar.gz
vcpkg-94e262d3f635b557ffde09e97bbca2c173a8f440.zip
[duktape] Add port for duktape 2.0.3
-rw-r--r--ports/duktape/CMakeLists.txt23
-rw-r--r--ports/duktape/CONTROL4
-rw-r--r--ports/duktape/LICENSE25
-rw-r--r--ports/duktape/duk_config.h.patch13
-rw-r--r--ports/duktape/portfile.cmake37
5 files changed, 102 insertions, 0 deletions
diff --git a/ports/duktape/CMakeLists.txt b/ports/duktape/CMakeLists.txt
new file mode 100644
index 000000000..bbbe062cc
--- /dev/null
+++ b/ports/duktape/CMakeLists.txt
@@ -0,0 +1,23 @@
+# CMAKE project for duktape
+option(SOURCE_PATH "Root directory.")
+option(ENABLE_STATIC "Build a static library.")
+
+set (PROJECT duktape)
+project (${PROJECT})
+
+file(GLOB_RECURSE DUKTAPE_SOURCES "${SOURCE_PATH}/src/*.c")
+file(GLOB_RECURSE DUKTAPE_HEADERS "${SOURCE_PATH}/src/*.h")
+
+if (ENABLE_STATIC)
+ add_library(${PROJECT} STATIC ${DUKTAPE_SOURCES} ${DUKTAPE_HEADERS})
+else ()
+ add_definitions(-DDUK_F_DLL_BUILD)
+ add_library(${PROJECT} SHARED ${DUKTAPE_SOURCES})
+endif ()
+
+set_target_properties(${PROJECT} PROPERTIES PUBLIC_HEADER "${DUKTAPE_HEADERS}")
+
+install(TARGETS ${PROJECT}
+ ARCHIVE DESTINATION "lib"
+ RUNTIME DESTINATION "bin"
+ PUBLIC_HEADER DESTINATION "include")
diff --git a/ports/duktape/CONTROL b/ports/duktape/CONTROL
new file mode 100644
index 000000000..07ae7f1fe
--- /dev/null
+++ b/ports/duktape/CONTROL
@@ -0,0 +1,4 @@
+Source: duktape
+Version: 2.0.3-1
+Description: Embeddable Javascript engine with a focus on portability and compact footprint.
+Build-Depends:
diff --git a/ports/duktape/LICENSE b/ports/duktape/LICENSE
new file mode 100644
index 000000000..e8497318b
--- /dev/null
+++ b/ports/duktape/LICENSE
@@ -0,0 +1,25 @@
+===============
+Duktape license
+===============
+
+(http://opensource.org/licenses/MIT)
+
+Copyright (c) 2013-2017 by Duktape authors (see AUTHORS.rst)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/ports/duktape/duk_config.h.patch b/ports/duktape/duk_config.h.patch
new file mode 100644
index 000000000..d0be961ce
--- /dev/null
+++ b/ports/duktape/duk_config.h.patch
@@ -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__)
diff --git a/ports/duktape/portfile.cmake b/ports/duktape/portfile.cmake
new file mode 100644
index 000000000..8b7819524
--- /dev/null
+++ b/ports/duktape/portfile.cmake
@@ -0,0 +1,37 @@
+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})
+
+# Patch duk_config.h to remove 'undef DUK_F_DLL_BUILD'
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES "${CMAKE_CURRENT_LIST_DIR}/duk_config.h.patch"
+)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ vcpkg_configure_cmake(
+ SOURCE_PATH ${CMAKE_PATH}
+ OPTIONS -DENABLE_STATIC=OFF -DSOURCE_PATH=${SOURCE_PATH}
+ )
+else()
+ vcpkg_configure_cmake(
+ SOURCE_PATH ${CMAKE_PATH}
+ OPTIONS -DENABLE_STATIC=ON -DSOURCE_PATH=${SOURCE_PATH}
+ )
+endif()
+
+vcpkg_install_cmake()
+
+# Remove debug include
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Copy copright information
+file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/duktape RENAME copyright)
+
+vcpkg_copy_pdbs()