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")