Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libmad for openSUSE:Factory checked 
in at 2026-11-23 12:21:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libmad (Old)
 and      /work/SRC/openSUSE:Factory/.libmad.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libmad"

Mon Nov 23 12:21:44 2026 rev:10 rq:1399448 version:0.16.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/libmad/libmad.changes    2026-10-21 
20:51:35.830152906 +0200
+++ /work/SRC/openSUSE:Factory/.libmad.new.1340718/libmad.changes       
2026-11-23 12:24:48.600255860 +0100
@@ -1,0 +2,6 @@
+Tue Nov 17 08:18:58 UTC 2026 - Bernhard Wiedemann <[email protected]>
+
+- Add libmad-static-option.patch to fix dangling mad::mad-static
+  target in madTargets.cmake to fix find_package(mad)
+
+-------------------------------------------------------------------

New:
----
  libmad-static-option.patch

----------(New B)----------
  New:
- Add libmad-static-option.patch to fix dangling mad::mad-static
  target in madTargets.cmake to fix find_package(mad)
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libmad.spec ++++++
--- /var/tmp/diff_new_pack.T5mY0v/_old  2026-11-23 12:24:50.314328006 +0100
+++ /var/tmp/diff_new_pack.T5mY0v/_new  2026-11-23 12:24:50.316328091 +0100
@@ -30,6 +30,8 @@
 Source1000:     baselibs.conf
 # PATCH-FIX-UPSTREAM Really fix build on arm
 Patch:          
https://codeberg.org/tenacityteam/libmad/commit/9dd96b40c5caf76fd1c6ef9dcc80ba330eb57a79.patch
+# PATCH-FIX-UPSTREAM Do not export a static library we do not ship - 
https://codeberg.org/tenacityteam/libmad/pulls/48
+Patch:          libmad-static-option.patch
 
 BuildRequires:  cmake
 BuildRequires:  gcc-c++
@@ -76,12 +78,11 @@
 %autosetup -p1 -n libmad
 
 %build
-%cmake -DOPTIMIZE=ACCURACY
+%cmake -DOPTIMIZE=ACCURACY -DBUILD_STATIC_LIBS=OFF
 %cmake_build
 
 %install
 %cmake_install
-find %{buildroot} -name "*.a" -delete
 
 %ldconfig_scriptlets -n %{libname}
 

++++++ libmad-static-option.patch ++++++
>From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: [email protected]
Date: Tue, 17 Nov 2026 08:58:47 +0100
Subject: [PATCH] CMake: Add BUILD_STATIC_LIBS option

Distributions that ship only the shared library had to delete libmad.a
after install, leaving mad::mad-static in madTargets.cmake pointing at a
missing file, which makes find_package(mad) fail.

Also link the example against mad-static when the shared library is off.
---
 BUILDING.md    |  5 +++--
 CMakeLists.txt | 29 +++++++++++++++++++++--------
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/BUILDING.md b/BUILDING.md
index d68f905..e969fdf 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -46,8 +46,9 @@ above commands, you will get a variety of tarballs you can 
use, including a
 * `-DASO` (ON [default, if supported] | OFF): Enables architecture-specific
   optimizations. This onlys works for x86(_64), ARM, and MIPS targets.
 
-* `-DBUILD_SHARED_LIBS` (ON [default] | OFF): Builds shared libraries. If
-  disabled, builds static libraries.
+* `-DBUILD_SHARED_LIBS` (ON [default] | OFF): Builds shared libraries.
+
+* `-DBUILD_STATIC_LIBS` (ON [default] | OFF): Builds static libraries.
 
 * `-DCMAKE_BUILD_TYPE` (Debug, Release, RelWithDebInfo, MinSizeRel): Sets the
   build type. This is a standard CMake option.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4655feb..da41d2c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,10 +28,20 @@ set(MAD_SOURCES
     src/version.c
 )
 
-add_library(mad-static STATIC ${MAD_SOURCES})
-set(ALL_MAD_TARGETS mad-static)
-
 option(BUILD_SHARED_LIBS "Build a shared library version of libmad" ON)
+option(BUILD_STATIC_LIBS "Build a static library version of libmad" ON)
+
+if (NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS)
+    message(FATAL_ERROR "At least one of BUILD_SHARED_LIBS and 
BUILD_STATIC_LIBS must be ON")
+endif()
+
+set(ALL_MAD_TARGETS)
+if (BUILD_STATIC_LIBS)
+    add_library(mad-static STATIC ${MAD_SOURCES})
+    list(APPEND ALL_MAD_TARGETS mad-static)
+    # Ensure the static library is named libmad.a
+    set_target_properties(mad-static PROPERTIES OUTPUT_NAME mad)
+endif()
 
 # Define both targets explicitly
 if (${BUILD_SHARED_LIBS})
@@ -39,9 +49,6 @@ if (${BUILD_SHARED_LIBS})
     list(APPEND ALL_MAD_TARGETS mad)
 endif()
 
-# Ensure the static library is named libmad.a
-set_target_properties(mad-static PROPERTIES OUTPUT_NAME mad)
-
 foreach(t ${ALL_MAD_TARGETS})
     target_include_directories(${t} PUBLIC
         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
@@ -89,7 +96,9 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES ".*(arm|ARM).*")
     if (BUILD_SHARED_LIBS)
         target_sources(mad PRIVATE src/imdct_l_arm.S)
     endif()
-    target_sources(mad-static PRIVATE src/imdct_l_arm.S)
+    if (BUILD_STATIC_LIBS)
+        target_sources(mad-static PRIVATE src/imdct_l_arm.S)
+    endif()
   endif()
 elseif(CMAKE_SYSTEM_PROCESSOR MATCHES ".*(mips|MIPS).*")
   message(STATUS "Using MIPS fixed point math")
@@ -165,7 +174,11 @@ include(CMakeDependentOption)
 cmake_dependent_option(EXAMPLE "Build example executable" ON 
"HAVE_UNISTD_H;HAVE_SYS_STAT_H;HAVE_SYS_MMAN_H" OFF)
 if(EXAMPLE)
   add_executable(mad_example examples/minimad.c)
-  target_link_libraries(mad_example PRIVATE mad)
+  if (BUILD_SHARED_LIBS)
+    target_link_libraries(mad_example PRIVATE mad)
+  else()
+    target_link_libraries(mad_example PRIVATE mad-static)
+  endif()
 endif()
 
 #
-- 
2.56.0

Reply via email to