From 5746100fdc746523dd6cb1bac2cd1c0a50e0c253 Mon Sep 17 00:00:00 2001 From: OgreTransporter Date: Wed, 11 Nov 2020 18:01:03 +0100 Subject: [PATCH] [libosmscout] Add new port (#14485) * [libosmscout] Add new port * [libosmscout] Update manifest format * Update ports/libosmscout/portfile.cmake Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com> * Qt feature removed due to problems with various configurations. * Change of line ends from Windows to Linux * Disable ARM, UWP and static * Update support tag Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com> --- ports/libosmscout/portfile.cmake | 49 ++++++++++++++++++++++++++++++++ ports/libosmscout/vcpkg.json | 41 ++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 ports/libosmscout/portfile.cmake create mode 100644 ports/libosmscout/vcpkg.json diff --git a/ports/libosmscout/portfile.cmake b/ports/libosmscout/portfile.cmake new file mode 100644 index 0000000000..20125753c1 --- /dev/null +++ b/ports/libosmscout/portfile.cmake @@ -0,0 +1,49 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Framstag/libosmscout + REF c81e1d9a0f69cc5b93588dbe330b2af587162c5f + SHA512 d6ddbc49dd40b1f938ae2cd1ea9342cab0a52db46bf7ed6716111a91d0a38acba12ff2e273d457db51fc240d578a5b849af77b53e600482cf52c3b22306f8c45 + HEAD_REF master +) + +if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + cairo OSMDCOUT_BUILD_MAP_CAIRO + directx OSMDCOUT_BUILD_MAP_DIRECTX + gdi OSMDCOUT_BUILD_MAP_GDI + svg OSMDCOUT_BUILD_MAP_SVG + ) +else() + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + cairo OSMDCOUT_BUILD_MAP_CAIRO + svg OSMDCOUT_BUILD_MAP_SVG + ) + list(APPEND FEATURE_OPTIONS -DOSMDCOUT_BUILD_MAP_DIRECTX=OFF -DOSMDCOUT_BUILD_MAP_GDI=OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DOSMSCOUT_BUILD_DEMOS=OFF + -DOSMSCOUT_BUILD_TOOL_DUMPDATA=OFF + -DOSMSCOUT_BUILD_TOOL_IMPORT=ON + -DOSMSCOUT_BUILD_TOOL_OSMSCOUT2=OFF + -DOSMSCOUT_BUILD_TOOL_OSMSCOUTOPENGL=OFF + -DOSMSCOUT_BUILD_TOOL_PUBLICTRANSPORTMAP=OFF + -DOSMSCOUT_BUILD_TOOL_STYLEEDITOR=OFF + -DOSMSCOUT_BUILD_EXTERN_MATLAB=OFF + -DOSMSCOUT_BUILD_TESTS=OFF + -DOSMDCOUT_BUILD_MAP_QT=OFF + ${FEATURE_OPTIONS} +) + +vcpkg_install_cmake() +vcpkg_copy_tools(TOOL_NAMES Import AUTO_CLEAN) +vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/libosmscout) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/BasemapImport.exe") +file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/BasemapImport.exe") diff --git a/ports/libosmscout/vcpkg.json b/ports/libosmscout/vcpkg.json new file mode 100644 index 0000000000..7a80efed0c --- /dev/null +++ b/ports/libosmscout/vcpkg.json @@ -0,0 +1,41 @@ +{ + "name": "libosmscout", + "version-string": "1.1.1", + "description": "libosmscout offers applications simple, high-level interfaces for offline location and POI lokup, rendering and routing functionalities based on OpenStreetMap (OSM) data.", + "homepage": "http://libosmscout.sourceforge.net/", + "documentation": "http://libosmscout.sourceforge.net/documentation/", + "supports": "!uwp & !arm & !arm64 & !static & !wasm32 & !emscripten", + "dependencies": [ + "libiconv", + "liblzma", + "libxml2", + "protobuf", + "zlib" + ], + "features": { + "cairo": { + "description": "Cairo backend renderer", + "dependencies": [ + "cairo", + "freetype", + "harfbuzz", + "libpng", + "pango" + ] + }, + "directx": { + "description": "Direct2D backend renderer" + }, + "gdi": { + "description": "GDI+ backend renderer" + }, + "svg": { + "description": "SVG backend renderer", + "dependencies": [ + "freetype", + "harfbuzz", + "pango" + ] + } + } +}