diff options
Diffstat (limited to 'vcpkg/ports/taglib')
| -rw-r--r-- | vcpkg/ports/taglib/portfile.cmake | 50 | ||||
| -rw-r--r-- | vcpkg/ports/taglib/vcpkg.json | 19 |
2 files changed, 69 insertions, 0 deletions
diff --git a/vcpkg/ports/taglib/portfile.cmake b/vcpkg/ports/taglib/portfile.cmake new file mode 100644 index 0000000..7ce843b --- /dev/null +++ b/vcpkg/ports/taglib/portfile.cmake @@ -0,0 +1,50 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO taglib/taglib + REF "v${VERSION}" + SHA512 79f333dbe8ed44076010e33803e3418410516df4b70203962bbefea81ce0a6989a54a9791022488e64f1876573580cbe93920da4b2a7277d6a3f48c946e518fc + HEAD_REF master +) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(WINRT_OPTIONS -DHAVE_VSNPRINTF=1 -DPLATFORM_WINRT=1) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_TESTING=OFF + -DBUILD_EXAMPLES=OFF + ${WINRT_OPTIONS} +) +vcpkg_cmake_install() +vcpkg_fixup_pkgconfig() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/taglib) + +set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/taglib.pc") +if(EXISTS "${pcfile}") + vcpkg_replace_string("${pcfile}" "Requires: " "Requires: zlib" IGNORE_UNCHANGED) + vcpkg_replace_string("${pcfile}" " -lz" "") +endif() +set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/taglib.pc") +if(EXISTS "${pcfile}") + vcpkg_replace_string("${pcfile}" "Requires: " "Requires: zlib" IGNORE_UNCHANGED) + vcpkg_replace_string("${pcfile}" " -lz" "") +endif() + +# remove the debug/include files +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/taglib-config.cmd" "${CURRENT_PACKAGES_DIR}/debug/bin/taglib-config.cmd") # Contains absolute paths + +# remove bin directory for static builds (taglib creates a cmake batch file there) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/taglib/taglib_export.h" "defined(TAGLIB_STATIC)" "1") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +vcpkg_copy_pdbs() + +# copyright file +file(COPY "${SOURCE_PATH}/COPYING.LGPL" DESTINATION "${CURRENT_PACKAGES_DIR}/share/taglib") +file(COPY "${SOURCE_PATH}/COPYING.MPL" DESTINATION "${CURRENT_PACKAGES_DIR}/share/taglib") +file(RENAME "${CURRENT_PACKAGES_DIR}/share/taglib/COPYING.LGPL" "${CURRENT_PACKAGES_DIR}/share/taglib/copyright") diff --git a/vcpkg/ports/taglib/vcpkg.json b/vcpkg/ports/taglib/vcpkg.json new file mode 100644 index 0000000..61367df --- /dev/null +++ b/vcpkg/ports/taglib/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "taglib", + "version": "2.0.2", + "description": "TagLib Audio Meta-Data Library", + "homepage": "https://taglib.org/", + "license": "LGPL-2.1-only OR MPL-1.1", + "dependencies": [ + "utfcpp", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ] +} |