From 5150c11a25cd4800541980ba220887b60e34c46f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Fri, 27 Dec 2024 18:10:12 +0300 Subject: [PATCH 01/30] init --- packages/l/libmysofa/xmake.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 packages/l/libmysofa/xmake.lua diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua new file mode 100644 index 00000000000..87afa31769e --- /dev/null +++ b/packages/l/libmysofa/xmake.lua @@ -0,0 +1,22 @@ +package("libmysofa") + set_homepage("https://github.com/hoene/libmysofa") + set_description("Reader for AES SOFA files to get better HRTFs") + + add_urls("https://github.com/hoene/libmysofa/archive/refs/tags/$(version).tar.gz", + "https://github.com/hoene/libmysofa.git") + + add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") + + add_deps("cmake", "zlib") + + on_install(function (package) + local configs = {"-DBUILD_TESTS=OFF"} + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "OFF" or "ON")) + table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("mysofa_open", {includes = "mysofa.h"})) + end) From b9ff09950a09bbdf7171f361d1ea9677fd6e5046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Fri, 27 Dec 2024 19:20:25 +0300 Subject: [PATCH 02/30] fixup --- packages/l/libmysofa/xmake.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 87afa31769e..72e9d6fd81f 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -11,9 +11,12 @@ package("libmysofa") on_install(function (package) local configs = {"-DBUILD_TESTS=OFF"} - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "OFF" or "ON")) - table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + if package:config("shared") then + table.insert(configs, "-DBUILD_STATIC_LIBS=ON") + table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") + else + table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") + end import("package.tools.cmake").install(package, configs) end) From 84119fb980b8b3274f5b44ab6d56f1916665303a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Fri, 27 Dec 2024 21:42:53 +0300 Subject: [PATCH 03/30] revise --- .../libmysofa/patches/v1.3.2/fix-build.patch | 106 ++++++++++++++++++ packages/l/libmysofa/xmake.lua | 10 +- 2 files changed, 110 insertions(+), 6 deletions(-) create mode 100644 packages/l/libmysofa/patches/v1.3.2/fix-build.patch diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch new file mode 100644 index 00000000000..c9eb9e98a53 --- /dev/null +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -0,0 +1,106 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index dcaa92a..ed966e6 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -13,21 +13,23 @@ use_c99() + configure_file(config.h.in config.h) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) + ++find_package(ZLIB REQUIRED) + if(NOT MSVC) + if(NOT WIN32) + find_library(MATH m) + else() + set(MATH "") + endif() +- include(FindZLIB) + else() + set(MATH "") ++ if(0) + find_program(NUGET nuget) + if(NUGET) + execute_process(COMMAND ${NUGET} install zlib) + endif() + include_directories( + ${PROJECT_SOURCE_DIR}/windows/third-party/zlib-1.2.11/include/) ++ endif() + endif() + + if(NOT MSVC) +@@ -36,12 +38,11 @@ if(NOT MSVC) + else() + set(MATH "") + endif() +- include(FindZLIB) +- include_directories(${ZLIB_INCLUDE_DIRS}) + set(PKG_CONFIG_PRIVATELIBS "-lm ${PKG_CONFIG_PRIVATELIBS}") + set(PKG_CONFIG_PRIVATELIBS "-lz ${PKG_CONFIG_PRIVATELIBS}") + else() + set(MATH "") ++ if(0) + find_program(NUGET nuget) + if(NOT NUGET) + message( +@@ -53,6 +54,7 @@ else() + endif() + include_directories( + ${PROJECT_SOURCE_DIR}/windows/third-party/zlib-1.2.11/include/) ++ endif() + endif() + + set(libsrc +@@ -80,15 +82,16 @@ set(libsrc + set(public-headers + hrtf/mysofa.h + ) ++install(FILES "${public-headers}" DESTINATION include) + +-if(BUILD_STATIC_LIBS) ++if(NOT(BUILD_SHARED_LIBS)) + add_library(mysofa-static STATIC ${libsrc}) + target_include_directories(mysofa-static + PUBLIC + "$" + $ + ) +-target_link_libraries(mysofa-static LINK_PRIVATE ${MATH} ${ZLIB_LIBRARIES}) ++target_link_libraries(mysofa-static LINK_PRIVATE ${MATH} ZLIB::ZLIB) + set_target_properties( + mysofa-static + PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1 POSITION_INDEPENDENT_CODE +@@ -120,7 +123,7 @@ if(BUILD_SHARED_LIBS) + "$" + $ + ) +- target_link_libraries(mysofa-shared PRIVATE ${MATH} ${ZLIB_LIBRARIES}) ++ target_link_libraries(mysofa-shared PRIVATE ${MATH} ZLIB::ZLIB) + set_target_properties(mysofa-shared + PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1) + # Rename the Windows import library (stub) of the DLL to prevent a name clash +@@ -171,7 +174,7 @@ endif() + + if(BUILD_TESTS) + add_executable(mysofa2json tests/sofa2json.c tests/json.c) +- if(BUILD_STATIC_LIBS) ++ if(NOT(BUILD_SHARED_LIBS)) + target_link_libraries(mysofa2json mysofa-static) + else() + target_link_libraries(mysofa2json mysofa-shared) +@@ -192,7 +195,7 @@ if(BUILD_TESTS) + tests/cache.c + tests/json.c + tests/user_defined_variable.c) +- if(BUILD_STATIC_LIBS) ++ if(NOT(BUILD_SHARED_LIBS)) + target_link_libraries(external mysofa-static ${CUNIT_LIBRARIES}) + else() + target_link_libraries(external mysofa-shared ${CUNIT_LIBRARIES} m) +@@ -210,7 +213,7 @@ if(BUILD_TESTS) + COMMAND internal) + + add_executable(multithread tests/multithread.c) +- if(BUILD_STATIC_LIBS) ++ if(NOT(BUILD_SHARED_LIBS)) + target_link_libraries(multithread mysofa-static pthread) + else() + target_link_libraries(multithread mysofa-shared pthread m) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 72e9d6fd81f..fca3e4c19a7 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -1,22 +1,20 @@ package("libmysofa") set_homepage("https://github.com/hoene/libmysofa") set_description("Reader for AES SOFA files to get better HRTFs") + set_license("BSD-3-Clause") add_urls("https://github.com/hoene/libmysofa/archive/refs/tags/$(version).tar.gz", "https://github.com/hoene/libmysofa.git") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "4080272c7b77d41f629bee1abf3b8bfc8ddc76b315761cca89971c0460990b76") + add_deps("cmake", "zlib") on_install(function (package) local configs = {"-DBUILD_TESTS=OFF"} - if package:config("shared") then - table.insert(configs, "-DBUILD_STATIC_LIBS=ON") - table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") - else - table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") - end + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) end) From ab3733953339766447033cf0b69f1f994fa83bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Fri, 27 Dec 2024 22:22:15 +0300 Subject: [PATCH 04/30] re-check --- packages/l/libmysofa/xmake.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index fca3e4c19a7..17d921dd0cd 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -15,6 +15,7 @@ package("libmysofa") on_install(function (package) local configs = {"-DBUILD_TESTS=OFF"} table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) import("package.tools.cmake").install(package, configs) end) From b9bbb85a6d7e292672a68e64edf1efd07dfe60f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Fri, 27 Dec 2024 22:56:47 +0300 Subject: [PATCH 05/30] check old solution --- packages/l/libmysofa/xmake.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 17d921dd0cd..1fec0304eab 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -14,8 +14,12 @@ package("libmysofa") on_install(function (package) local configs = {"-DBUILD_TESTS=OFF"} - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) - table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) + if package:config("shared") then + table.insert(configs, "-DBUILD_STATIC_LIBS=ON") + table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") + else + table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") + end import("package.tools.cmake").install(package, configs) end) From b57b1476cc0f9d284634a028690cbcecb04f16c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 01:10:55 +0300 Subject: [PATCH 06/30] test --- packages/l/libmysofa/xmake.lua | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 1fec0304eab..074fd477698 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -8,18 +8,13 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "4080272c7b77d41f629bee1abf3b8bfc8ddc76b315761cca89971c0460990b76") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "babadc83541ad6d6d37884bf44b6ebcba783d727f075dcc6e4ce01790ca0f5b0") add_deps("cmake", "zlib") on_install(function (package) local configs = {"-DBUILD_TESTS=OFF"} - if package:config("shared") then - table.insert(configs, "-DBUILD_STATIC_LIBS=ON") - table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") - else - table.insert(configs, "-DBUILD_SHARED_LIBS=OFF") - end + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) end) From 5bbf84f5d9fb7260b1aba11ca6bcd344fb0898fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 01:39:19 +0300 Subject: [PATCH 07/30] check --- packages/l/libmysofa/xmake.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 074fd477698..8d468ab6dd0 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -13,6 +13,8 @@ package("libmysofa") add_deps("cmake", "zlib") on_install(function (package) + os.rm("share/default.sofa") + os.cp("share/MIT_KEMAR_normal_pinna.sofa", "share/default.sofa") local configs = {"-DBUILD_TESTS=OFF"} table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) import("package.tools.cmake").install(package, configs) From 55411beea9adfad2c9e3d82a856d3124bb0cb156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 09:53:58 +0300 Subject: [PATCH 08/30] check --- .../libmysofa/patches/v1.3.2/fix-build.patch | 58 ++++++------------- packages/l/libmysofa/xmake.lua | 2 +- 2 files changed, 18 insertions(+), 42 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index c9eb9e98a53..e18e3f75c09 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dcaa92a..ed966e6 100644 +index dcaa92a..c62d79b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,21 +13,23 @@ use_c99() @@ -49,17 +49,15 @@ index dcaa92a..ed966e6 100644 endif() set(libsrc -@@ -80,15 +82,16 @@ set(libsrc +@@ -80,6 +82,7 @@ set(libsrc set(public-headers hrtf/mysofa.h ) +install(FILES "${public-headers}" DESTINATION include) --if(BUILD_STATIC_LIBS) -+if(NOT(BUILD_SHARED_LIBS)) + if(BUILD_STATIC_LIBS) add_library(mysofa-static STATIC ${libsrc}) - target_include_directories(mysofa-static - PUBLIC +@@ -88,11 +91,11 @@ target_include_directories(mysofa-static "$" $ ) @@ -68,39 +66,17 @@ index dcaa92a..ed966e6 100644 set_target_properties( mysofa-static PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1 POSITION_INDEPENDENT_CODE -@@ -120,7 +123,7 @@ if(BUILD_SHARED_LIBS) - "$" - $ - ) -- target_link_libraries(mysofa-shared PRIVATE ${MATH} ${ZLIB_LIBRARIES}) -+ target_link_libraries(mysofa-shared PRIVATE ${MATH} ZLIB::ZLIB) - set_target_properties(mysofa-shared - PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1) - # Rename the Windows import library (stub) of the DLL to prevent a name clash -@@ -171,7 +174,7 @@ endif() - - if(BUILD_TESTS) - add_executable(mysofa2json tests/sofa2json.c tests/json.c) -- if(BUILD_STATIC_LIBS) -+ if(NOT(BUILD_SHARED_LIBS)) - target_link_libraries(mysofa2json mysofa-static) - else() - target_link_libraries(mysofa2json mysofa-shared) -@@ -192,7 +195,7 @@ if(BUILD_TESTS) - tests/cache.c - tests/json.c - tests/user_defined_variable.c) -- if(BUILD_STATIC_LIBS) -+ if(NOT(BUILD_SHARED_LIBS)) - target_link_libraries(external mysofa-static ${CUNIT_LIBRARIES}) - else() - target_link_libraries(external mysofa-shared ${CUNIT_LIBRARIES} m) -@@ -210,7 +213,7 @@ if(BUILD_TESTS) - COMMAND internal) +- ${BUILD_SHARED_LIBS}) ++ OFF) + set_target_properties( mysofa-static PROPERTIES PUBLIC_HEADER "${public-headers}" ) + install(TARGETS mysofa-static + EXPORT mysofa_exports +@@ -113,7 +116,7 @@ install(TARGETS mysofa-static + endif() + endif() - add_executable(multithread tests/multithread.c) -- if(BUILD_STATIC_LIBS) -+ if(NOT(BUILD_SHARED_LIBS)) - target_link_libraries(multithread mysofa-static pthread) - else() - target_link_libraries(multithread mysofa-shared pthread m) +-if(BUILD_SHARED_LIBS) ++if(NOT(BUILD_STATIC_LIBS)) + add_library(mysofa-shared SHARED ${libsrc}) + target_include_directories(mysofa-shared + PUBLIC diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 8d468ab6dd0..fdccaa425d9 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -8,7 +8,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "babadc83541ad6d6d37884bf44b6ebcba783d727f075dcc6e4ce01790ca0f5b0") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "beb93eaaea535ca69669f5f77dbf96e42ab35e66f25c6889ac1a53c56da30528") add_deps("cmake", "zlib") From 0377d7ea599b42769ea7ae23af84b4f80e62fd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 12:04:05 +0300 Subject: [PATCH 09/30] export surface --- .../libmysofa/patches/v1.3.2/fix-build.patch | 143 +++++++++++++++++- packages/l/libmysofa/xmake.lua | 1 + 2 files changed, 141 insertions(+), 3 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index e18e3f75c09..7a39369b687 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dcaa92a..c62d79b 100644 +index dcaa92a..03343b5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,21 +13,23 @@ use_c99() @@ -67,7 +67,7 @@ index dcaa92a..c62d79b 100644 mysofa-static PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1 POSITION_INDEPENDENT_CODE - ${BUILD_SHARED_LIBS}) -+ OFF) ++ ${NOT(BUILD_SHARED_LIBS)}) set_target_properties( mysofa-static PROPERTIES PUBLIC_HEADER "${public-headers}" ) install(TARGETS mysofa-static EXPORT mysofa_exports @@ -76,7 +76,144 @@ index dcaa92a..c62d79b 100644 endif() -if(BUILD_SHARED_LIBS) -+if(NOT(BUILD_STATIC_LIBS)) ++if(NOT(BUILD_SHARED_LIBS)) add_library(mysofa-shared SHARED ${libsrc}) target_include_directories(mysofa-shared PUBLIC +@@ -169,6 +172,11 @@ else() + mysofa_export.h) + endif() + ++install( ++ FILES ${PROJECT_BINARY_DIR}/src/mysofa_export.h ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++ + if(BUILD_TESTS) + add_executable(mysofa2json tests/sofa2json.c tests/json.c) + if(BUILD_STATIC_LIBS) +diff --git a/src/hrtf/mysofa.h b/src/hrtf/mysofa.h +index 206e77b..cb6c557 100644 +--- a/src/hrtf/mysofa.h ++++ b/src/hrtf/mysofa.h +@@ -127,44 +127,44 @@ enum { + MYSOFA_ONLY_SOURCES_WITH_MC_SUPPORTED + }; + +-struct MYSOFA_HRTF *mysofa_load(const char *filename, int *err); +-struct MYSOFA_HRTF *mysofa_load_data(const char *data, size_t size, int *err); ++MYSOFA_EXPORT struct MYSOFA_HRTF *mysofa_load(const char *filename, int *err); ++MYSOFA_EXPORT struct MYSOFA_HRTF *mysofa_load_data(const char *data, size_t size, int *err); + +-int mysofa_check(struct MYSOFA_HRTF *hrtf); +-char *mysofa_getAttribute(struct MYSOFA_ATTRIBUTE *attr, char *name); +-void mysofa_tospherical(struct MYSOFA_HRTF *hrtf); +-void mysofa_tocartesian(struct MYSOFA_HRTF *hrtf); +-void mysofa_free(struct MYSOFA_HRTF *hrtf); ++MYSOFA_EXPORT int mysofa_check(struct MYSOFA_HRTF *hrtf); ++MYSOFA_EXPORT char *mysofa_getAttribute(struct MYSOFA_ATTRIBUTE *attr, char *name); ++MYSOFA_EXPORT void mysofa_tospherical(struct MYSOFA_HRTF *hrtf); ++MYSOFA_EXPORT void mysofa_tocartesian(struct MYSOFA_HRTF *hrtf); ++MYSOFA_EXPORT void mysofa_free(struct MYSOFA_HRTF *hrtf); + +-struct MYSOFA_LOOKUP *mysofa_lookup_init(struct MYSOFA_HRTF *hrtf); +-int mysofa_lookup(struct MYSOFA_LOOKUP *lookup, float *coordinate); +-void mysofa_lookup_free(struct MYSOFA_LOOKUP *lookup); ++MYSOFA_EXPORT struct MYSOFA_LOOKUP *mysofa_lookup_init(struct MYSOFA_HRTF *hrtf); ++MYSOFA_EXPORT int mysofa_lookup(struct MYSOFA_LOOKUP *lookup, float *coordinate); ++MYSOFA_EXPORT void mysofa_lookup_free(struct MYSOFA_LOOKUP *lookup); + +-struct MYSOFA_NEIGHBORHOOD * ++MYSOFA_EXPORT struct MYSOFA_NEIGHBORHOOD * + mysofa_neighborhood_init(struct MYSOFA_HRTF *hrtf, + struct MYSOFA_LOOKUP *lookup); +-struct MYSOFA_NEIGHBORHOOD *mysofa_neighborhood_init_withstepdefine( ++MYSOFA_EXPORT struct MYSOFA_NEIGHBORHOOD *mysofa_neighborhood_init_withstepdefine( + struct MYSOFA_HRTF *hrtf, struct MYSOFA_LOOKUP *lookup, + float neighbor_angle_step, float neighbor_radius_step); +-int *mysofa_neighborhood(struct MYSOFA_NEIGHBORHOOD *neighborhood, int pos); +-void mysofa_neighborhood_free(struct MYSOFA_NEIGHBORHOOD *neighborhood); ++MYSOFA_EXPORT int *mysofa_neighborhood(struct MYSOFA_NEIGHBORHOOD *neighborhood, int pos); ++MYSOFA_EXPORT void mysofa_neighborhood_free(struct MYSOFA_NEIGHBORHOOD *neighborhood); + +-float *mysofa_interpolate(struct MYSOFA_HRTF *hrtf, float *cordinate, ++MYSOFA_EXPORT float *mysofa_interpolate(struct MYSOFA_HRTF *hrtf, float *cordinate, + int nearest, int *neighborhood, float *fir, + float *delays); + +-int mysofa_resample(struct MYSOFA_HRTF *hrtf, float samplerate); +-float mysofa_loudness(struct MYSOFA_HRTF *hrtf); +-int mysofa_minphase(struct MYSOFA_HRTF *hrtf, float threshold); ++MYSOFA_EXPORT int mysofa_resample(struct MYSOFA_HRTF *hrtf, float samplerate); ++MYSOFA_EXPORT float mysofa_loudness(struct MYSOFA_HRTF *hrtf); ++MYSOFA_EXPORT int mysofa_minphase(struct MYSOFA_HRTF *hrtf, float threshold); + +-struct MYSOFA_EASY *mysofa_cache_lookup(const char *filename, float samplerate); +-struct MYSOFA_EASY *mysofa_cache_store(struct MYSOFA_EASY *, ++MYSOFA_EXPORT struct MYSOFA_EASY *mysofa_cache_lookup(const char *filename, float samplerate); ++MYSOFA_EXPORT struct MYSOFA_EASY *mysofa_cache_store(struct MYSOFA_EASY *, + const char *filename, float samplerate); +-void mysofa_cache_release(struct MYSOFA_EASY *); +-void mysofa_cache_release_all(void); ++MYSOFA_EXPORT void mysofa_cache_release(struct MYSOFA_EASY *); ++MYSOFA_EXPORT void mysofa_cache_release_all(void); + +-void mysofa_c2s(float values[3]); +-void mysofa_s2c(float values[3]); ++MYSOFA_EXPORT void mysofa_c2s(float values[3]); ++MYSOFA_EXPORT void mysofa_s2c(float values[3]); + + struct MYSOFA_EASY { + struct MYSOFA_HRTF *hrtf; +@@ -173,38 +173,38 @@ struct MYSOFA_EASY { + float *fir; + }; + +-struct MYSOFA_EASY *mysofa_open(const char *filename, float samplerate, ++MYSOFA_EXPORT struct MYSOFA_EASY *mysofa_open(const char *filename, float samplerate, + int *filterlength, int *err); +-struct MYSOFA_EASY *mysofa_open_no_norm(const char *filename, float samplerate, ++MYSOFA_EXPORT struct MYSOFA_EASY *mysofa_open_no_norm(const char *filename, float samplerate, + int *filterlength, int *err); +-struct MYSOFA_EASY *mysofa_open_advanced(const char *filename, float samplerate, ++MYSOFA_EXPORT struct MYSOFA_EASY *mysofa_open_advanced(const char *filename, float samplerate, + int *filterlength, int *err, bool norm, + float neighbor_angle_step, + float neighbor_radius_step); +-struct MYSOFA_EASY *mysofa_open_data(const char *data, long size, ++MYSOFA_EXPORT struct MYSOFA_EASY *mysofa_open_data(const char *data, long size, + float samplerate, int *filterlength, + int *err); +-struct MYSOFA_EASY *mysofa_open_data_no_norm(const char *data, long size, ++MYSOFA_EXPORT struct MYSOFA_EASY *mysofa_open_data_no_norm(const char *data, long size, + float samplerate, + int *filterlength, int *err); +-struct MYSOFA_EASY *mysofa_open_data_advanced( ++MYSOFA_EXPORT struct MYSOFA_EASY *mysofa_open_data_advanced( + const char *data, long size, float samplerate, int *filterlength, int *err, + bool norm, float neighbor_angle_step, float neighbor_radius_step); +-struct MYSOFA_EASY *mysofa_open_cached(const char *filename, float samplerate, ++MYSOFA_EXPORT struct MYSOFA_EASY *mysofa_open_cached(const char *filename, float samplerate, + int *filterlength, int *err); +-void mysofa_getfilter_short(struct MYSOFA_EASY *easy, float x, float y, float z, ++MYSOFA_EXPORT void mysofa_getfilter_short(struct MYSOFA_EASY *easy, float x, float y, float z, + short *IRleft, short *IRright, int *delayLeft, + int *delayRight); +-void mysofa_getfilter_float(struct MYSOFA_EASY *easy, float x, float y, float z, ++MYSOFA_EXPORT void mysofa_getfilter_float(struct MYSOFA_EASY *easy, float x, float y, float z, + float *IRleft, float *IRright, float *delayLeft, + float *delayRight); +-void mysofa_getfilter_float_nointerp(struct MYSOFA_EASY *easy, float x, float y, ++MYSOFA_EXPORT void mysofa_getfilter_float_nointerp(struct MYSOFA_EASY *easy, float x, float y, + float z, float *IRleft, float *IRright, + float *delayLeft, float *delayRight); +-void mysofa_close(struct MYSOFA_EASY *easy); +-void mysofa_close_cached(struct MYSOFA_EASY *easy); ++MYSOFA_EXPORT void mysofa_close(struct MYSOFA_EASY *easy); ++MYSOFA_EXPORT void mysofa_close_cached(struct MYSOFA_EASY *easy); + +-void mysofa_getversion(int *major, int *minor, int *patch); ++MYSOFA_EXPORT void mysofa_getversion(int *major, int *minor, int *patch); + + #ifdef __cplusplus + } diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index fdccaa425d9..cc9fb56fb7c 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -17,6 +17,7 @@ package("libmysofa") os.cp("share/MIT_KEMAR_normal_pinna.sofa", "share/default.sofa") local configs = {"-DBUILD_TESTS=OFF"} table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) import("package.tools.cmake").install(package, configs) end) From 0abccb5314592e9f299170ba9a52320869e72963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 12:04:41 +0300 Subject: [PATCH 10/30] h --- packages/l/libmysofa/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index cc9fb56fb7c..1c98c670562 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -8,7 +8,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "beb93eaaea535ca69669f5f77dbf96e42ab35e66f25c6889ac1a53c56da30528") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "af5bd833a0d4ed9deffc3f2a50c79b0b170d4a71c39f32a57d4066eea5d0f88b") add_deps("cmake", "zlib") From 8651f7cd95ec17302945cb3c97df6839c06bf6b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 12:07:33 +0300 Subject: [PATCH 11/30] pic off --- packages/l/libmysofa/patches/v1.3.2/fix-build.patch | 4 ++-- packages/l/libmysofa/xmake.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index 7a39369b687..c5be16afba3 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dcaa92a..03343b5 100644 +index dcaa92a..6c3181b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,21 +13,23 @@ use_c99() @@ -67,7 +67,7 @@ index dcaa92a..03343b5 100644 mysofa-static PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1 POSITION_INDEPENDENT_CODE - ${BUILD_SHARED_LIBS}) -+ ${NOT(BUILD_SHARED_LIBS)}) ++ OFF) set_target_properties( mysofa-static PROPERTIES PUBLIC_HEADER "${public-headers}" ) install(TARGETS mysofa-static EXPORT mysofa_exports diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 1c98c670562..121cbddfd6e 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -8,7 +8,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "af5bd833a0d4ed9deffc3f2a50c79b0b170d4a71c39f32a57d4066eea5d0f88b") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "bac09b04bd3a9e07092b30afdbd6aff9f0181a288bff3b933dd288064873c8c1") add_deps("cmake", "zlib") From 30bde53b81ec4979658f5b820071b16dc5098ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 12:08:38 +0300 Subject: [PATCH 12/30] "-DCMAKE_POLICY_DEFAULT_CMP0057=NEW" --- packages/l/libmysofa/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 121cbddfd6e..fe3eae4c2d0 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -15,7 +15,7 @@ package("libmysofa") on_install(function (package) os.rm("share/default.sofa") os.cp("share/MIT_KEMAR_normal_pinna.sofa", "share/default.sofa") - local configs = {"-DBUILD_TESTS=OFF"} + local configs = {"-DBUILD_TESTS=OFF", "-DCMAKE_POLICY_DEFAULT_CMP0057=NEW"} table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) import("package.tools.cmake").install(package, configs) From 91b9fc752d33314445021c3a37c43034e594d579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 12:22:39 +0300 Subject: [PATCH 13/30] fix export --- .../l/libmysofa/patches/v1.3.2/fix-build.patch | 15 ++++++++++++--- packages/l/libmysofa/xmake.lua | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index c5be16afba3..690956b8d84 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -93,10 +93,19 @@ index dcaa92a..6c3181b 100644 add_executable(mysofa2json tests/sofa2json.c tests/json.c) if(BUILD_STATIC_LIBS) diff --git a/src/hrtf/mysofa.h b/src/hrtf/mysofa.h -index 206e77b..cb6c557 100644 +index 206e77b..538f0b6 100644 --- a/src/hrtf/mysofa.h +++ b/src/hrtf/mysofa.h -@@ -127,44 +127,44 @@ enum { +@@ -14,6 +14,8 @@ extern "C" { + #include + #include + ++#include "mysofa_export.h" ++ + #define MYSOFA_DEFAULT_NEIGH_STEP_ANGLE 0.5f + #define MYSOFA_DEFAULT_NEIGH_STEP_RADIUS 0.01f + +@@ -127,44 +129,44 @@ enum { MYSOFA_ONLY_SOURCES_WITH_MC_SUPPORTED }; @@ -165,7 +174,7 @@ index 206e77b..cb6c557 100644 struct MYSOFA_EASY { struct MYSOFA_HRTF *hrtf; -@@ -173,38 +173,38 @@ struct MYSOFA_EASY { +@@ -173,38 +175,38 @@ struct MYSOFA_EASY { float *fir; }; diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index fe3eae4c2d0..a1bfdc22dfb 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -8,11 +8,12 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "bac09b04bd3a9e07092b30afdbd6aff9f0181a288bff3b933dd288064873c8c1") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "bb799e249773edcff9520856b44d6aaba8d6cb3d88a5371877194ddd580ca3c6") add_deps("cmake", "zlib") on_install(function (package) + os.rm("windows/third-party/zlib-1.2.11") os.rm("share/default.sofa") os.cp("share/MIT_KEMAR_normal_pinna.sofa", "share/default.sofa") local configs = {"-DBUILD_TESTS=OFF", "-DCMAKE_POLICY_DEFAULT_CMP0057=NEW"} From 6755319c3851b045f5076e814f7a10453104c005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 13:45:44 +0300 Subject: [PATCH 14/30] test --- .../l/libmysofa/patches/v1.3.2/fix-build.patch | 14 +++++++++----- packages/l/libmysofa/xmake.lua | 5 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index 690956b8d84..c4e912a1ba9 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -1,15 +1,19 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dcaa92a..6c3181b 100644 +index dcaa92a..483442c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -13,21 +13,23 @@ use_c99() - configure_file(config.h.in config.h) - include_directories(${CMAKE_CURRENT_BINARY_DIR}) +@@ -10,8 +10,9 @@ endmacro(use_c99) + + use_c99() +find_package(ZLIB REQUIRED) + configure_file(config.h.in config.h) +-include_directories(${CMAKE_CURRENT_BINARY_DIR}) ++include_directories(${CMAKE_CURRENT_BINARY_DIR} ${ZLIB_INCLUDE_DIRS}) + if(NOT MSVC) if(NOT WIN32) - find_library(MATH m) +@@ -19,15 +20,16 @@ if(NOT MSVC) else() set(MATH "") endif() diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index a1bfdc22dfb..0e665d3b282 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -8,7 +8,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "bb799e249773edcff9520856b44d6aaba8d6cb3d88a5371877194ddd580ca3c6") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "dd166f489adf647554f9cc449bb71b8ae1070dc75e6bb8d291fe6d73ede21766") add_deps("cmake", "zlib") @@ -17,7 +17,8 @@ package("libmysofa") os.rm("share/default.sofa") os.cp("share/MIT_KEMAR_normal_pinna.sofa", "share/default.sofa") local configs = {"-DBUILD_TESTS=OFF", "-DCMAKE_POLICY_DEFAULT_CMP0057=NEW"} - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "OFF" or "ON")) table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) import("package.tools.cmake").install(package, configs) end) From 38bceec3ca5ad0d939b641228c6ba1fca19d532a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 14:25:10 +0300 Subject: [PATCH 15/30] check without pos-i-code --- packages/l/libmysofa/patches/v1.3.2/fix-build.patch | 11 +---------- packages/l/libmysofa/xmake.lua | 4 ++-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index c4e912a1ba9..eca74c6822c 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dcaa92a..483442c 100644 +index dcaa92a..aff976f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,8 +10,9 @@ endmacro(use_c99) @@ -75,15 +75,6 @@ index dcaa92a..483442c 100644 set_target_properties( mysofa-static PROPERTIES PUBLIC_HEADER "${public-headers}" ) install(TARGETS mysofa-static EXPORT mysofa_exports -@@ -113,7 +116,7 @@ install(TARGETS mysofa-static - endif() - endif() - --if(BUILD_SHARED_LIBS) -+if(NOT(BUILD_SHARED_LIBS)) - add_library(mysofa-shared SHARED ${libsrc}) - target_include_directories(mysofa-shared - PUBLIC @@ -169,6 +172,11 @@ else() mysofa_export.h) endif() diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 0e665d3b282..c5aa2f66621 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -8,7 +8,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "dd166f489adf647554f9cc449bb71b8ae1070dc75e6bb8d291fe6d73ede21766") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "d815651f421eb41fde33491562895a11610916304ed47641e93b916260c95d67") add_deps("cmake", "zlib") @@ -18,7 +18,7 @@ package("libmysofa") os.cp("share/MIT_KEMAR_normal_pinna.sofa", "share/default.sofa") local configs = {"-DBUILD_TESTS=OFF", "-DCMAKE_POLICY_DEFAULT_CMP0057=NEW"} table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) - table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "OFF" or "ON")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) import("package.tools.cmake").install(package, configs) end) From d8ad5d3b98ecebaef4415867c16a740bc66a45e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 15:13:53 +0300 Subject: [PATCH 16/30] follow upstream --- .../l/libmysofa/patches/v1.3.2/fix-build.patch | 18 ++++++------------ packages/l/libmysofa/xmake.lua | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index eca74c6822c..a4777833435 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -1,5 +1,5 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dcaa92a..aff976f 100644 +index dcaa92a..12f4b7a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,8 +10,9 @@ endmacro(use_c99) @@ -61,7 +61,7 @@ index dcaa92a..aff976f 100644 if(BUILD_STATIC_LIBS) add_library(mysofa-static STATIC ${libsrc}) -@@ -88,11 +91,11 @@ target_include_directories(mysofa-static +@@ -88,7 +91,7 @@ target_include_directories(mysofa-static "$" $ ) @@ -70,11 +70,6 @@ index dcaa92a..aff976f 100644 set_target_properties( mysofa-static PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1 POSITION_INDEPENDENT_CODE -- ${BUILD_SHARED_LIBS}) -+ OFF) - set_target_properties( mysofa-static PROPERTIES PUBLIC_HEADER "${public-headers}" ) - install(TARGETS mysofa-static - EXPORT mysofa_exports @@ -169,6 +172,11 @@ else() mysofa_export.h) endif() @@ -88,19 +83,18 @@ index dcaa92a..aff976f 100644 add_executable(mysofa2json tests/sofa2json.c tests/json.c) if(BUILD_STATIC_LIBS) diff --git a/src/hrtf/mysofa.h b/src/hrtf/mysofa.h -index 206e77b..538f0b6 100644 +index 206e77b..82bc9d9 100644 --- a/src/hrtf/mysofa.h +++ b/src/hrtf/mysofa.h -@@ -14,6 +14,8 @@ extern "C" { +@@ -14,6 +14,7 @@ extern "C" { #include #include +#include "mysofa_export.h" -+ #define MYSOFA_DEFAULT_NEIGH_STEP_ANGLE 0.5f #define MYSOFA_DEFAULT_NEIGH_STEP_RADIUS 0.01f -@@ -127,44 +129,44 @@ enum { +@@ -127,44 +128,44 @@ enum { MYSOFA_ONLY_SOURCES_WITH_MC_SUPPORTED }; @@ -169,7 +163,7 @@ index 206e77b..538f0b6 100644 struct MYSOFA_EASY { struct MYSOFA_HRTF *hrtf; -@@ -173,38 +175,38 @@ struct MYSOFA_EASY { +@@ -173,38 +174,38 @@ struct MYSOFA_EASY { float *fir; }; diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index c5aa2f66621..764527e6e19 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -8,7 +8,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "d815651f421eb41fde33491562895a11610916304ed47641e93b916260c95d67") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "ca3ea0fe340d414b2a1352b62153c65ca37642975729c5f3df5103f251d1f64f") add_deps("cmake", "zlib") From f9acc79aa40a0a70d6a64bf28d970e935586fe53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 15:31:14 +0300 Subject: [PATCH 17/30] check ems & bsd --- packages/l/libmysofa/patches/v1.3.2/fix-build.patch | 13 ++++++++----- packages/l/libmysofa/xmake.lua | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index a4777833435..adbf13535c9 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -1,8 +1,8 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dcaa92a..12f4b7a 100644 +index dcaa92a..76fd021 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -10,8 +10,9 @@ endmacro(use_c99) +@@ -10,38 +10,39 @@ endmacro(use_c99) use_c99() @@ -12,8 +12,9 @@ index dcaa92a..12f4b7a 100644 +include_directories(${CMAKE_CURRENT_BINARY_DIR} ${ZLIB_INCLUDE_DIRS}) if(NOT MSVC) - if(NOT WIN32) -@@ -19,15 +20,16 @@ if(NOT MSVC) +- if(NOT WIN32) ++ if(NOT WIN32 AND NOT EMSCRIPTEN) + find_library(MATH m) else() set(MATH "") endif() @@ -31,7 +32,9 @@ index dcaa92a..12f4b7a 100644 endif() if(NOT MSVC) -@@ -36,12 +38,11 @@ if(NOT MSVC) +- if(NOT WIN32) ++ if(NOT WIN32 AND NOT EMSCRIPTEN) + find_library(MATH m) else() set(MATH "") endif() diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 764527e6e19..e3d6eedc62c 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -13,6 +13,9 @@ package("libmysofa") add_deps("cmake", "zlib") on_install(function (package) + if package:is_plat("bsd") then + io.replace("src/CMakeLists.txt", [[find_library(MATH m)]], [[set(MATH "")]], {plain = true}) + end os.rm("windows/third-party/zlib-1.2.11") os.rm("share/default.sofa") os.cp("share/MIT_KEMAR_normal_pinna.sofa", "share/default.sofa") From 50f44b2d1fd105ee911adf807c3b9ab4c7de1b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 15:31:52 +0300 Subject: [PATCH 18/30] h --- packages/l/libmysofa/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index e3d6eedc62c..555d5f09077 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -8,7 +8,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "ca3ea0fe340d414b2a1352b62153c65ca37642975729c5f3df5103f251d1f64f") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "a237469fe6e28bbdb2701c0fb07aac9e7bb4f05f7e155041d341857bac2baf64") add_deps("cmake", "zlib") From e8d086a4d64773fc3eb3864ef0957e8db68c608c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 15:45:10 +0300 Subject: [PATCH 19/30] !wasm & is_plat("cross", "bsd") --- packages/l/libmysofa/xmake.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 555d5f09077..e4ac71a05b1 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -12,8 +12,8 @@ package("libmysofa") add_deps("cmake", "zlib") - on_install(function (package) - if package:is_plat("bsd") then + on_install("!wasm", function (package) + if package:is_plat("cross", "bsd") then io.replace("src/CMakeLists.txt", [[find_library(MATH m)]], [[set(MATH "")]], {plain = true}) end os.rm("windows/third-party/zlib-1.2.11") From 58a518cf89ffcd3ba2b470e841f82111a5792157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 17:41:24 +0300 Subject: [PATCH 20/30] revise --- packages/l/libmysofa/xmake.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index e4ac71a05b1..8569e4f28cc 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -12,8 +12,12 @@ package("libmysofa") add_deps("cmake", "zlib") - on_install("!wasm", function (package) - if package:is_plat("cross", "bsd") then + if is_plat("linux", "bsd") then + add_syslinks("m", "pthread") + end + + on_install(function (package) + if package:is_plat("wasm", "cross") then io.replace("src/CMakeLists.txt", [[find_library(MATH m)]], [[set(MATH "")]], {plain = true}) end os.rm("windows/third-party/zlib-1.2.11") From 4ce755e8315834b9e7fac997ade187b5ff1a49a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=95=E3=81=8F=E3=82=89=E3=81=BF=E3=81=93?= Date: Sat, 28 Dec 2024 19:12:20 +0300 Subject: [PATCH 21/30] follow upstream --- .../libmysofa/patches/v1.3.2/fix-build.patch | 38 +++++++++++++++++++ packages/l/libmysofa/xmake.lua | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index adbf13535c9..4604e31de53 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -218,3 +218,41 @@ index 206e77b..82bc9d9 100644 #ifdef __cplusplus } +diff --git a/src/hrtf/portable_endian.h b/src/hrtf/portable_endian.h +index d1e76f5..5fb4b55 100644 +--- a/src/hrtf/portable_endian.h ++++ b/src/hrtf/portable_endian.h +@@ -13,7 +13,7 @@ + + #endif + +-#if defined(__linux__) || defined(__CYGWIN__) ++#if defined(__linux__) || defined(__CYGWIN__) || defined(__illumos__) + + # include + +@@ -41,23 +41,10 @@ + # define __LITTLE_ENDIAN LITTLE_ENDIAN + # define __PDP_ENDIAN PDP_ENDIAN + +-#elif defined(__OpenBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) + + # include + +-#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) +- +-# include +- +-# define be16toh(x) betoh16(x) +-# define le16toh(x) letoh16(x) +- +-# define be32toh(x) betoh32(x) +-# define le32toh(x) letoh32(x) +- +-# define be64toh(x) betoh64(x) +-# define le64toh(x) letoh64(x) +- + #elif defined(__WINDOWS__) + + # include diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 8569e4f28cc..36d1d171f7d 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -8,7 +8,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "a237469fe6e28bbdb2701c0fb07aac9e7bb4f05f7e155041d341857bac2baf64") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "5b78f981ea5fabfdc33625ede95c2b9a5edba0f570e69f063c0a59d94a551a2e") add_deps("cmake", "zlib") From 7db8cf424047e6b70477dcca062de351c05c5177 Mon Sep 17 00:00:00 2001 From: Saikari Date: Wed, 1 Jan 2025 23:13:53 +0300 Subject: [PATCH 22/30] test CI --- packages/l/libmysofa/patches/v1.3.2/fix-build.patch | 2 +- packages/l/libmysofa/xmake.lua | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index 4604e31de53..303e060a3dd 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -227,7 +227,7 @@ index d1e76f5..5fb4b55 100644 #endif -#if defined(__linux__) || defined(__CYGWIN__) -+#if defined(__linux__) || defined(__CYGWIN__) || defined(__illumos__) ++#if defined(__linux__) || defined(__CYGWIN__) || defined(__illumos__) || defined(__GNU__) || defined(__EMSCRIPTEN__) # include diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 36d1d171f7d..729b0d4933b 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -8,12 +8,12 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "5b78f981ea5fabfdc33625ede95c2b9a5edba0f570e69f063c0a59d94a551a2e") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "34308e9aab3700c2db1bcdc230fc9fbd399b8ff4a849fb94a86c99ebfb49a670") add_deps("cmake", "zlib") if is_plat("linux", "bsd") then - add_syslinks("m", "pthread") + add_syslinks("pthread") end on_install(function (package) @@ -21,7 +21,6 @@ package("libmysofa") io.replace("src/CMakeLists.txt", [[find_library(MATH m)]], [[set(MATH "")]], {plain = true}) end os.rm("windows/third-party/zlib-1.2.11") - os.rm("share/default.sofa") os.cp("share/MIT_KEMAR_normal_pinna.sofa", "share/default.sofa") local configs = {"-DBUILD_TESTS=OFF", "-DCMAKE_POLICY_DEFAULT_CMP0057=NEW"} table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) From af4848ac5a00c1ec1913c6ade63ce36812c5101f Mon Sep 17 00:00:00 2001 From: Saikari Date: Wed, 1 Jan 2025 23:27:46 +0300 Subject: [PATCH 23/30] retry --- packages/l/libmysofa/xmake.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 729b0d4933b..c3e594dea9f 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -1,6 +1,7 @@ package("libmysofa") set_homepage("https://github.com/hoene/libmysofa") set_description("Reader for AES SOFA files to get better HRTFs") + set_license("BSD-3-Clause") add_urls("https://github.com/hoene/libmysofa/archive/refs/tags/$(version).tar.gz", From 34fc324deda58a49e1511cf73e17f198cb9a38bf Mon Sep 17 00:00:00 2001 From: Saikari Date: Wed, 1 Jan 2025 23:36:30 +0300 Subject: [PATCH 24/30] return os.rm("share/default.sofa") --- packages/l/libmysofa/xmake.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index c3e594dea9f..8f8a000824e 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -22,6 +22,7 @@ package("libmysofa") io.replace("src/CMakeLists.txt", [[find_library(MATH m)]], [[set(MATH "")]], {plain = true}) end os.rm("windows/third-party/zlib-1.2.11") + os.rm("share/default.sofa") os.cp("share/MIT_KEMAR_normal_pinna.sofa", "share/default.sofa") local configs = {"-DBUILD_TESTS=OFF", "-DCMAKE_POLICY_DEFAULT_CMP0057=NEW"} table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON")) From 50f04de314377d25d218a8cf4c52f72934628431 Mon Sep 17 00:00:00 2001 From: Saikari Date: Thu, 2 Jan 2025 15:51:36 +0300 Subject: [PATCH 25/30] Update xmake.lua --- packages/l/libmysofa/xmake.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 8f8a000824e..6ef5bc1b1ce 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -1,7 +1,6 @@ package("libmysofa") set_homepage("https://github.com/hoene/libmysofa") set_description("Reader for AES SOFA files to get better HRTFs") - set_license("BSD-3-Clause") add_urls("https://github.com/hoene/libmysofa/archive/refs/tags/$(version).tar.gz", From 619699807fdcafe5375da2274461bd3bf2888fcb Mon Sep 17 00:00:00 2001 From: Saikari Date: Thu, 2 Jan 2025 19:08:42 +0300 Subject: [PATCH 26/30] rerun ci --- packages/l/libmysofa/xmake.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 6ef5bc1b1ce..8f8a000824e 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -1,6 +1,7 @@ package("libmysofa") set_homepage("https://github.com/hoene/libmysofa") set_description("Reader for AES SOFA files to get better HRTFs") + set_license("BSD-3-Clause") add_urls("https://github.com/hoene/libmysofa/archive/refs/tags/$(version).tar.gz", From acf5536a3d71529df6c7eff079bf4779e42ea275 Mon Sep 17 00:00:00 2001 From: Saikari Date: Thu, 2 Jan 2025 19:35:42 +0300 Subject: [PATCH 27/30] CRLF -> LF --- packages/l/libmysofa/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 8f8a000824e..a9b9c58ac6a 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -9,7 +9,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "34308e9aab3700c2db1bcdc230fc9fbd399b8ff4a849fb94a86c99ebfb49a670") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "1112d9d3b527363dcae1e00ab3b1b547f252bf5ad4e1c702d50dc375ec6efac6") add_deps("cmake", "zlib") From 65105aabb8a5fa798231bd5fb77261567c12f2a9 Mon Sep 17 00:00:00 2001 From: Saikari Date: Fri, 3 Jan 2025 08:02:02 +0300 Subject: [PATCH 28/30] test ci --- packages/l/libmysofa/patches/v1.3.2/fix-build.patch | 2 +- packages/l/libmysofa/xmake.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index 303e060a3dd..8c56504f525 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -227,7 +227,7 @@ index d1e76f5..5fb4b55 100644 #endif -#if defined(__linux__) || defined(__CYGWIN__) -+#if defined(__linux__) || defined(__CYGWIN__) || defined(__illumos__) || defined(__GNU__) || defined(__EMSCRIPTEN__) ++#if defined(__linux__) || defined(__CYGWIN__) || defined(__illumos__) || defined(__GNU__) || defined(__linux) || defined(linux) || defined(__gnu_linux__) # include diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index a9b9c58ac6a..36e0f6a09a7 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -9,7 +9,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "1112d9d3b527363dcae1e00ab3b1b547f252bf5ad4e1c702d50dc375ec6efac6") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "a28aed4c5e766081ff90a7aed74c58b77927432a80385f6aad9f3278cde6bb59") add_deps("cmake", "zlib") From 374806457fcf3d82edae80c386dce0f7b1727abd Mon Sep 17 00:00:00 2001 From: Saikari Date: Fri, 3 Jan 2025 08:36:41 +0300 Subject: [PATCH 29/30] check wasm for defined(__UBUNTU__) --- packages/l/libmysofa/patches/v1.3.2/fix-build.patch | 2 +- packages/l/libmysofa/xmake.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index 8c56504f525..b006b9cb4a1 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -227,7 +227,7 @@ index d1e76f5..5fb4b55 100644 #endif -#if defined(__linux__) || defined(__CYGWIN__) -+#if defined(__linux__) || defined(__CYGWIN__) || defined(__illumos__) || defined(__GNU__) || defined(__linux) || defined(linux) || defined(__gnu_linux__) ++#if defined(__linux__) || defined(__CYGWIN__) || defined(__illumos__) || defined(__GNU__) || defined(__linux) || defined(linux) || defined(__gnu_linux__) || defined(__UBUNTU__) # include diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index 36e0f6a09a7..a55640b9e52 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -9,7 +9,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "a28aed4c5e766081ff90a7aed74c58b77927432a80385f6aad9f3278cde6bb59") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "890ba9fdbba755499eae72e8f8e3f0dabd39eaa4edc4330c61c4b15efa0e30a1") add_deps("cmake", "zlib") From d18e48e4af1bafa5cf76dc1631933cbdd9b29d92 Mon Sep 17 00:00:00 2001 From: Saikari Date: Fri, 3 Jan 2025 15:43:05 +0300 Subject: [PATCH 30/30] test ci --- .../l/libmysofa/patches/v1.3.2/fix-build.patch | 2 +- packages/l/libmysofa/xmake.lua | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch index b006b9cb4a1..8c56504f525 100644 --- a/packages/l/libmysofa/patches/v1.3.2/fix-build.patch +++ b/packages/l/libmysofa/patches/v1.3.2/fix-build.patch @@ -227,7 +227,7 @@ index d1e76f5..5fb4b55 100644 #endif -#if defined(__linux__) || defined(__CYGWIN__) -+#if defined(__linux__) || defined(__CYGWIN__) || defined(__illumos__) || defined(__GNU__) || defined(__linux) || defined(linux) || defined(__gnu_linux__) || defined(__UBUNTU__) ++#if defined(__linux__) || defined(__CYGWIN__) || defined(__illumos__) || defined(__GNU__) || defined(__linux) || defined(linux) || defined(__gnu_linux__) # include diff --git a/packages/l/libmysofa/xmake.lua b/packages/l/libmysofa/xmake.lua index a55640b9e52..a0eed8227a7 100644 --- a/packages/l/libmysofa/xmake.lua +++ b/packages/l/libmysofa/xmake.lua @@ -9,7 +9,7 @@ package("libmysofa") add_versions("v1.3.2", "6c5224562895977e87698a64cb7031361803d136057bba35ed4979b69ab4ba76") - add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "890ba9fdbba755499eae72e8f8e3f0dabd39eaa4edc4330c61c4b15efa0e30a1") + add_patches("v1.3.2", "patches/v1.3.2/fix-build.patch", "a28aed4c5e766081ff90a7aed74c58b77927432a80385f6aad9f3278cde6bb59") add_deps("cmake", "zlib") @@ -21,6 +21,18 @@ package("libmysofa") if package:is_plat("wasm", "cross") then io.replace("src/CMakeLists.txt", [[find_library(MATH m)]], [[set(MATH "")]], {plain = true}) end + if is_host("windows") and package:is_plat("wasm") then + io.replace("src/hrtf/portable_endian.h", [[elif defined(__WINDOWS__)]], [[elif 1]], {plain = true}) + end + if is_host("linux") and package:is_plat("wasm") then + io.replace("src/hrtf/portable_endian.h", [[if defined(__linux__)]], [[if 1]], {plain = true}) + end + if is_host("bsd") and package:is_plat("wasm") then + io.replace("src/hrtf/portable_endian.h", [[defined(__FreeBSD__)]], [[1]], {plain = true}) + end + if is_host("macosx") and package:is_plat("wasm") then + io.replace("src/hrtf/portable_endian.h", [[elif defined(__APPLE__)]], [[elif 1]], {plain = true}) + end os.rm("windows/third-party/zlib-1.2.11") os.rm("share/default.sofa") os.cp("share/MIT_KEMAR_normal_pinna.sofa", "share/default.sofa")