From b03d383e49c1288be78886a2406c6f01a7afc446 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Mon, 29 Nov 2021 21:02:52 +0100 Subject: [PATCH] [libflac] Fix pc file (#21675) * [libflac] fix pc file; remove m flag on windows and add version * version stuff --- ports/libflac/portfile.cmake | 33 ++++++++++++++++++++++----------- ports/libflac/vcpkg.json | 4 ++-- versions/baseline.json | 2 +- versions/l-/libflac.json | 5 +++++ 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/ports/libflac/portfile.cmake b/ports/libflac/portfile.cmake index 4f1ca9a3ad..cb88d85250 100644 --- a/ports/libflac/portfile.cmake +++ b/ports/libflac/portfile.cmake @@ -12,8 +12,8 @@ vcpkg_from_github( if(VCPKG_TARGET_IS_MINGW) set(WITH_STACK_PROTECTOR OFF) - string(APPEND VCPKG_C_FLAGS "-D_FORTIFY_SOURCE=0") - string(APPEND VCPKG_CXX_FLAGS "-D_FORTIFY_SOURCE=0") + string(APPEND VCPKG_C_FLAGS " -D_FORTIFY_SOURCE=0") + string(APPEND VCPKG_CXX_FLAGS " -D_FORTIFY_SOURCE=0") else() set(WITH_STACK_PROTECTOR ON) endif() @@ -50,31 +50,42 @@ vcpkg_fixup_cmake_targets( ) vcpkg_copy_pdbs() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC/export.h + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC/export.h" "#if defined(FLAC__NO_DLL)" "#if 0" ) - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h" "#if defined(FLAC__NO_DLL)" "#if 0" ) else() - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC/export.h + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC/export.h" "#if defined(FLAC__NO_DLL)" "#if 1" ) - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h" "#if defined(FLAC__NO_DLL)" "#if 1" ) endif() - -vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/flac.pc" "Version:" "Version: 1.3.3") +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/flac.pc" " -lm" "") +endif() +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/flac++.pc" "Version:" "Version: 1.3.3") +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac.pc") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac.pc" "Version:" "Version: 1.3.3") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac++.pc" "Version:" "Version: 1.3.3") + if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac.pc" " -lm" "") + endif() +endif() +vcpkg_fixup_pkgconfig() # This license (BSD) is relevant only for library - if someone would want to install # FLAC cmd line tools as well additional license (GPL) should be included -file(INSTALL ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${SOURCE_PATH}/COPYING.Xiph" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/libflac/vcpkg.json b/ports/libflac/vcpkg.json index 07073d8020..f2fc151891 100644 --- a/ports/libflac/vcpkg.json +++ b/ports/libflac/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libflac", - "version-string": "1.3.3", - "port-version": 6, + "version": "1.3.3", + "port-version": 7, "description": "Library for manipulating FLAC files", "homepage": "https://xiph.org/flac/", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index db3a92e880..7af3893b0c 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3446,7 +3446,7 @@ }, "libflac": { "baseline": "1.3.3", - "port-version": 6 + "port-version": 7 }, "libfort": { "baseline": "0.4.2", diff --git a/versions/l-/libflac.json b/versions/l-/libflac.json index 42a0867dc0..8dd6b40518 100644 --- a/versions/l-/libflac.json +++ b/versions/l-/libflac.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "040c261fb123656fc61f659e887a6db0fabc275e", + "version": "1.3.3", + "port-version": 7 + }, { "git-tree": "682527a63d829627895d16e12759a08c26687db7", "version-string": "1.3.3",