Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[r8brain-free-src] add new port #42256

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions ports/r8brain-free-src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
cmake_minimum_required(VERSION 3.17)

project(r8brain VERSION 6.5 LANGUAGES CXX C)

option(R8B_INSTALL "Install library" ON)
option(R8B_PFFFT "Use PFFFT" OFF)
option(R8B_PFFFT_DOUBLE "Use PFFFT_DOUBLE" OFF)

if(R8B_INSTALL)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
endif()

file(GLOB_RECURSE _src *.h *.cpp *.c)

set(_src
r8bbase.cpp
)
if(R8B_PFFFT)
list(APPEND _src pffft.cpp)
endif()
if(R8B_PFFFT_DOUBLE)
list(APPEND _src pffft_double/pffft_double.c)
endif()

add_library(r8bsrc ${_src})

if(R8B_PFFFT)
target_compile_definitions(r8bsrc PUBLIC R8B_PFFFT=1)
endif()

if(R8B_PFFFT_DOUBLE)
target_compile_definitions(r8bsrc PUBLIC R8B_PFFFT_DOUBLE=1)
endif()

if(R8B_INSTALL)
install(TARGETS r8bsrc
EXPORT ${PROJECT_NAME}Targets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the prefix 'unofficial' to all your exports.

RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" OPTIONAL
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" OPTIONAL
)
target_include_directories(r8bsrc PUBLIC
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}>"
)

install(EXPORT ${PROJECT_NAME}Targets
FILE "unofficial-${PROJECT_NAME}Config.cmake"
NAMESPACE unofficial::r8brain::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-${PROJECT_NAME}
)

file(GLOB _headers *.h *.inc)
list(FILTER _headers EXCLUDE REGEX r8butil.h)
if(NOT R8B_PFFFT)
list(FILTER _headers EXCLUDE REGEX pffft.h)
endif()
install(
FILES ${_headers}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/r8brain
)
if(R8B_PFFFT_DOUBLE)
install(
FILES pffft_double/pffft_double.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/r8brain/pffft_double
)
endif()
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new line at the end of the file.

32 changes: 32 additions & 0 deletions ports/r8brain-free-src/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO avaneev/r8brain-free-src
REF version-${VERSION}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
REF version-${VERSION}
REF "version-${VERSION}"

SHA512 ae2707aa76d3dc89153bbe755f134c497a6024d3bc06badbb078fe8bc5c7f09bfa277003c6915b341f35d86224930890abab89da0ebafb98722cf35f9a2222d9
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")


vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
pffft R8B_PFFFT
pffft-double R8B_PFFFT_DOUBLE
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DR8B_PFFFT=${R8B_PFFFT}
-DR8B_PFFFT_DOUBLE=${R8B_PFFFT_DOUBLE}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
OPTIONS
-DR8B_PFFFT=${R8B_PFFFT}
-DR8B_PFFFT_DOUBLE=${R8B_PFFFT_DOUBLE}
OPTIONS
${FEATURE_OPTIONS}

)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-r8brain CONFIG_PATH lib/cmake/unofficial-r8brain)
vcpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

25 changes: 25 additions & 0 deletions ports/r8brain-free-src/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "r8brain-free-src",
"version": "6.5",
"description": "High-quality pro audio resampler / sample rate conversion C++ library. Very fast, for both audio resampling and time-series interpolation.",
"homepage": "https://github.com/avaneev/r8brain-free-src",
"license": "MIT",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"pffft": {
"description": "use the PFFFT"
},
"pffft-double": {
"description": "use the PFFFT DOUBLE"
}
}
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7760,6 +7760,10 @@
"baseline": "3.1.0",
"port-version": 3
},
"r8brain-free-src": {
"baseline": "6.5",
"port-version": 0
},
"rabit": {
"baseline": "0.1",
"port-version": 5
Expand Down
9 changes: 9 additions & 0 deletions versions/r-/r8brain-free-src.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "b88965228a33232aeed509d51f238d9b1e646b57",
"version": "6.5",
"port-version": 0
}
]
}