[vlc-commits] [Git][videolan/vlc][master] contrib: mysofa: upgrade to a version with a proper libmysofa.pc
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sat Apr 11 17:42:18 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
da5f6609 by Steve Lhomme at 2026-04-11T16:21:33+00:00
contrib: mysofa: upgrade to a version with a proper libmysofa.pc
And patch it to use dependencies as static libraries (like zlib).
It's not the most recent builds as new versions tripled the tarball size to 200MB+.
- - - - -
4 changed files:
- + contrib/src/mysofa/0001-Only-link-with-MATH-library-if-it-s-found.patch
- + contrib/src/mysofa/0002-Only-link-with-ZLib-library-if-it-s-found.patch
- contrib/src/mysofa/SHA512SUMS
- contrib/src/mysofa/rules.mak
Changes:
=====================================
contrib/src/mysofa/0001-Only-link-with-MATH-library-if-it-s-found.patch
=====================================
@@ -0,0 +1,69 @@
+From 08f7ea36809aa3d156a118e6a6a0c2f03f4ce3d8 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 10 Apr 2026 14:12:37 +0200
+Subject: [PATCH 1/2] Only link with MATH library if it's found
+
+If it's not found it may not be required (or linking will fail).
+---
+ src/CMakeLists.txt | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index ec4de1d..9c3cd5e 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -15,12 +15,9 @@ configure_file (config.h.in ${PROJECT_SOURCE_DIR}/src/config.h)
+ if(NOT MSVC)
+ if(NOT WIN32)
+ find_library(MATH m)
+- else()
+- set(MATH "")
+ endif()
+ include(FindZLIB)
+ else()
+- set(MATH "")
+ find_program(NUGET nuget)
+ if (NUGET)
+ execute_process(COMMAND ${NUGET} install zlib)
+@@ -35,15 +32,12 @@ endif()
+ if(NOT MSVC)
+ if(NOT WIN32)
+ find_library(MATH m)
+- 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 "")
+ find_program(NUGET nuget)
+ if (NOT NUGET)
+ message(FATAL "Cannot find nuget command line tool.\nInstall it with e.g. choco install nuget.commandline")
+@@ -58,14 +52,20 @@ set(libsrc hrtf/reader.c hdf/superblock.c hdf/dataobject.c hdf/btree.c hdf/fract
+ hrtf/lookup.c hrtf/tools.c hrtf/kdtree.c hrtf/neighbors.c hrtf/interpolate.c hrtf/resample.c hrtf/loudness.c hrtf/minphase.c hrtf/easy.c hrtf/cache.c
+ resampler/speex_resampler.c)
+ add_library(mysofa-static STATIC ${libsrc})
+-target_link_libraries (mysofa-static ${MATH} ${ZLIB_LIBRARIES})
++if(MATH)
++ target_link_libraries (mysofa-static ${MATH})
++endif()
++target_link_libraries (mysofa-static ${ZLIB_LIBRARIES})
+ SET_TARGET_PROPERTIES(mysofa-static PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1 POSITION_INDEPENDENT_CODE ON)
+ install(TARGETS mysofa-static
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ if(BUILD_SHARED_LIBS)
+ add_library(mysofa-shared SHARED ${libsrc})
+- target_link_libraries (mysofa-shared ${MATH} ${ZLIB_LIBRARIES})
++ if(MATH)
++ target_link_libraries (mysofa-shared ${MATH})
++ endif()
++ target_link_libraries (mysofa-shared ${ZLIB_LIBRARIES})
+ SET_TARGET_PROPERTIES(mysofa-shared PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1)
+ set_property(TARGET mysofa-shared PROPERTY VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ set_property(TARGET mysofa-shared PROPERTY SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR} )
+--
+2.52.0.windows.1
+
=====================================
contrib/src/mysofa/0002-Only-link-with-ZLib-library-if-it-s-found.patch
=====================================
@@ -0,0 +1,38 @@
+From f5de11f1ab4ff6b1d2c856e87c0049c4d7a00e02 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 10 Apr 2026 14:17:08 +0200
+Subject: [PATCH 2/2] Only link with ZLib library if it's found
+
+---
+ src/CMakeLists.txt | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 9c3cd5e..e8d913b 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -55,7 +55,9 @@ add_library(mysofa-static STATIC ${libsrc})
+ if(MATH)
+ target_link_libraries (mysofa-static ${MATH})
+ endif()
+-target_link_libraries (mysofa-static ${ZLIB_LIBRARIES})
++if(ZLIB_LIBRARIES)
++ target_link_libraries (mysofa-static ${ZLIB_LIBRARIES})
++endif()
+ SET_TARGET_PROPERTIES(mysofa-static PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1 POSITION_INDEPENDENT_CODE ON)
+ install(TARGETS mysofa-static
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+@@ -65,7 +67,9 @@ if(BUILD_SHARED_LIBS)
+ if(MATH)
+ target_link_libraries (mysofa-shared ${MATH})
+ endif()
+- target_link_libraries (mysofa-shared ${ZLIB_LIBRARIES})
++ if(ZLIB_LIBRARIES)
++ target_link_libraries (mysofa-shared ${ZLIB_LIBRARIES})
++ endif()
+ SET_TARGET_PROPERTIES(mysofa-shared PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1)
+ set_property(TARGET mysofa-shared PROPERTY VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+ set_property(TARGET mysofa-shared PROPERTY SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR} )
+--
+2.52.0.windows.1
+
=====================================
contrib/src/mysofa/SHA512SUMS
=====================================
@@ -1 +1 @@
-9ec0f24d9653674c59420c76f7244521d21099a48a2e09f974fd6a6ea2a2f2e5b312161da23eb6e275ff801af979eba8b0bafc4be75fb1c2cf5c302584ea2366 libmysofa-0.5.tar.gz
+2e7455f0aa0dfb21d18a24e66af14ece5e8b672e3d01d5b1305d508ffcea2a282382e27173e1d2d2c59c2838bc0af5312b4003fe6534d5bcb706fb3dad949353 libmysofa-0.8.tar.gz
=====================================
contrib/src/mysofa/rules.mak
=====================================
@@ -1,6 +1,6 @@
# Mysofa
-MYSOFA_VERSION := 0.5
+MYSOFA_VERSION := 0.8
MYSOFA_URL = $(GITHUB)/hoene/libmysofa/archive/v$(MYSOFA_VERSION).tar.gz
PKGS += mysofa
@@ -21,6 +21,9 @@ $(TARBALLS)/libmysofa-$(MYSOFA_VERSION).tar.gz:
mysofa: libmysofa-$(MYSOFA_VERSION).tar.gz .sum-mysofa
$(UNPACK)
+ $(APPLY) $(SRC)/mysofa/0001-Only-link-with-MATH-library-if-it-s-found.patch
+ $(APPLY) $(SRC)/mysofa/0002-Only-link-with-ZLib-library-if-it-s-found.patch
+ $(call pkg_static,"libmysofa.pc.cmake")
$(MOVE)
MYSOFA_CONF := -DBUILD_TESTS=OFF \
@@ -32,4 +35,3 @@ MYSOFA_CONF := -DBUILD_TESTS=OFF \
+$(CMAKEBUILD)
$(CMAKEINSTALL)
touch $@
-
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/da5f6609c22012eeaf8e12e6912bf476ff9bc510
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/da5f6609c22012eeaf8e12e6912bf476ff9bc510
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list