diff --git a/ports/aubio/CMakeLists.txt b/ports/aubio/CMakeLists.txt index 9238490ebc..2e1331819b 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(src ${LIBLZMA_INCLUDE_DIRS}) + include_directories(${LIBLZMA_INCLUDE_DIRS}) +endif() + +include_directories(src) file(GLOB_RECURSE SOURCES src/*.c) -set_source_files_properties(src/io/sink_wavwrite.c PROPERTIES COMPILE_FLAGS /FIWinsock2.h) -add_library(aubio ${SOURCES}) -target_link_libraries(aubio PUBLIC - SndFile::sndfile - ${FFMPEG_LIBRARIES} - BZip2::BZip2 - ${LIBLZMA_LIBRARIES} -) +if(WIN32 AND NOT MINGW) + set_source_files_properties(src/io/sink_wavwrite.c PROPERTIES COMPILE_FLAGS /FIWinsock2.h) +endif() -if(BUILD_TOOLS) +add_library(aubio ${SOURCES}) +if(WITH_DEPENDENCIES) + target_link_libraries(aubio PUBLIC + SndFile::sndfile + ${FFMPEG_LIBRARIES} + BZip2::BZip2 + ${LIBLZMA_LIBRARIES} + ) +endif() + +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 211dad0793..0000000000 --- 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 9614c1735a..5d67f152ac 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 0000000000..b7d04f4c47 --- /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 adb765817a..88fd28ab7d 100644 --- a/versions/a-/aubio.json +++ b/versions/a-/aubio.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a5fd622dc9d70a1f4cca1e6bc09829e1844b7e0f", + "version-string": "0.4.9", + "port-version": 4 + }, { "git-tree": "4623a0698d9f9775a12e41f282e2b131f32ea09f", "version-string": "0.4.9", diff --git a/versions/baseline.json b/versions/baseline.json index 79176dbcdf..16eb577b31 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",