From d0389326baeb862260c61c22172d9cc0069936ff Mon Sep 17 00:00:00 2001 From: Jackie Ng Date: Mon, 8 May 2017 21:45:27 +1000 Subject: [PATCH] Add podofo port --- ports/podofo/CONTROL | 4 ++++ ports/podofo/portfile.cmake | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 ports/podofo/CONTROL create mode 100644 ports/podofo/portfile.cmake diff --git a/ports/podofo/CONTROL b/ports/podofo/CONTROL new file mode 100644 index 000000000..dfb5446d1 --- /dev/null +++ b/ports/podofo/CONTROL @@ -0,0 +1,4 @@ +Source: podofo +Version: 0.9.5 +Description: PoDoFo is a library to work with the PDF file format +Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openssl, freetype, fontconfig \ No newline at end of file diff --git a/ports/podofo/portfile.cmake b/ports/podofo/portfile.cmake new file mode 100644 index 000000000..7c62ea07a --- /dev/null +++ b/ports/podofo/portfile.cmake @@ -0,0 +1,39 @@ +# Common Ambient Variables: +# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} +# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} +# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} +# PORT = current port name (zlib, etc) +# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) +# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) +# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) +# VCPKG_ROOT_DIR = +# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) +# + +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/podofo-0.9.5) +vcpkg_download_distfile(ARCHIVE + URLS "https://downloads.sourceforge.net/project/podofo/podofo/0.9.5/podofo-0.9.5.tar.gz" + FILENAME "podofo-0.9.5.tar.gz" + SHA512 d13b30bfebc89b809173cd2251eed1f15dfa90abb58371bfdce875797d40663923571824ad2b0b1d97aa1be212bdbb710c3a0439bc05bed7022b8eb75ca74705 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DPODOFO_BUILD_LIB_ONLY=1 -DPODOFO_BUILD_SHARED=1 + ) +elseif (VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS -DPODOFO_BUILD_LIB_ONLY=1 -DPODOFO_BUILD_STATIC=1 + ) +endif() + +vcpkg_install_cmake() + +# Handle copyright +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/podofo) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/podofo/COPYING ${CURRENT_PACKAGES_DIR}/share/podofo/copyright)