diff --git a/audio/Makefile b/audio/Makefile index 3b4fbdcf6102..85e8ca68f3fc 100644 --- a/audio/Makefile +++ b/audio/Makefile @@ -418,6 +418,7 @@ SUBDIR += libmusicbrainz3 SUBDIR += libmusicbrainz5 SUBDIR += libmusicxml + SUBDIR += libmysofa SUBDIR += libnjb SUBDIR += libnoise SUBDIR += libogg diff --git a/audio/libmysofa/Makefile b/audio/libmysofa/Makefile new file mode 100644 index 000000000000..b0afab011dc2 --- /dev/null +++ b/audio/libmysofa/Makefile @@ -0,0 +1,32 @@ +# $FreeBSD$ + +PORTNAME= libmysofa +PORTVERSION= 0.6 +DISTVERSIONPREFIX= v +CATEGORIES= audio + +MAINTAINER= jhale@FreeBSD.org +COMMENT= SOFA (Spatially Oriented Format for Acoustics) file reader + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +TEST_DEPENDS= node:www/node + +USES= cmake shebangfix +USE_LDCONFIG= yes + +SHEBANG_FILES= tests/compare.sh +bash_CMD= /bin/sh + +USE_GITHUB= yes +GH_ACCOUNT= hoene + +OPTIONS_DEFINE= TEST +OPTIONS_SUB= yes + +TEST_BUILD_DEPENDS= cunit>0:devel/cunit +TEST_CMAKE_BOOL= BUILD_TESTS +TEST_TEST_TARGET= test + +.include diff --git a/audio/libmysofa/distinfo b/audio/libmysofa/distinfo new file mode 100644 index 000000000000..ed65130afa68 --- /dev/null +++ b/audio/libmysofa/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1518091211 +SHA256 (hoene-libmysofa-v0.6_GH0.tar.gz) = e39c34bd40d17aecdb962ba6ae533a3fa9d291da4db6972d0d6e023974a1c169 +SIZE (hoene-libmysofa-v0.6_GH0.tar.gz) = 77218522 diff --git a/audio/libmysofa/files/patch-CMakeLists.txt b/audio/libmysofa/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..6f0b48a1ace9 --- /dev/null +++ b/audio/libmysofa/files/patch-CMakeLists.txt @@ -0,0 +1,29 @@ +The tests/compare.sh script is written to be run relative to the directory it +is in, so we need to direct CMake to execute it from the tests directory +instead of the top source directory. + +--- CMakeLists.txt.orig 2017-07-11 11:36:33 UTC ++++ CMakeLists.txt +@@ -38,14 +38,14 @@ if(BUILD_TESTS) + + enable_testing() + +- add_test(CIPIC_subject_003_hrir_final ../tests/compare.sh ../tests/CIPIC_subject_003_hrir_final) +- add_test(FHK_HRIR_L2354.sofa ../tests/compare.sh ../tests/FHK_HRIR_L2354) +- add_test(LISTEN_1002_IRC_1002_C_HRIR.sofa ../tests/compare.sh ../tests/LISTEN_1002_IRC_1002_C_HRIR) +- add_test(MIT_KEMAR_large_pinna.sofa ../tests/compare.sh ../tests/MIT_KEMAR_large_pinna) +- add_test(Pulse ../tests/compare.sh ../tests/Pulse) +- add_test(Tester ../tests/compare.sh ../tests/tester) +- add_test(TU-Berlin_QU_KEMAR_anechoic_radius_0.5_1_2_3_m.sofa ../tests/compare.sh ../tests/TU-Berlin_QU_KEMAR_anechoic_radius_0.5_1_2_3_m) +- add_test(TU-Berlin_QU_KEMAR_anechoic_radius_0.5m.sofa ../tests/compare.sh ../tests/TU-Berlin_QU_KEMAR_anechoic_radius_0.5m) ++ add_test(NAME CIPIC_subject_003_hrir_final COMMAND compare.sh CIPIC_subject_003_hrir_final WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) ++ add_test(NAME FHK_HRIR_L2354.sofa COMMAND compare.sh FHK_HRIR_L2354 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) ++ add_test(NAME LISTEN_1002_IRC_1002_C_HRIR.sofa COMMAND compare.sh LISTEN_1002_IRC_1002_C_HRIR WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) ++ add_test(NAME MIT_KEMAR_large_pinna.sofa COMMAND compare.sh MIT_KEMAR_large_pinna WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) ++ add_test(NAME Pulse COMMAND compare.sh Pulse WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) ++ add_test(NAME Tester COMMAND compare.sh tester WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) ++ add_test(NAME TU-Berlin_QU_KEMAR_anechoic_radius_0.5_1_2_3_m.sofa COMMAND compare.sh TU-Berlin_QU_KEMAR_anechoic_radius_0.5_1_2_3_m WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) ++ add_test(NAME TU-Berlin_QU_KEMAR_anechoic_radius_0.5m.sofa COMMAND compare.sh TU-Berlin_QU_KEMAR_anechoic_radius_0.5m WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) + endif(BUILD_TESTS) + + add_subdirectory(src) diff --git a/audio/libmysofa/files/patch-tests_compare.sh b/audio/libmysofa/files/patch-tests_compare.sh new file mode 100644 index 000000000000..34ab4082d87f --- /dev/null +++ b/audio/libmysofa/files/patch-tests_compare.sh @@ -0,0 +1,13 @@ +Fix binary location. + +--- tests/compare.sh.orig 2018-02-08 14:33:00 UTC ++++ tests/compare.sh +@@ -1,7 +1,7 @@ + #!/bin/bash + + NODEJS=`which node || which nodejs || which false` +-../build/src/mysofa2json "$1".sofa >tmp1.json 2>tmp1.txt ++../src/mysofa2json "$1".sofa >tmp1.json 2>tmp1.txt + + ret=$? + if [ "$ret" != 0 ]; then diff --git a/audio/libmysofa/pkg-descr b/audio/libmysofa/pkg-descr new file mode 100644 index 000000000000..91dc3ace941e --- /dev/null +++ b/audio/libmysofa/pkg-descr @@ -0,0 +1,6 @@ +libmysofa is a simple set of C functions to read AES SOFA (Spatially +Oriented Format for Acoustics) files, if they contain HRTFs +(Head-Related Transfer Functions) stored according to the AES69-2015 +standard [http://www.aes.org/publications/standards/search.cfm?docID=99]. + +WWW: https://github.com/hoene/libmysofa diff --git a/audio/libmysofa/pkg-plist b/audio/libmysofa/pkg-plist new file mode 100644 index 000000000000..0687e78eed68 --- /dev/null +++ b/audio/libmysofa/pkg-plist @@ -0,0 +1,8 @@ +%%TEST%%bin/mysofa2json +include/mysofa.h +lib/libmysofa.a +lib/libmysofa.so +lib/libmysofa.so.0 +lib/libmysofa.so.0.5.1 +%%DATADIR%%/MIT_KEMAR_normal_pinna.sofa +%%DATADIR%%/default.sofa