2019-11-22 02:03:32 +01:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO xiph/flac
|
2023-02-13 10:37:00 -05:00
|
|
|
REF "${VERSION}"
|
2023-10-03 11:23:53 +08:00
|
|
|
SHA512 3571467a1d557bc03eade2ae9bb1a72fd94a89222e6ad9563078d646aac0b65ed1c3d829fb45dd3a6cdca806f7ba3b6393f0ce6571b43651959acaa1c2106396
|
2019-11-22 02:03:32 +01:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
2020-10-28 11:34:03 +08:00
|
|
|
fix-compile-options.patch
|
2019-11-22 02:03:32 +01:00
|
|
|
)
|
|
|
|
|
2020-10-28 11:34:03 +08:00
|
|
|
if("asm" IN_LIST FEATURES)
|
2023-02-13 10:37:00 -05:00
|
|
|
vcpkg_find_acquire_program(NASM)
|
|
|
|
get_filename_component(NASM_PATH "${NASM}" DIRECTORY)
|
2020-11-10 18:34:50 +01:00
|
|
|
vcpkg_add_to_path("${NASM_PATH}")
|
2020-10-28 11:34:03 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2022-04-27 10:26:07 +08:00
|
|
|
FEATURES
|
|
|
|
asm WITH_ASM
|
2024-03-05 11:06:46 +01:00
|
|
|
stack-protector WITH_STACK_PROTECTOR
|
2020-10-28 11:34:03 +08:00
|
|
|
)
|
|
|
|
|
2022-04-27 10:26:07 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2022-07-29 00:19:48 +02:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2020-05-21 23:19:21 +05:00
|
|
|
-DBUILD_PROGRAMS=OFF
|
|
|
|
-DBUILD_EXAMPLES=OFF
|
|
|
|
-DBUILD_DOCS=OFF
|
2020-07-31 14:23:27 -04:00
|
|
|
-DBUILD_TESTING=OFF
|
2022-07-29 00:19:48 +02:00
|
|
|
-DINSTALL_MANPAGES=OFF
|
|
|
|
)
|
2019-11-22 02:03:32 +01:00
|
|
|
|
2022-04-27 10:26:07 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
|
2023-02-13 10:37:00 -05:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME FLAC CONFIG_PATH lib/cmake/FLAC)
|
2020-10-28 11:34:03 +08:00
|
|
|
|
2019-11-22 02:03:32 +01:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-11-29 21:02:52 +01:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2022-07-29 00:19:48 +02:00
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/share/LICENSE")
|
2019-11-22 02:03:32 +01:00
|
|
|
|
2020-07-31 14:23:27 -04:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2021-11-29 21:02:52 +01:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC/export.h"
|
2020-07-31 14:23:27 -04:00
|
|
|
"#if defined(FLAC__NO_DLL)"
|
|
|
|
"#if 0"
|
|
|
|
)
|
2021-11-29 21:02:52 +01:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h"
|
2020-07-31 14:23:27 -04:00
|
|
|
"#if defined(FLAC__NO_DLL)"
|
|
|
|
"#if 0"
|
|
|
|
)
|
|
|
|
else()
|
2021-11-29 21:02:52 +01:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC/export.h"
|
2020-07-31 14:23:27 -04:00
|
|
|
"#if defined(FLAC__NO_DLL)"
|
|
|
|
"#if 1"
|
|
|
|
)
|
2021-11-29 21:02:52 +01:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h"
|
2020-07-31 14:23:27 -04:00
|
|
|
"#if defined(FLAC__NO_DLL)"
|
|
|
|
"#if 1"
|
|
|
|
)
|
|
|
|
endif()
|
2022-04-27 10:26:07 +08:00
|
|
|
|
2021-11-29 21:02:52 +01:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/flac.pc" " -lm" "")
|
2022-04-27 10:26:07 +08:00
|
|
|
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac.pc")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac.pc" " -lm" "")
|
2021-11-29 21:02:52 +01:00
|
|
|
endif()
|
|
|
|
endif()
|
2022-04-27 10:26:07 +08:00
|
|
|
|
2021-11-29 21:02:52 +01:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2020-10-28 11:34:03 +08:00
|
|
|
|
2019-11-22 02:03:32 +01:00
|
|
|
# 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
|
2023-02-13 10:37:00 -05:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.Xiph")
|
|
|
|
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|