[libharu] Fix renaming library when one of the build type is selected (#19979)

* libharu: Fix renaming library when build type is either release or debug

Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com>

* Run vcpkg x-add-version --all

* Small changes

Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com>
This commit is contained in:
Jafar Abdi 2021-09-08 07:48:24 +03:00 committed by GitHub
parent d1657f4c9b
commit e8661320ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 29 deletions

View File

@ -1,10 +0,0 @@
Source: libharu
Version: 2017-08-15-9
Homepage: https://github.com/libharu/libharu
Description: libharu - free PDF library
Build-Depends: zlib, libpng
Default-Features: notiffsymbols
Feature: notiffsymbols
Description: disable symbols also defined by the tiff port
Build-Depends: tiff

View File

@ -31,34 +31,41 @@ else()
set(VCPKG_BUILD_STATIC_LIBS ON)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DLIBHPDF_STATIC=${VCPKG_BUILD_STATIC_LIBS}
-DLIBHPDF_SHARED=${VCPKG_BUILD_SHARED_LIBS}
)
vcpkg_install_cmake()
vcpkg_cmake_install()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libhpdfs.lib ${CURRENT_PACKAGES_DIR}/lib/libhpdf.lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfsd.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfd.lib)
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libhpdfs.lib" "${CURRENT_PACKAGES_DIR}/lib/libhpdf.lib")
endif()
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfsd.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfd.lib")
endif()
else()
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libhpdfs.a ${CURRENT_PACKAGES_DIR}/lib/libhpdf.a)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfs.a ${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfd.a)
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/libhpdfs.a" "${CURRENT_PACKAGES_DIR}/lib/libhpdf.a")
endif()
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfs.a" "${CURRENT_PACKAGES_DIR}/debug/lib/libhpdfd.a")
endif()
endif()
endif()
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/README
${CURRENT_PACKAGES_DIR}/debug/CHANGES
${CURRENT_PACKAGES_DIR}/debug/INSTALL
${CURRENT_PACKAGES_DIR}/README
${CURRENT_PACKAGES_DIR}/CHANGES
${CURRENT_PACKAGES_DIR}/INSTALL
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/README"
"${CURRENT_PACKAGES_DIR}/debug/CHANGES"
"${CURRENT_PACKAGES_DIR}/debug/INSTALL"
"${CURRENT_PACKAGES_DIR}/README"
"${CURRENT_PACKAGES_DIR}/CHANGES"
"${CURRENT_PACKAGES_DIR}/INSTALL"
)
file(READ "${CURRENT_PACKAGES_DIR}/include/hpdf.h" _contents)
@ -77,6 +84,5 @@ else()
endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/include/hpdf_types.h" "${_contents}")
file(INSTALL ${SOURCE_PATH}/LICENCE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libharu RENAME copyright)
vcpkg_copy_pdbs()
file(INSTALL "${SOURCE_PATH}/LICENCE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

26
ports/libharu/vcpkg.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "libharu",
"version-string": "2017-08-15",
"port-version": 10,
"description": "libharu - free PDF library",
"homepage": "https://github.com/libharu/libharu",
"dependencies": [
"libpng",
{
"name": "vcpkg-cmake",
"host": true
},
"zlib"
],
"default-features": [
"notiffsymbols"
],
"features": {
"notiffsymbols": {
"description": "disable symbols also defined by the tiff port",
"dependencies": [
"tiff"
]
}
}
}

View File

@ -3305,8 +3305,8 @@
"port-version": 0
},
"libharu": {
"baseline": "2017-08-15-9",
"port-version": 0
"baseline": "2017-08-15",
"port-version": 10
},
"libhdfs3": {
"baseline": "2019-11-05",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "312f4b697d2f46818c218e270bd447cdeb76322c",
"version-string": "2017-08-15",
"port-version": 10
},
{
"git-tree": "61662ee1cfa10c3e5244a43e24eb1f47e524c293",
"version-string": "2017-08-15-9",