commit:     2ac4d509de411497f084d675407a2aacbe75f9e0
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Wed Mar 13 04:47:39 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Mar 13 21:04:04 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ac4d509

media-sound/musepack-tools: add 495

Upstream committed this revision in 2016 and is dead since then. It
incorporates several fixes that were painfully patched around long after
the fix was already available upstream.

While we are at it, we can enforce visibility, which upstream supports
but simply did not hook up.

Closes: https://bugs.gentoo.org/530442
Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-sound/musepack-tools/Manifest                |  1 +
 .../musepack-tools-495-fixup-link-depends.patch    | 95 ++++++++++++++++++++++
 .../files/musepack-tools-495-respect-cflags.patch  | 27 ++++++
 .../musepack-tools/musepack-tools-495.ebuild       | 46 +++++++++++
 4 files changed, 169 insertions(+)

diff --git a/media-sound/musepack-tools/Manifest 
b/media-sound/musepack-tools/Manifest
index 508dfd8d69e8..bc3fd6b359ed 100644
--- a/media-sound/musepack-tools/Manifest
+++ b/media-sound/musepack-tools/Manifest
@@ -1 +1,2 @@
 DIST musepack-tools-465.tar.bz2 167612 BLAKE2B 
0748cbfaecec396a4bf054aac5a451f16386becae75cdbb63821c28f7b7d378723df180d909eb3b9e0c7eafa79996dbe7aaab251721fd139b81755e7f59249f1
 SHA512 
ce933376bc127f6f4acc8500e50b6318a6bc5bf8443547fc0e25b4e8e5881fd7a73aff155560ffbc5161b5d7d03522c73bfbc31e14e1531fe511036a0f657d54
+DIST musepack-tools-495.tar.xz 148968 BLAKE2B 
dcc5ae24454a7da03b9ff9094c9680126abd57d700a55b7bfa77693a83a02d831a75cb494795991aabd519e830af4e1450950e4da3bb41a779ad0ad407ef083b
 SHA512 
d518cf88fc7aff8b09566fe201af4f6bcd704a6f6e10a7c0118be910de5faf69ba3fac0c44d6ec8eb9048136bf241133707033046967dd7e999752bfe886ef35

