From c3e6d937e66098ad3114e94194efbe671849b4ab Mon Sep 17 00:00:00 2001 From: Dmitry Baryshev Date: Sat, 12 Dec 2020 01:17:43 +0300 Subject: [sail] Add new port (#14925) --- ports/sail/portfile.cmake | 42 ++++++++++++++++++++++++++++++++++++++++++ ports/sail/usage | 14 ++++++++++++++ ports/sail/vcpkg.json | 13 +++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 ports/sail/portfile.cmake create mode 100644 ports/sail/usage create mode 100644 ports/sail/vcpkg.json diff --git a/ports/sail/portfile.cmake b/ports/sail/portfile.cmake new file mode 100644 index 000000000..a5d5633ee --- /dev/null +++ b/ports/sail/portfile.cmake @@ -0,0 +1,42 @@ +vcpkg_fail_port_install(ON_TARGET "UWP" "OSX" "Linux") + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO smoked-herring/sail + REF v0.9.0-pre10 + SHA512 d38a3c7d33495c84d7ada91a4131d32ce61f3fdf32a7e0631b28e7d8492fa4cb672eea09ef8cf0272dabd57f640b090749e3ecd863be577af2b98763873dc57d + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSAIL_VCPKG_PORT=ON + -DSAIL_BUILD_EXAMPLES=OFF + -DSAIL_BUILD_TESTS=OFF +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +# Remove duplicate files +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share) + +# Move codecs +file(RENAME ${CURRENT_PACKAGES_DIR}/lib/sail ${CURRENT_PACKAGES_DIR}/bin/sail) +file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/sail ${CURRENT_PACKAGES_DIR}/debug/bin/sail) + +# Move cmake configs +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/sail) + +# Fix pkg-config files +vcpkg_fixup_pkgconfig() + +# Handle usage +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/sail/usage b/ports/sail/usage new file mode 100644 index 000000000..d117e68bc --- /dev/null +++ b/ports/sail/usage @@ -0,0 +1,14 @@ +The package sail provides CMake targets: + +C libraries: + + find_package(Sail CONFIG REQUIRED) + target_link_libraries(main PRIVATE SAIL::sail) + +C++ bindings: + + find_package(Sail CONFIG REQUIRED) + target_link_libraries(main PRIVATE SAIL::sail-c++) + +For dynamic builds, please also copy SAIL codecs (bin/sail) and their dependencies +into the application directory. diff --git a/ports/sail/vcpkg.json b/ports/sail/vcpkg.json new file mode 100644 index 000000000..01e6c6408 --- /dev/null +++ b/ports/sail/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "sail", + "version-string": "0.9.0-pre10", + "description": "The missing small and fast image decoding library for humans (not for machines)", + "homepage": "https://github.com/smoked-herring/sail", + "supports": "windows & !static & !uwp", + "dependencies": [ + "giflib", + "libjpeg-turbo", + "libpng", + "tiff" + ] +} -- cgit v1.2.3