aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/libkml/CONTROL4
-rw-r--r--ports/libkml/patch_empty_literal_on_vc.patch13
-rw-r--r--ports/libkml/portfile.cmake27
3 files changed, 44 insertions, 0 deletions
diff --git a/ports/libkml/CONTROL b/ports/libkml/CONTROL
new file mode 100644
index 000000000..1fe7086af
--- /dev/null
+++ b/ports/libkml/CONTROL
@@ -0,0 +1,4 @@
+Source: libkml
+Version: 1.3.0
+Description: Reference implementation of OGC KML 2.2
+Build-Depends: zlib, boost, expat, minizip, uriparser
diff --git a/ports/libkml/patch_empty_literal_on_vc.patch b/ports/libkml/patch_empty_literal_on_vc.patch
new file mode 100644
index 000000000..8a3581a05
--- /dev/null
+++ b/ports/libkml/patch_empty_literal_on_vc.patch
@@ -0,0 +1,13 @@
+diff --git a/src/kml/base/file_win32.cc b/src/kml/base/file_win32.cc
+index c46e099..28ccb36 100644
+--- a/src/kml/base/file_win32.cc
++++ b/src/kml/base/file_win32.cc
+@@ -42,7 +42,7 @@ namespace kmlbase {
+ // Internal to the win32 file class. We need a conversion from string to
+ // LPCWSTR.
+ static std::wstring Str2Wstr(const string& str) {
+- std::wstring wstr(str.length(), L'');
++ std::wstring wstr(str.length(), L' ');
+ std::copy(str.begin(), str.end(), wstr.begin());
+ return wstr;
+ }
diff --git a/ports/libkml/portfile.cmake b/ports/libkml/portfile.cmake
new file mode 100644
index 000000000..cb07e271f
--- /dev/null
+++ b/ports/libkml/portfile.cmake
@@ -0,0 +1,27 @@
+include(vcpkg_common_functions)
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO libkml/libkml
+ REF 1.3.0
+ SHA512 aa48158103d3af764bf98c1fb4cf3e1356b9cc6c8e79d80b96850916f0a8ccb1dac3a46427735dd0bf20647daa047d10e722ac3da2a214d4c1559bf6d5d7c853
+ HEAD_REF master
+)
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES
+ "${CMAKE_CURRENT_LIST_DIR}/patch_empty_literal_on_vc.patch"
+)
+
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+vcpkg_copy_pdbs()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libkml RENAME copyright)