diff options
Diffstat (limited to 'vcpkg/ports/rtaudio')
| -rw-r--r-- | vcpkg/ports/rtaudio/fix-pulse.patch | 28 | ||||
| -rw-r--r-- | vcpkg/ports/rtaudio/portfile.cmake | 40 | ||||
| -rw-r--r-- | vcpkg/ports/rtaudio/vcpkg.json | 39 |
3 files changed, 107 insertions, 0 deletions
diff --git a/vcpkg/ports/rtaudio/fix-pulse.patch b/vcpkg/ports/rtaudio/fix-pulse.patch new file mode 100644 index 0000000..513b802 --- /dev/null +++ b/vcpkg/ports/rtaudio/fix-pulse.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8e021dc..6dbac46 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -149,9 +149,9 @@ endif() + # Pulse + if (RTAUDIO_API_PULSE) + set(NEED_PTHREAD ON) +- find_library(PULSE_LIB pulse) +- find_library(PULSESIMPLE_LIB pulse-simple) +- list(APPEND LINKLIBS ${PULSE_LIB} ${PULSESIMPLE_LIB}) ++ find_package(PkgConfig) ++ pkg_check_modules(pulse-simple REQUIRED IMPORTED_TARGET libpulse-simple) ++ list(APPEND LINKLIBS PkgConfig::pulse-simple) + list(APPEND PKGCONFIG_REQUIRES "libpulse-simple") + list(APPEND API_DEFS "-D__LINUX_PULSE__") + list(APPEND API_LIST "pulse") +@@ -323,6 +323,10 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/RtAudioConfig.cmake.in "@PACKAGE_INIT@\n" + if(NEED_PTHREAD) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/RtAudioConfig.cmake.in "find_package(Threads REQUIRED)\n") + endif() ++if (RTAUDIO_API_PULSE) ++ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/RtAudioConfig.cmake.in "find_package(PkgConfig)\n") ++ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/RtAudioConfig.cmake.in "pkg_check_modules(pulse-simple REQUIRED IMPORTED_TARGET libpulse-simple)\n") ++endif() + + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/RtAudioConfig.cmake.in "include(\${CMAKE_CURRENT_LIST_DIR}/RtAudioTargets.cmake)") + diff --git a/vcpkg/ports/rtaudio/portfile.cmake b/vcpkg/ports/rtaudio/portfile.cmake new file mode 100644 index 0000000..7ff1dae --- /dev/null +++ b/vcpkg/ports/rtaudio/portfile.cmake @@ -0,0 +1,40 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO thestk/rtaudio
+ REF ${VERSION}
+ SHA512 085feb2673185460717ba45fc87254961e477823759e11281092c1ba13301303de1cd36aa9efeba0710cbf2c70f2e2f7f9e41173cf372ded528c41612b19acd5
+ HEAD_REF master
+ PATCHES
+ fix-pulse.patch
+)
+
+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
+ pulse RTAUDIO_API_PULSE
+)
+set(PKG_OPT "")
+if("pulse" IN_LIST FEATURES)
+ vcpkg_find_acquire_program(PKGCONFIG)
+ set(PKG_OPT "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}")
+endif()
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DRTAUDIO_STATIC_MSVCRT=${RTAUDIO_STATIC_MSVCRT}
+ -DRTAUDIO_API_JACK=OFF
+ ${FEATURE_OPTIONS}
+ ${PKG_OPT}
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup()
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/rtaudio/vcpkg.json b/vcpkg/ports/rtaudio/vcpkg.json new file mode 100644 index 0000000..3d2cc55 --- /dev/null +++ b/vcpkg/ports/rtaudio/vcpkg.json @@ -0,0 +1,39 @@ +{ + "name": "rtaudio", + "version": "6.0.1", + "port-version": 1, + "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", + "license": null, + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "alsa": { + "description": "Build ALSA API", + "supports": "linux", + "dependencies": [ + "alsa" + ] + }, + "asio": { + "description": "Build with ASIO backend", + "supports": "windows" + }, + "pulse": { + "description": "Build with PulseAudio backend", + "supports": "linux", + "dependencies": [ + "pulseaudio" + ] + } + } +} |