aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormyd7349 <myd7349@gmail.com>2019-05-17 05:35:45 +0800
committerVictor Romero <romerosanchezv@gmail.com>2019-05-16 14:35:45 -0700
commit8dfbc5322f03592aac68e2331bbfe657fd854bdf (patch)
tree7af8f0da36a224db50bd1188e3183aadd8b89429
parent7cf8af8d3704d39729fb65813901b2317427e07b (diff)
downloadvcpkg-8dfbc5322f03592aac68e2331bbfe657fd854bdf.tar.gz
vcpkg-8dfbc5322f03592aac68e2331bbfe657fd854bdf.zip
[zserge-webview] Add new port (#6239)
* [webview] Add new port * [zserge-webview] Update to 2019-04-27 * [zserge-webview] Fix Linux, macOS support
-rw-r--r--ports/zserge-webview/CONTROL3
-rw-r--r--ports/zserge-webview/portfile.cmake58
2 files changed, 61 insertions, 0 deletions
diff --git a/ports/zserge-webview/CONTROL b/ports/zserge-webview/CONTROL
new file mode 100644
index 000000000..558f47bd7
--- /dev/null
+++ b/ports/zserge-webview/CONTROL
@@ -0,0 +1,3 @@
+Source: zserge-webview
+Version: 2019-04-27-1
+Description: Tiny cross-platform webview library for C/C++/Golang.
diff --git a/ports/zserge-webview/portfile.cmake b/ports/zserge-webview/portfile.cmake
new file mode 100644
index 000000000..d6707ee8b
--- /dev/null
+++ b/ports/zserge-webview/portfile.cmake
@@ -0,0 +1,58 @@
+# header-only library
+
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO zserge/webview
+ REF 16c93bcaeaeb6aa7bb5a1432de3bef0b9ecc44f3
+ SHA512 153824bd444eafe6cc5ae00800422b41d4047dc85a164c465990c3be06d82003b532e1e869bb40e3a77cbe4789ff970fcda50ef00ac7b3e2f22ef3f566340026
+ HEAD_REF master
+)
+
+file(COPY ${SOURCE_PATH}/webview.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)
+
+set(WEBVIEW_GTK "0")
+set(WEBVIEW_WINAPI "0")
+set(WEBVIEW_COCOA "0")
+
+if(WIN32)
+ set(WEBVIEW_WINAPI "1")
+elseif(UNIX)
+ if(APPLE)
+ set(WEBVIEW_COCOA "1")
+ else()
+ set(WEBVIEW_GTK "1")
+ endif()
+endif()
+
+file(READ ${CURRENT_PACKAGES_DIR}/include/webview.h _contents)
+string(REPLACE
+ "#ifdef WEBVIEW_STATIC"
+ "#if 1 // #ifdef WEBVIEW_STATIC"
+ _contents "${_contents}"
+)
+string(REPLACE
+ "#ifdef WEBVIEW_IMPLEMENTATION"
+ "#if 1 // #ifdef WEBVIEW_IMPLEMENTATION"
+ _contents "${_contents}"
+)
+string(REPLACE
+ "defined(WEBVIEW_GTK)"
+ "${WEBVIEW_GTK} // defined(WEBVIEW_GTK)"
+ _contents "${_contents}"
+)
+string(REPLACE
+ "defined(WEBVIEW_WINAPI)"
+ "${WEBVIEW_WINAPI} // defined(WEBVIEW_WINAPI)"
+ _contents "${_contents}"
+)
+string(REPLACE
+ "defined(WEBVIEW_COCOA)"
+ "${WEBVIEW_COCOA} // defined(WEBVIEW_COCOA)"
+ _contents "${_contents}"
+)
+file(WRITE ${CURRENT_PACKAGES_DIR}/include/webview.h "${_contents}")
+
+# Handle copyright
+configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)