diff --git 
a/media-sound/musepack-tools/files/musepack-tools-495-fixup-link-depends.patch 
b/media-sound/musepack-tools/files/musepack-tools-495-fixup-link-depends.patch
new file mode 100644
index 000000000000..b62800c594a3
--- /dev/null
+++ 
b/media-sound/musepack-tools/files/musepack-tools-495-fixup-link-depends.patch
@@ -0,0 +1,95 @@
+From a71b6e2f189e90b272094b8b9cd88752ff96e785 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwart...@gmail.com>
+Date: Wed, 13 Mar 2024 00:34:22 -0400
+Subject: [PATCH] Fix regression causing executables to not depend on libmpcdec
+
+In revision r491 a "Gentoo patch" was merged, entitled
+
+"Fixup installation of shared mpcdec library."
+
+It inherently clashed with revision r467, which *also* renamed the
+target in question.
+---
+ mpc2sv8/CMakeLists.txt | 2 +-
+ mpcchap/CMakeLists.txt | 2 +-
+ mpccut/CMakeLists.txt  | 2 +-
+ mpcdec/CMakeLists.txt  | 2 +-
+ mpcgain/CMakeLists.txt | 4 ++--
+ 5 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/mpc2sv8/CMakeLists.txt b/mpc2sv8/CMakeLists.txt
+index eea0df0..a4fe93e 100644
+--- a/mpc2sv8/CMakeLists.txt
++++ b/mpc2sv8/CMakeLists.txt
+@@ -13,7 +13,7 @@ endif(MSVC)
+ add_executable(mpc2sv8 mpc2sv8.c)
+ 
+ if(SHARED)
+-  target_link_libraries(mpc2sv8 mpcdec)
++  target_link_libraries(mpc2sv8 mpcdec_shared)
+ else(SHARED)
+   target_link_libraries(mpc2sv8 mpcdec_static)
+ endif(SHARED)
+diff --git a/mpcchap/CMakeLists.txt b/mpcchap/CMakeLists.txt
+index 743d5b6..50c4ded 100644
+--- a/mpcchap/CMakeLists.txt
++++ b/mpcchap/CMakeLists.txt
+@@ -15,7 +15,7 @@ link_directories(${libmpc_BINARY_DIR}/libmpcenc)
+ add_executable(mpcchap mpcchap.c dictionary.c iniparser.c 
${libmpc_SOURCE_DIR}/common/tags.c)
+ 
+ if(SHARED)
+-  target_link_libraries(mpcchap mpcdec)
++  target_link_libraries(mpcchap mpcdec_shared)
+ else(SHARED)
+   target_link_libraries(mpcchap mpcdec_static)
+ endif(SHARED)
+diff --git a/mpccut/CMakeLists.txt b/mpccut/CMakeLists.txt
+index 7d15ce2..2fbfb7a 100644
+--- a/mpccut/CMakeLists.txt
++++ b/mpccut/CMakeLists.txt
+@@ -13,7 +13,7 @@ endif(MSVC)
+ add_executable(mpccut mpccut.c)
+ 
+ if(SHARED)
+-  target_link_libraries(mpccut mpcdec)
++  target_link_libraries(mpccut mpcdec_shared)
+ else(SHARED)
+   target_link_libraries(mpccut mpcdec_static)
+ endif(SHARED)
+diff --git a/mpcdec/CMakeLists.txt b/mpcdec/CMakeLists.txt
+index c95f521..a4ca38f 100644
+--- a/mpcdec/CMakeLists.txt
++++ b/mpcdec/CMakeLists.txt
+@@ -15,7 +15,7 @@ add_executable(mpcdec_cmd mpcdec.c)
+ target_link_libraries(mpcdec_cmd wavformat_static)
+ 
+ if(SHARED)
+-  target_link_libraries(mpcdec_cmd mpcdec)
++  target_link_libraries(mpcdec_cmd mpcdec_shared)
+ else(SHARED)
+   target_link_libraries(mpcdec_cmd mpcdec_static)
+ endif(SHARED)
+diff --git a/mpcgain/CMakeLists.txt b/mpcgain/CMakeLists.txt
+index 5445faf..474f3b3 100644
+--- a/mpcgain/CMakeLists.txt
++++ b/mpcgain/CMakeLists.txt
+@@ -13,14 +13,14 @@ FIND_LIBRARY(REPLAY_GAIN_LIBRARY NAMES replaygain 
replaygain_static PATHS
+ include_directories(${libmpc_SOURCE_DIR}/include)
+ include_directories(${REPLAY_GAIN_INCLUDE_DIR})
+ 
+-link_directories(${libmpc_BINARY_DIR}/libmpcdec)
++link_directories(${libmpc_BINARY_DIR}/libmpcdec_shared)
+ 
+ add_executable(mpcgain mpcgain.c)
+ 
+ target_link_libraries(mpcgain ${REPLAY_GAIN_LIBRARY})
+ 
+ if(SHARED)
+-  target_link_libraries(mpcgain mpcdec)
++  target_link_libraries(mpcgain mpcdec_shared)
+ else(SHARED)
+   target_link_libraries(mpcgain mpcdec_static)
+ endif(SHARED)
+-- 
+2.43.2
+

diff --git 
a/media-sound/musepack-tools/files/musepack-tools-495-respect-cflags.patch 
b/media-sound/musepack-tools/files/musepack-tools-495-respect-cflags.patch
new file mode 100644
index 000000000000..5ed2797ab3bc
--- /dev/null
+++ b/media-sound/musepack-tools/files/musepack-tools-495-respect-cflags.patch
@@ -0,0 +1,27 @@
+From 95ba4fd6c2f2f5bd770d1a100afd65e5c95fa1d0 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwart...@gmail.com>
+Date: Wed, 13 Mar 2024 00:00:45 -0400
+Subject: [PATCH] Respect environment CFLAGS
+
+---
+ CMakeLists.txt | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4d9b78f..3b09d4c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -20,10 +20,6 @@ endif()
+ 
+ add_definitions(-DFAST_MATH -DCVD_FASTLOG)
+ 
+-if(NOT MSVC)
+-  set(CMAKE_C_FLAGS "-O3 -Wall -fomit-frame-pointer -pipe")
+-endif(NOT MSVC)
+-
+ add_subdirectory(libmpcdec)
+ add_subdirectory(libmpcpsy)
+ add_subdirectory(libmpcenc)
+-- 
+2.43.2
+

diff --git a/media-sound/musepack-tools/musepack-tools-495.ebuild 
b/media-sound/musepack-tools/musepack-tools-495.ebuild
new file mode 100644
index 000000000000..4107037ae078
--- /dev/null
+++ b/media-sound/musepack-tools/musepack-tools-495.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake flag-o-matic
+
+# svn export http://svn.musepack.net/libmpc/trunk musepack-tools-${PV}
+# tar -cjf musepack-tools-${PV}.tar.bz2 musepack-tools-${PV}
+
+DESCRIPTION="Musepack SV8 libraries and utilities"
+HOMEPAGE="https://www.musepack.net";
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="BSD LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv 
~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+
+DEPEND="
+       >=media-libs/libcuefile-477
+       >=media-libs/libreplaygain-477
+"
+RDEPEND="
+       ${DEPEND}
+       !media-libs/libmpcdec
+       !media-libs/libmpcdecsv7
+"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-respect-cflags.patch
+       "${FILESDIR}"/${P}-fixup-link-depends.patch
+)
+
+src_configure() {
+       # -Werror=lto-type-mismatch
+       # https://bugs.gentoo.org/860882
+       #
+       # Software is dead since 2016.
+       filter-lto
+
+       # Symbols are decorated with MPC_API but visibility isn't wired up to 
the
+       # build system(s)
+       append-flags -fvisibility=hidden
+
+       cmake_src_configure
+}

Reply via email to