commit:     66569f7eb229d4156c6607c883115e6241d7267e
Author:     Bryce Copeland <truffle074 <AT> gmail <DOT> com>
AuthorDate: Sun Aug 31 15:09:17 2025 +0000
Commit:     David Roman <davidroman96 <AT> gmail <DOT> com>
CommitDate: Sun Aug 31 15:52:38 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=66569f7e

media-sound/tenacity: add 1.3.4-r2

Closes: https://bugs.gentoo.org/961756
Signed-off-by: Bryce Copeland <truffle074 <AT> gmail.com>

 ...nacity-1.3.4-ffmpeg-odr-violation-masking.patch |  24 ++++
 .../tenacity-1.3.4-odr-and-aliasing-fixes.patch    | 134 +++++++++++++++++++++
 media-sound/tenacity/tenacity-1.3.4-r2.ebuild      | 130 ++++++++++++++++++++
 3 files changed, 288 insertions(+)

diff --git 
a/media-sound/tenacity/files/tenacity-1.3.4-ffmpeg-odr-violation-masking.patch 
b/media-sound/tenacity/files/tenacity-1.3.4-ffmpeg-odr-violation-masking.patch
new file mode 100644
index 0000000000..50aba1015d
--- /dev/null
+++ 
b/media-sound/tenacity/files/tenacity-1.3.4-ffmpeg-odr-violation-masking.patch
@@ -0,0 +1,24 @@
+masks the ODR violations in the lib-ffmpeg-support module, by forcing 
-Wno-error=odr
+this is a *temporary solution only*, while waiting on the upstream fix 
currently
+being worked on: https://codeberg.org/tenacityteam/tenacity/pulls/418
+
+an ideal solution would fix the violations or introduce namespaces, however
+this is not feasible for a patch as the offending files are multiple 5000+ line
+headers that declare *all* ffmpeg functions across multiple versions. it's a
+truly enormous number of ODR violations, but it shouldn't cause actual runtime
+issues, only compiler complaints. once ffmpeg-linking is functional that should
+the preferred solution.
+
+diff --git a/libraries/lib-ffmpeg-support/CMakeLists.txt 
b/libraries/lib-ffmpeg-support/CMakeLists.txt
+index 7e76ab997..b2eb6ab6e 100644
+--- a/libraries/lib-ffmpeg-support/CMakeLists.txt
++++ b/libraries/lib-ffmpeg-support/CMakeLists.txt
+@@ -117,6 +117,8 @@ if (USE_FFMPEG)
+       list(APPEND DEFINITIONS PRIVATE _DARWIN_C_SOURCE )
+    endif()
+ 
++   add_compile_options(-Wno-error=odr)
++   add_link_options(-Wno-error=odr)
+    tenacity_library( lib-ffmpeg-support "${SOURCES}" "${LIBRARIES}"
+       "${DEFINITIONS}" ""
+    )

