From 44fac549c4bbd7592eed8c1f2cf7435265257890 Mon Sep 17 00:00:00 2001 From: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> Date: Thu, 2 Sep 2021 05:27:04 +0800 Subject: [libvpx] Add pkgconfig (#19355) * [libvpx] Add pkgconfig check * Update version files * Add vpx.pc.in on Windows * Update versions/l-/libvpx.json * Remove -lm from vpx.pc.in file * Update versions/l-/libvpx.json * Remove debug messages * Update versions/l-/libvpx.json --- ports/libvpx/portfile.cmake | 29 ++++++++++++++++++++--------- ports/libvpx/vcpkg.json | 1 + ports/libvpx/vpx.pc.in | 13 +++++++++++++ versions/baseline.json | 2 +- versions/l-/libvpx.json | 5 +++++ 5 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 ports/libvpx/vpx.pc.in diff --git a/ports/libvpx/portfile.cmake b/ports/libvpx/portfile.cmake index 59bf41fe4..2448cc6fb 100644 --- a/ports/libvpx/portfile.cmake +++ b/ports/libvpx/portfile.cmake @@ -33,7 +33,7 @@ vcpkg_add_to_path(${NASM_EXE_PATH}) if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") if(VCPKG_CRT_LINKAGE STREQUAL static) set(LIBVPX_CRT_LINKAGE --enable-static-msvcrt) @@ -71,7 +71,7 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) endif() message(STATUS "Generating makefile") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") vcpkg_execute_required_process( COMMAND ${BASH} --noprofile --norc @@ -126,11 +126,20 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) endif() file( INSTALL - ${LIBVPX_INCLUDE_DIR} + "${LIBVPX_INCLUDE_DIR}" DESTINATION "${CURRENT_PACKAGES_DIR}/include" RENAME "vpx") + if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + set(LIBVPX_PREFIX "${CURRENT_INSTALLED_DIR}") + configure_file("${CMAKE_CURRENT_LIST_DIR}/vpx.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/vpx.pc" @ONLY) + endif() + + if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + set(LIBVPX_PREFIX "${CURRENT_INSTALLED_DIR}/debug") + configure_file("${CMAKE_CURRENT_LIST_DIR}/vpx.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/vpx.pc" @ONLY) + endif() else() @@ -177,7 +186,7 @@ else() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") message(STATUS "Configuring libvpx for Release") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( COMMAND ${BASH} --noprofile --norc @@ -210,7 +219,7 @@ else() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") message(STATUS "Configuring libvpx for Debug") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( COMMAND ${BASH} --noprofile --norc @@ -238,17 +247,19 @@ else() LOGNAME install-${TARGET_TRIPLET}-dbg ) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/libvpx_g.a) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libvpx_g.a") endif() endif() +vcpkg_fixup_pkgconfig() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") set(LIBVPX_CONFIG_DEBUG ON) else() set(LIBVPX_CONFIG_DEBUG OFF) endif() -configure_file(${CMAKE_CURRENT_LIST_DIR}/unofficial-libvpx-config.cmake.in ${CURRENT_PACKAGES_DIR}/share/unofficial-libvpx/unofficial-libvpx-config.cmake @ONLY) +configure_file("${CMAKE_CURRENT_LIST_DIR}/unofficial-libvpx-config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/unofficial-libvpx/unofficial-libvpx-config.cmake" @ONLY) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/libvpx/vcpkg.json b/ports/libvpx/vcpkg.json index e92896356..ced530f21 100644 --- a/ports/libvpx/vcpkg.json +++ b/ports/libvpx/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libvpx", "version-semver": "1.10.0", + "port-version": 1, "description": "The reference software implementation for the video coding formats VP8 and VP9.", "homepage": "https://github.com/webmproject/libvpx" } diff --git a/ports/libvpx/vpx.pc.in b/ports/libvpx/vpx.pc.in new file mode 100644 index 000000000..c01bb2e9b --- /dev/null +++ b/ports/libvpx/vpx.pc.in @@ -0,0 +1,13 @@ +prefix=@LIBVPX_PREFIX@ +# pkg-config file from libvpx v1.10.0 +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: vpx +Description: WebM Project VPx codec implementation +Version: @LIBVPX_VERSION@ +Requires: +Conflicts: +Libs: -L"${libdir}" -lvpx +Cflags: -I"${includedir}" diff --git a/versions/baseline.json b/versions/baseline.json index dc1a5d388..58ff7af0a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3782,7 +3782,7 @@ }, "libvpx": { "baseline": "1.10.0", - "port-version": 0 + "port-version": 1 }, "libwandio": { "baseline": "4.2.1", diff --git a/versions/l-/libvpx.json b/versions/l-/libvpx.json index 2a678f182..e4aa292ed 100644 --- a/versions/l-/libvpx.json +++ b/versions/l-/libvpx.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "55be5e09000631b1dacd6f86d174eb2cade91bf5", + "version-semver": "1.10.0", + "port-version": 1 + }, { "git-tree": "ba9e1f9d346412c76f17d9fda5a3fbd5b5555afa", "version-semver": "1.10.0", -- cgit v1.2.3