diff options
| author | autoantwort <41973254+autoantwort@users.noreply.github.com> | 2021-03-25 20:36:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-25 12:36:00 -0700 |
| commit | dc8f5b6d9995b11cd86d029f2a445ab85fa4add4 (patch) | |
| tree | 8518139f4aa3a3e2d3dbbf1ceb625536f0cfd65c | |
| parent | 70f73854cb0c9078d81d0e05b0c533cef994e30b (diff) | |
| download | vcpkg-dc8f5b6d9995b11cd86d029f2a445ab85fa4add4.tar.gz vcpkg-dc8f5b6d9995b11cd86d029f2a445ab85fa4add4.zip | |
[aubio] allow to build without dependencies (#16051)
* Make it possible to build aubio without dependencies
* Update ports/aubio/portfile.cmake
Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
* [aubio] add suggestions
* add version files
* Update ports/aubio/portfile.cmake
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
* add version files
* [aubio] fix wrong defines
* add version files
Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
| -rw-r--r-- | ports/aubio/CMakeLists.txt | 51 | ||||
| -rw-r--r-- | ports/aubio/CONTROL | 7 | ||||
| -rw-r--r-- | ports/aubio/portfile.cmake | 11 | ||||
| -rw-r--r-- | ports/aubio/vcpkg.json | 24 | ||||
| -rw-r--r-- | versions/a-/aubio.json | 5 | ||||
| -rw-r--r-- | versions/baseline.json | 2 |
6 files changed, 72 insertions, 28 deletions
diff --git a/ports/aubio/CMakeLists.txt b/ports/aubio/CMakeLists.txt index 9238490eb..2e1331819 100644 --- a/ports/aubio/CMakeLists.txt +++ b/ports/aubio/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 3.8) project(aubio C) +option(WITH_DEPENDENCIES "Adds extra dependencies" ON) + add_definitions( -DHAVE_STDLIB_H=1 -DHAVE_STDIO_H=1 @@ -8,46 +10,55 @@ add_definitions( -DHAVE_STRING_H=1 -DHAVE_LIMITS_H=1 -DHAVE_STDARG_H=1 + -DHAVE_ERRNO_H=1 -DHAVE_C99_VARARGS_MACROS=1 - -DHAVE_SNDFILE=1 - -DHAVE_WAVWRITE=1 - -DHAVE_WAVREAD=1 - -DHAVE_LIBAV=1 - -DHAVE_SWRESAMPLE=1 - -D_CRT_SECURE_NO_WARNINGS=1 ) set(CMAKE_DEBUG_POSTFIX d) option(BUILD_TOOLS "Build and install tools" ON) + set(TOOLS_INSTALLDIR "bin" CACHE STRING "Target directory for installed tools") -find_package(FFmpeg COMPONENTS avcodec avutil avdevice avfilter avformat swresample REQUIRED) -find_package(BZip2 REQUIRED) -find_package(LibLZMA REQUIRED) -find_package(SndFile REQUIRED) +if(WITH_DEPENDENCIES) + find_package(FFMPEG COMPONENTS avcodec avutil avdevice avfilter avformat swresample REQUIRED) + find_package(BZip2 REQUIRED) + find_package(LibLZMA REQUIRED) + find_package(SndFile REQUIRED) + + include_directories(${LIBLZMA_INCLUDE_DIRS}) +endif() -include_directories(src ${LIBLZMA_INCLUDE_DIRS}) +include_directories(src) file(GLOB_RECURSE SOURCES src/*.c) -set_source_files_properties(src/io/sink_wavwrite.c PROPERTIES COMPILE_FLAGS /FIWinsock2.h) +if(WIN32 AND NOT MINGW) + set_source_files_properties(src/io/sink_wavwrite.c PROPERTIES COMPILE_FLAGS /FIWinsock2.h) +endif() + add_library(aubio ${SOURCES}) -target_link_libraries(aubio PUBLIC - SndFile::sndfile - ${FFMPEG_LIBRARIES} - BZip2::BZip2 - ${LIBLZMA_LIBRARIES} -) +if(WITH_DEPENDENCIES) + target_link_libraries(aubio PUBLIC + SndFile::sndfile + ${FFMPEG_LIBRARIES} + BZip2::BZip2 + ${LIBLZMA_LIBRARIES} + ) +endif() -if(BUILD_TOOLS) +if(BUILD_TOOLS AND WITH_DEPENDENCIES) set(EXAMPLE_EXECS aubiomfcc aubionotes aubioonset aubiopitch aubioquiet aubiotrack) foreach(EXAMPLE_EXEC ${EXAMPLE_EXECS}) add_executable(${EXAMPLE_EXEC} examples/${EXAMPLE_EXEC}.c examples/utils.c examples/jackio.c) target_link_libraries(${EXAMPLE_EXEC} PRIVATE aubio) - target_compile_definitions(${EXAMPLE_EXEC} PRIVATE -DHAVE_WIN_HACKS=1) + if(WIN32) + target_compile_definitions(${EXAMPLE_EXEC} PRIVATE -DHAVE_WIN_HACKS=1) + else() + target_compile_definitions(${EXAMPLE_EXEC} PRIVATE -DHAVE_UNISTD_H=1) + endif() endforeach() # Create and add fake config.h to avoid build errors (file is generated for # cross-platform requirements in waf build-system) diff --git a/ports/aubio/CONTROL b/ports/aubio/CONTROL deleted file mode 100644 index 211dad079..000000000 --- a/ports/aubio/CONTROL +++ /dev/null @@ -1,7 +0,0 @@ -Source: aubio
-Version: 0.4.9
-Port-Version: 3
-Homepage: https://github.com/aubio/aubio
-Description: Aubio is a tool designed for the extraction of annotations from audio signals. Its features include segmenting a sound file before each of its attacks, performing pitch detection, tapping the beat and producing midi streams from live audio.
-Build-Depends: ffmpeg, libsndfile, libogg, libflac, libvorbis, bzip2, liblzma
-Supports: windows
\ No newline at end of file diff --git a/ports/aubio/portfile.cmake b/ports/aubio/portfile.cmake index 9614c1735..5d67f152a 100644 --- a/ports/aubio/portfile.cmake +++ b/ports/aubio/portfile.cmake @@ -10,9 +10,20 @@ vcpkg_from_github( file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tools WITH_DEPENDENCIES + tools HAVE_SNDFILE + tools HAVE_WAVWRITE + tools HAVE_WAVREAD + tools HAVE_LIBAV + tools HAVE_SWRESAMPLE +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS ${FEATURE_OPTIONS} OPTIONS_RELEASE -DTOOLS_INSTALLDIR=tools/aubio -DBUILD_TOOLS=ON diff --git a/ports/aubio/vcpkg.json b/ports/aubio/vcpkg.json new file mode 100644 index 000000000..b7d04f4c4 --- /dev/null +++ b/ports/aubio/vcpkg.json @@ -0,0 +1,24 @@ +{ + "name": "aubio", + "version-string": "0.4.9", + "port-version": 4, + "description": "Aubio is a tool designed for the extraction of annotations from audio signals. Its features include segmenting a sound file before each of its attacks, performing pitch detection, tapping the beat and producing midi streams from live audio.", + "homepage": "https://github.com/aubio/aubio", + "default-features": [ + "tools" + ], + "features": { + "tools": { + "description": "Build tools and add extra dependencies", + "dependencies": [ + "bzip2", + "ffmpeg", + "libflac", + "liblzma", + "libogg", + "libsndfile", + "libvorbis" + ] + } + } +} diff --git a/versions/a-/aubio.json b/versions/a-/aubio.json index adb765817..88fd28ab7 100644 --- a/versions/a-/aubio.json +++ b/versions/a-/aubio.json @@ -1,6 +1,11 @@ { "versions": [ { + "git-tree": "a5fd622dc9d70a1f4cca1e6bc09829e1844b7e0f", + "version-string": "0.4.9", + "port-version": 4 + }, + { "git-tree": "4623a0698d9f9775a12e41f282e2b131f32ea09f", "version-string": "0.4.9", "port-version": 3 diff --git a/versions/baseline.json b/versions/baseline.json index 79176dbcd..16eb577b3 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -190,7 +190,7 @@ }, "aubio": { "baseline": "0.4.9", - "port-version": 3 + "port-version": 4 }, "audiofile": { "baseline": "1.0.7", |