diff --git 
a/media-sound/tenacity/files/tenacity-1.3.4-odr-and-aliasing-fixes.patch 
b/media-sound/tenacity/files/tenacity-1.3.4-odr-and-aliasing-fixes.patch
new file mode 100644
index 0000000000..e9afbabe98
--- /dev/null
+++ b/media-sound/tenacity/files/tenacity-1.3.4-odr-and-aliasing-fixes.patch
@@ -0,0 +1,134 @@
+few simple fixes to work around strict-aliasing and one-definition-rules issues
+that cause problems with LTO compilation.
+
+most issues are actual problems withoverlapping file-local variable names which
+leak into other contexts. most are easily fixed with couple of anonymous
+namespaces to satisfy the compiler (none cause issues in practice, but generate
+errors when standard Gentoo LTO flags are used)
+
+NOTE: these fixes don't cover lib-ffmpeg-support module, which generate an
+enormous number of ODR violations
+
+diff --git a/src/prefs/SpectrumPrefs.cpp b/src/prefs/SpectrumPrefs.cpp
+index e9034ff83..b775475ab 100644
+--- a/src/prefs/SpectrumPrefs.cpp
++++ b/src/prefs/SpectrumPrefs.cpp
+@@ -228,9 +228,11 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S)
+                8);
+ 
+             // i18n-hint Scheme refers to a color scheme for spectrogram 
colors
++            int _selection = static_cast<int>(mTempSettings.colorScheme);
+             S.Id(ID_COLOR_SCHEME).TieChoice(XC("Sche&me", "spectrum prefs"),
+-               (int&)mTempSettings.colorScheme,
++               _selection,
+                Msgids( SpectrogramSettings::GetColorSchemeNames() ) );
++            mTempSettings.colorScheme = 
static_cast<SpectrogramSettings::ColorScheme>(_selection);
+          }
+          S.EndMultiColumn();
+       }
+diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp
+index 0cdf94500..3496658d0 100644
+--- a/src/effects/Equalization.cpp
++++ b/src/effects/Equalization.cpp
+@@ -148,13 +148,15 @@ enum
+    ID_Slider,   // needs to come last
+ };
+ 
+-enum kInterpolations
+-{
+-   kBspline,
+-   kCosine,
+-   kCubic,
+-   nInterpolations
+-};
++namespace {
++    enum kInterpolations
++    {
++       kBspline,
++       kCosine,
++       kCubic,
++       nInterpolations
++    };
++}
+ 
+ // Increment whenever EQCurves.xml is updated
+ #define EQCURVES_VERSION   1
+diff --git a/src/effects/Noise.cpp b/src/effects/Noise.cpp
+index e075b79ae..aa72bf792 100644
+--- a/src/effects/Noise.cpp
++++ b/src/effects/Noise.cpp
+@@ -32,13 +32,15 @@
+ #include "../widgets/valnum.h"
+ #include "../widgets/NumericTextCtrl.h"
+ 
+-enum kTypes
+-{
+-   kWhite,
+-   kPink,
+-   kBrownian,
+-   nTypes
+-};
++namespace {
++      enum kTypes
++      {
++         kWhite,
++         kPink,
++         kBrownian,
++         nTypes
++      };
++}
+ 
+ static const EnumValueSymbol kTypeStrings[nTypes] =
+ {
+diff --git a/src/effects/ScienFilter.cpp b/src/effects/ScienFilter.cpp
+index 2c3b9b786..6ce5ecf2e 100644
+--- a/src/effects/ScienFilter.cpp
++++ b/src/effects/ScienFilter.cpp
+@@ -88,13 +88,15 @@ enum
+    ID_StopbandRipple
+ };
+ 
+-enum kTypes
+-{
+-   kButterworth,
+-   kChebyshevTypeI,
+-   kChebyshevTypeII,
+-   nTypes
+-};
++namespace {
++    enum kTypes
++    {
++       kButterworth,
++       kChebyshevTypeI,
++       kChebyshevTypeII,
++       nTypes
++    };
++}
+ 
+ static const EnumValueSymbol kTypeStrings[nTypes] =
+ {
+diff --git a/src/effects/ToneGen.cpp b/src/effects/ToneGen.cpp
+index 8225421b9..3ff5081ae 100644
+--- a/src/effects/ToneGen.cpp
++++ b/src/effects/ToneGen.cpp
+@@ -38,12 +38,14 @@ frequency changes smoothly during the tone.
+ #include "../widgets/valnum.h"
+ #include "../widgets/NumericTextCtrl.h"
+ 
+-enum kInterpolations
+-{
+-   kLinear,
+-   kLogarithmic,
+-   nInterpolations
+-};
++namespace {
++      enum kInterpolations
++      {
++         kLinear,
++         kLogarithmic,
++         nInterpolations
++      };
++}
+ 
+ static const EnumValueSymbol kInterStrings[nInterpolations] =
+ {

diff --git a/media-sound/tenacity/tenacity-1.3.4-r2.ebuild 
b/media-sound/tenacity/tenacity-1.3.4-r2.ebuild
new file mode 100644
index 0000000000..6c93f3762e
--- /dev/null
+++ b/media-sound/tenacity/tenacity-1.3.4-r2.ebuild
@@ -0,0 +1,130 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+WX_GTK_VER="3.2-gtk3"
+
+inherit cmake wxwidgets xdg virtualx
+
+# libnyquist doesn't have tags, instead use the specific submodule commit 
tenacity does
+LIBNYQUIST_COMMIT="d4fe08b079538a2fd79277ef1a83434663562f04"
+
+DESCRIPTION="Easy-to-use, privacy-friendly, FLOSS, cross-platform multi-track 
audio editor"
+HOMEPAGE="https://tenacityaudio.org/";
+SRC_URI="https://codeberg.org/tenacityteam/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz
+       
https://codeberg.org/tenacityteam/libnyquist/archive/${LIBNYQUIST_COMMIT}.tar.gz
 -> ${PN}-libnyquist-${PV}.tar.gz"
+
+# codeberg doesn't append tag
+S="${WORKDIR}/${PN}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="ffmpeg +midi +lame +id3tag +mp3 mp2 +flac matroska +ogg +vorbis +sbsms 
+soundtouch +ladspa +lv2 vamp +vst2"
+REQUIRED_USE="
+       id3tag? ( mp3 )
+       lame? ( mp3 )
+"
+
+DEPEND="
+       sys-libs/zlib
+       dev-libs/expat
+       media-sound/lame
+       media-libs/libsndfile
+       media-libs/soxr
+       dev-db/sqlite:3
+       media-libs/portaudio
+       dev-libs/glib:2
+       x11-libs/gtk+:3
+       x11-libs/wxGTK:${WX_GTK_VER}=[X]
+
+       midi? (
+               media-libs/portmidi
+               media-libs/portsmf
+       )
+       id3tag? ( media-libs/libid3tag )
+       mp3? ( media-libs/libmad )
+       mp2? ( media-sound/twolame )
+       matroska? ( media-libs/libmatroska )
+       ogg? ( media-libs/libogg )
+       vorbis? ( media-libs/libvorbis )
+       flac? ( media-libs/flac )
+       sbsms? ( media-libs/libsbsms )
+       soundtouch? ( media-libs/libsoundtouch )
+       ffmpeg? ( media-video/ffmpeg )
+       vamp? ( media-libs/vamp-plugin-sdk )
+       lv2? (
+               media-libs/lv2
+               media-libs/lilv
+               media-libs/suil
+       )
+
+       sys-devel/gettext
+       dev-libs/serd
+       dev-libs/sord
+       media-libs/sratom
+       media-libs/taglib
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-1.3.4-fix-rpath-handling.patch"
+       "${FILESDIR}/${PN}-1.3.4-fix-hardcoded-docdir.patch"
+       "${FILESDIR}/${PN}-1.3.4-ffmpeg-odr-violation-masking.patch"
+       "${FILESDIR}/${PN}-1.3.4-odr-and-aliasing-fixes.patch"
+)
+
+src_unpack() {
+       default
+
+       # otherwise build will try to run git --submodule --init
+       rmdir "${S}/lib-src/libnyquist" || die
+       ln -s "${WORKDIR}/libnyquist" "${S}/lib-src/libnyquist"
+}
+
+src_configure() {
+       setup-wxwidgets
+
+       local mycmakeargs=(
+               -DVCPKG=OFF
+               -DPERFORM_CODESIGN=OFF
+
+               # portage handles this, specify off to stop autodetect
+               -DSCCACHE=OFF
+               -DCCACHE=OFF
+
+               # Pre-Compiled Headers needs to stay off, even with ccache 
installed
+               # otherwise a bunch of preprocessor variables will be missing
+               -DPCH=OFF
+
+               -DMIDI=$(usex midi ON OFF)
+               -DID3TAG=$(usex id3tag ON OFF)
+               -DMP3_DECODING=$(usex mp3 ON OFF)
+               -DMP2=$(usex mp2 ON OFF)
+               -DMATROSKA=$(usex matroska ON OFF)
+               -DOGG=$(usex ogg ON OFF)
+               -DVORBIS=$(usex vorbis ON OFF)
+               -DFLAC=$(usex flac ON OFF)
+               -DSBSMS=$(usex sbsms ON OFF)
+               -DSOUNDTOUCH=$(usex soundtouch ON OFF)
+               -DFFMPEG=$(usex ffmpeg ON OFF)
+               -DLADSPA=$(usex ladspa ON OFF)
+               #-DAUDIO_UNITS=OFF  # option only exists on MacOS
+               -DLV2=$(usex lv2 ON OFF)
+               -DVAMP=$(usex vamp ON OFF)
+               -DVST2=$(usex vst2 ON OFF)
+
+               # this flag is misleading, when not "" the flag only has an 
effect
+               # when CMAKE_GENERATOR is "Visual Studio*" or "XCode" (i.e. not 
us)
+               # man pages will be installed regardless on linux
+               -DMANUAL_PATH=""
+       )
+
+       cmake_src_configure
+}
+
+src_test() {
+       virtx cmake_src_test
+}

Reply via email to