Skip to content

Commit

Permalink
[new port] Add rubberband (#24549)
Browse files Browse the repository at this point in the history
* add port for `rubberband`

[rubberband](https://www.breakfastquay.com/rubberband/) is a small
library for stretching sounds.
This is the minimal portfile to make vcpkg happy, but probably still
needs some improvement, i.e. not picking up system libraries.

* [rubberband] Update to 2.0.2

* [rubberband] remove lv2 feature, because the install location is out of the vcpkg install tree

* [rubberband] Remove vcpkg_cmake_get_vars dependency

* [rubberband] Disable static builds on windows because of broken libsndfile dependency

Co-authored-by: Daniel Reuter <daniel.robin.reuter@googlemail.com>
  • Loading branch information
daschuer and dreuter authored Sep 22, 2022
1 parent e97f053 commit 1d5b2d1
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
48 changes: 48 additions & 0 deletions ports/rubberband/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO breakfastquay/rubberband
REF v2.0.2
SHA512 56e33f3a6f5755242e46f9cb224e372bea7a367756f08d3322c8951a40b3907f1a2957775de6f2584a093e6adf82ca91015119650d5a624afe39086a47843ddc
HEAD_REF default
)

vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-Dfft=fftw # 'auto', 'builtin', 'kissfft', 'fftw', 'vdsp', 'ipp' 'FFT library to use. The default (auto) will use vDSP if available, the builtin implementation otherwise.')
-Dresampler=libsamplerate # 'auto', 'builtin', 'libsamplerate', 'speex', 'ipp' 'Resampler library to use. The default (auto) simply uses the builtin implementation.'
-Dipp_path= # 'Path to Intel IPP libraries, if selected for any of the other options.'
-Dextra_include_dirs= # 'Additional local header directories to search for dependencies.'
-Dextra_lib_dirs= # 'Additional local library directories to search for dependencies.'
)

vcpkg_install_meson()

vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/rubberband-program${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
# Rubberband uses a different executable name when compiled with msvc
# Just looking for that file is faster than detecting msvc builds
set(RUBBERBAND_PROGRAM_NAME rubberband-program)
else()
set(RUBBERBAND_PROGRAM_NAME rubberband)
endif()

# Features cli and lv2 are build whenever suficient dependencies are installed,
# Remove them when not enabled.
if("cli" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES "${RUBBERBAND_PROGRAM_NAME}" AUTO_CLEAN)
else()
vcpkg_clean_executables_in_bin(FILE_NAMES "${RUBBERBAND_PROGRAM_NAME}")
endif()

# lv2 feature is not supported yet because vcpkg can't isntall to
# %APPDATA%\LV2 or %COMMONPROGRAMFILES%\LV2 but also complains about dlls in "${CURRENT_PACKAGES_DIR}/lib/lv2"
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/lv2" "${CURRENT_PACKAGES_DIR}/debug/lib/lv2")

file(
INSTALL "${SOURCE_PATH}/COPYING"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
RENAME copyright
)
30 changes: 30 additions & 0 deletions ports/rubberband/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "rubberband",
"version": "2.0.2",
"description": "A high quality software library for audio time-stretching and pitch-shifting.",
"homepage": "https://www.breakfastquay.com/rubberband/",
"license": "GPL-2.0-or-later",
"supports": "!uwp & !(windows & static)",
"dependencies": [
"fftw3",
"libsamplerate",
{
"name": "vcpkg-tool-meson",
"host": true
}
],
"features": {
"cli": {
"description": "Build the command-line utility",
"dependencies": [
{
"name": "libsndfile",
"default-features": false,
"features": [
"external-libs"
]
}
]
}
}
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6524,6 +6524,10 @@
"baseline": "0.9.6",
"port-version": 4
},
"rubberband": {
"baseline": "2.0.2",
"port-version": 0
},
"rxcpp": {
"baseline": "4.1.1",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/r-/rubberband.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "75aeab834246d0e2ba7de5f07901e5d7131397f7",
"version": "2.0.2",
"port-version": 0
}
]
}

0 comments on commit 1d5b2d1

Please sign in to comment.