From 68a25216171fecdaa677f3727ce834de10bef430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Tue, 23 Nov 2021 12:33:13 +0800 Subject: [PATCH] [vcpkg baseline][rtaudio] Add feature alsa and fix dependency (#21613) * [vcpkg baseline][rtaudio] Add feature alsa and fix dependency * version * Remove not needed apt item --- ports/rtaudio/fix-alsa.patch | 19 +++++++++++++++ ports/rtaudio/portfile.cmake | 24 ++++++------------- ports/rtaudio/vcpkg.json | 8 ++++++- .../azure-pipelines/linux/provision-image.sh | 3 --- versions/baseline.json | 2 +- versions/r-/rtaudio.json | 5 ++++ 6 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 ports/rtaudio/fix-alsa.patch diff --git a/ports/rtaudio/fix-alsa.patch b/ports/rtaudio/fix-alsa.patch new file mode 100644 index 0000000000..3953aadae2 --- /dev/null +++ b/ports/rtaudio/fix-alsa.patch @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a59e8bb..1334f5a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -123,12 +123,12 @@ endif() + # ALSA + if (RTAUDIO_API_ALSA) + set(NEED_PTHREAD ON) +- find_package(ALSA) ++ find_package(ALSA REQUIRED) + if (NOT ALSA_FOUND) + message(FATAL_ERROR "ALSA API requested but no ALSA dev libraries found") + endif() + list(APPEND INCDIRS ${ALSA_INCLUDE_DIR}) +- list(APPEND LINKLIBS ${ALSA_LIBRARY}) ++ list(APPEND LINKLIBS ${ALSA_LIBRARY} dl) + list(APPEND PKGCONFIG_REQUIRES "alsa") + list(APPEND API_DEFS "-D__LINUX_ALSA__") + list(APPEND API_LIST "alsa") diff --git a/ports/rtaudio/portfile.cmake b/ports/rtaudio/portfile.cmake index 42f47fb57b..d1c04be9ea 100644 --- a/ports/rtaudio/portfile.cmake +++ b/ports/rtaudio/portfile.cmake @@ -1,31 +1,22 @@ -vcpkg_fail_port_install(ON_TARGET "UWP") - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO thestk/rtaudio REF bc7ad66581947f810ff4460396bbbd1846b1e7c8 SHA512 ef5a41df15a8486550fb791ac21fcee4ecbf726fe9e91a56fcdd437cd554ea242f08c1061a9c6d5c261d721d86fbbcb32ce64db030976150862ed42a40137fc7 HEAD_REF master + PATCHES fix-alsa.patch ) -if(VCPKG_HOST_IS_LINUX) - message(WARNING "rtaudio requires ALSA on Linux; this is available on ubuntu via apt install libasound2-dev") -endif() - -if(VCPKG_CRT_LINKAGE STREQUAL static) - set(RTAUDIO_STATIC_MSVCRT ON) -else() - set(RTAUDIO_STATIC_MSVCRT OFF) -endif() +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" RTAUDIO_STATIC_MSVCRT) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES asio RTAUDIO_API_ASIO + alsa RTAUDIO_API_ALSA ) vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA + SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DRTAUDIO_STATIC_MSVCRT=${RTAUDIO_STATIC_MSVCRT} -DRTAUDIO_API_JACK=OFF @@ -35,10 +26,9 @@ vcpkg_cmake_configure( vcpkg_cmake_install() vcpkg_cmake_config_fixup() +vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) - -vcpkg_fixup_pkgconfig() +configure_file("${SOURCE_PATH}/LICENSE" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY) diff --git a/ports/rtaudio/vcpkg.json b/ports/rtaudio/vcpkg.json index 9b9d8ce10a..ba7113e5d3 100644 --- a/ports/rtaudio/vcpkg.json +++ b/ports/rtaudio/vcpkg.json @@ -1,7 +1,7 @@ { "name": "rtaudio", "version-date": "2021-08-15", - "port-version": 1, + "port-version": 2, "description": "A set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound, ASIO and WASAPI) operating systems.", "homepage": "https://github.com/thestk/rtaudio", "supports": "!uwp", @@ -16,6 +16,12 @@ } ], "features": { + "alsa": { + "description": "Build ALSA API", + "dependencies": [ + "alsa" + ] + }, "asio": { "description": "Build with ASIO backend" } diff --git a/scripts/azure-pipelines/linux/provision-image.sh b/scripts/azure-pipelines/linux/provision-image.sh index 4b1910e885..e4ca68dde0 100755 --- a/scripts/azure-pipelines/linux/provision-image.sh +++ b/scripts/azure-pipelines/linux/provision-image.sh @@ -36,9 +36,6 @@ APT_PACKAGES="$APT_PACKAGES python3-setuptools python3-mako" # Additionally required by some packages to install additional python packages APT_PACKAGES="$APT_PACKAGES python3-pip" -# Additionally required by rtaudio -APT_PACKAGES="$APT_PACKAGES libasound2-dev" - # Additionally required by qtwebengine APT_PACKAGES="$APT_PACKAGES nodejs" diff --git a/versions/baseline.json b/versions/baseline.json index 688ced98f9..bdf072a0e7 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6042,7 +6042,7 @@ }, "rtaudio": { "baseline": "2021-08-15", - "port-version": 1 + "port-version": 2 }, "rtlsdr": { "baseline": "2020-04-16", diff --git a/versions/r-/rtaudio.json b/versions/r-/rtaudio.json index 41ce621516..b353436218 100644 --- a/versions/r-/rtaudio.json +++ b/versions/r-/rtaudio.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "603a92374a5c37c3efb3bc48aaee17b64046f7be", + "version-date": "2021-08-15", + "port-version": 2 + }, { "git-tree": "89b766b5d1b97a4e306dd358db18a2a5d0505824", "version-date": "2021-08-15",