aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheney Wang <38240633+Cheney-W@users.noreply.github.com>2021-01-13 12:05:11 +0800
committerGitHub <noreply@github.com>2021-01-12 20:05:11 -0800
commite819d336250267bbd31e47e4c3e9056efef516b8 (patch)
tree461029bb131710c269d9e9f54f282256470d567f
parent3fcfccf0ca97cfd3e9f98da5d152e2d38d75ed34 (diff)
downloadvcpkg-e819d336250267bbd31e47e4c3e9056efef516b8.tar.gz
vcpkg-e819d336250267bbd31e47e4c3e9056efef516b8.zip
[poppler] Fix error gperf is not recognized as an internal or external command (#15574)
Co-authored-by: Cheney-Wang <v-xincwa@microsoft.com>
-rw-r--r--ports/poppler/0003-fix-gperf-not-recognized.patch15
-rw-r--r--ports/poppler/portfile.cmake5
-rw-r--r--ports/poppler/vcpkg.json2
3 files changed, 21 insertions, 1 deletions
diff --git a/ports/poppler/0003-fix-gperf-not-recognized.patch b/ports/poppler/0003-fix-gperf-not-recognized.patch
new file mode 100644
index 000000000..e6edf39e7
--- /dev/null
+++ b/ports/poppler/0003-fix-gperf-not-recognized.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cce875a..0b04be7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -530,8 +530,8 @@ endif()
+ if (GPERF AND RUN_GPERF_IF_PRESENT)
+ macro(ADD_GPERF_FILE input)
+ add_custom_command(OUTPUT poppler/${input}.c
+- COMMAND gperf poppler/${input}.gperf > ${CMAKE_CURRENT_BINARY_DIR}/poppler/${input}.c
+- COMMAND gperf poppler/${input}.gperf > ${CMAKE_CURRENT_SOURCE_DIR}/poppler/${input}.pregenerated.c
++ COMMAND ${GPERF} poppler/${input}.gperf > ${CMAKE_CURRENT_BINARY_DIR}/poppler/${input}.c
++ COMMAND ${GPERF} poppler/${input}.gperf > ${CMAKE_CURRENT_SOURCE_DIR}/poppler/${input}.pregenerated.c
+ COMMAND clang-format -i ${CMAKE_CURRENT_SOURCE_DIR}/poppler/${input}.pregenerated.c || true
+ DEPENDS poppler/${input}.gperf
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/ports/poppler/portfile.cmake b/ports/poppler/portfile.cmake
index 89345f0a0..4d5b58dee 100644
--- a/ports/poppler/portfile.cmake
+++ b/ports/poppler/portfile.cmake
@@ -7,8 +7,13 @@ vcpkg_from_github(
PATCHES
0001-remove-CMAKE_CXX_STANDARD.patch
0002-remove-test-subdirectory.patch
+ 0003-fix-gperf-not-recognized.patch
)
+vcpkg_find_acquire_program(GPERF)
+get_filename_component(GPERF_PATH ${GPERF} DIRECTORY)
+vcpkg_add_to_path(${GPERF_PATH})
+
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
curl ENABLE_CURL
zlib ENABLE_ZLIB
diff --git a/ports/poppler/vcpkg.json b/ports/poppler/vcpkg.json
index 71cb470c5..788c88abc 100644
--- a/ports/poppler/vcpkg.json
+++ b/ports/poppler/vcpkg.json
@@ -1,7 +1,7 @@
{
"name": "poppler",
"version-string": "20.12.1",
- "port-version": 1,
+ "port-version": 2,
"description": "a PDF rendering library",
"homepage": "https://poppler.freedesktop.org/",
"dependencies": [