2021-10-28 14:03:47 +08:00
|
|
|
if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
|
|
message(FATAL_ERROR "Package only supports Linux platform.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
message(
|
|
|
|
"alsa currently requires the following libraries from the system package manager:
|
|
|
|
autoconf libtool
|
|
|
|
These can be installed on Ubuntu systems via sudo apt install autoconf libtool"
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO alsa-project/alsa-lib
|
2022-01-29 03:06:25 +08:00
|
|
|
REF v1.2.6.1
|
|
|
|
SHA512 d1de9112ec0d600db6e5a20b558811a7a9f34d00a9b1dfb5332669b73732c1c1b8ddda57368edc199e255eba8bcb8a6767b4d9325c9860ade02d84dcaac6eb47
|
2021-10-28 14:03:47 +08:00
|
|
|
HEAD_REF master
|
2022-12-03 01:16:18 +08:00
|
|
|
PATCHES
|
|
|
|
"fix-plugin-dir.patch"
|
2021-10-28 14:03:47 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
set(BUILD_OPTS --enable-shared=yes --enable-static=no)
|
|
|
|
else()
|
|
|
|
set(BUILD_OPTS --enable-shared=no --enable-static=yes)
|
|
|
|
endif()
|
|
|
|
|
2022-12-03 01:16:18 +08:00
|
|
|
|
2023-01-12 15:20:50 +08:00
|
|
|
|
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
|
|
|
set(ALSA_PLUGIN_DIR "/usr/lib/x86_64-linux-gnu/alsa-lib")
|
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
|
|
|
set(ALSA_PLUGIN_DIR "/usr/lib/aarch64-linux-gnu/alsa-lib")
|
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
|
|
|
|
set(ALSA_PLUGIN_DIR "/usr/lib/arm-linux-gnueabihf/alsa-lib")
|
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x")
|
|
|
|
set(ALSA_PLUGIN_DIR "/usr/lib/s390x-linux-gnu/alsa-lib")
|
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "ppc64le")
|
|
|
|
set(ALSA_PLUGIN_DIR "/usr/lib/powerpc64le-linux-gnu/alsa-lib")
|
2022-12-03 01:16:18 +08:00
|
|
|
else()
|
|
|
|
set(ALSA_PLUGIN_DIR "/usr/lib/alsa-lib")
|
|
|
|
endif()
|
|
|
|
set(ALSA_CONFIG_DIR "/usr/share/alsa")
|
|
|
|
|
2021-10-28 14:03:47 +08:00
|
|
|
vcpkg_configure_make(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
AUTOCONFIG
|
|
|
|
OPTIONS
|
|
|
|
${BUILD_OPTS}
|
|
|
|
--disable-python
|
2022-12-03 01:16:18 +08:00
|
|
|
"--with-configdir=${ALSA_CONFIG_DIR}"
|
|
|
|
"--with-plugindir=${ALSA_PLUGIN_DIR}"
|
2021-10-28 14:03:47 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_make()
|
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools/alsa/debug")
|
|
|
|
|
|
|
|
configure_file("${SOURCE_PATH}/COPYING" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
|
2022-12-03 01:16:18 +08:00
|
|
|
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|