commit:     75e46d7319ae344ddd180417ff380bcda495d9a8
Author:     Arsen Arsenović <arsen <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 20 21:25:40 2023 +0000
Commit:     Arsen Arsenović <arsen <AT> gentoo <DOT> org>
CommitDate: Fri Jan 20 22:15:48 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75e46d73

media-sound/audacity: add 3.2.3

This update also links against system portaudio.

Keywords dropped to ~amd64 due to media-libs/portsmf.

Closes: https://bugs.gentoo.org/777366
Closes: https://bugs.gentoo.org/822978
Closes: https://github.com/gentoo/gentoo/pull/28715
Signed-off-by: Arsen Arsenović <arsen <AT> gentoo.org>

 media-sound/audacity/Manifest                      |   3 +
 media-sound/audacity/audacity-3.2.3.ebuild         | 223 +++++++++++++++++++++
 ...y-3.2.3-allow-finding-rapidjson-pkgconfig.patch |  24 +++
 ...audacity-3.2.3-allow-overriding-alsa-jack.patch |  48 +++++
 .../files/audacity-3.2.3-disable-ccache.patch      |  33 +++
 .../audacity/files/audacity-3.2.3-fix-rpaths.patch | 144 +++++++++++++
 .../audacity-3.2.3-remove-conan-threadpool.patch   |  58 ++++++
 media-sound/audacity/metadata.xml                  |  10 +-
 8 files changed, 541 insertions(+), 2 deletions(-)

diff --git a/media-sound/audacity/Manifest b/media-sound/audacity/Manifest
index 9c6a1401ae13..d2043bedc60f 100644
--- a/media-sound/audacity/Manifest
+++ b/media-sound/audacity/Manifest
@@ -1,2 +1,5 @@
 DIST Audacity-2.4.2.tar.gz 61248430 BLAKE2B 
bb7e31e22d2a09c38767b019ed5c2c2be31741594715d73452fc4622d171a6209e87009b6f820873cc1cff2f6b85547a3dea0a2d8d4dd7195617509e571ee9b8
 SHA512 
0d9cdabf5ba2c7207e8d8e4a8bdfc3e7d32277386436ecb480e3ff781720f5449a56b310ba91c78ca67afb752e2ab736abd5b7ce40d19d153bfc4a2067343a3d
+DIST Audacity-3.2.3.tar.gz 57017395 BLAKE2B 
3b74c381c9d8e5cbd22e3e53a2e497a45cc48f61b79395b1e17c15e4c645c661ad544cd050885f104562f0f05d08c9e52821f1b9737c32f5f7942d6b8f3102fb
 SHA512 
759eb951ecbc690501c32a7cfc78b3c6f083ed62a4b57cc7935eef7b5dfd930ab4022c54e90de9523a4664ae7749868303fc4e597f19b319f23b07a9776a23cb
 DIST audacity-manual-2.4.2.zip 22459298 BLAKE2B 
001ca56f73c3c48f9b49b3b6478c6de6fb4c305fb869b11d93e41d5aee7ee45133bd7047c4d281fed4859d6c6061352dfaeb995e7b2602e42e09ab04e05e00dc
 SHA512 
8afc7faffb0da87efe0c2cb64f8593777357252b4893ae0522ec7b37b4f7806ad9582ca9e4b751d085c2598aba6b580dacd805daa00b236a4ff8f6663a80135c
+DIST audacity-manual-3.2.3.tar.gz 22264928 BLAKE2B 
7b9441a7d6c2ca05d1be0a2635a7685cff3960f03380c04229a6b2155453a8da861f185adf38f430f2c23214a6fc794533ed7ee23362801fb31eef32977e4a25
 SHA512 
6978ac874f9318fd283098ea5a4b6aa7096acdab229c7bb96c8da33413ed326b1de0c262132e03e4e8127cf0a430a182fb718c9c753556832aea7c527bf5c2cb
+DIST progschj-ThreadPool-20140926.h 2612 BLAKE2B 
54d050ad443512e60e5c99449dd7133f3884c1067288cfc36b96c06855537b83d9b599cd8b8fb7f24e20cbc4898585b11d98d3a33dc7571a886b57c806ad3b14
 SHA512 
f927489de9afe0217bb0552c45bea238693f9f183a062cb12a48e19576dc50a4d0ba449a12397012ae790cc5ebd741decc08128b66f795310dba4778122e9f3d

diff --git a/media-sound/audacity/audacity-3.2.3.ebuild 
b/media-sound/audacity/audacity-3.2.3.ebuild
new file mode 100644
index 000000000000..ad84d68e3e60
--- /dev/null
+++ b/media-sound/audacity/audacity-3.2.3.ebuild
@@ -0,0 +1,223 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+WX_GTK_VER="3.2-gtk3"
+
+inherit cmake wxwidgets xdg
+
+MY_P="Audacity-${PV}"
+DOC_PV="${PV}"
+DESCRIPTION="Free crossplatform audio editor"
+HOMEPAGE="https://web.audacityteam.org/";
+
+# A header-only thread pool library, without a build system, about 100
+# lines of code.  Probably not worth packaging individually.  Check
+# cmake-proxies/CMakeLists.txt and search for "ThreadPool".
+MY_THREADPOOL_DATE=20140926
+MY_THREADPOOL="https://raw.githubusercontent.com/progschj/ThreadPool/9a42ec1329f259a5f4881a291db1dcb8f2ad9040/ThreadPool.h
 -> progschj-ThreadPool-${MY_THREADPOOL_DATE}.h"
+SRC_URI="https://github.com/audacity/audacity/archive/${MY_P}.tar.gz
+       doc? ( 
https://github.com/audacity/audacity-manual/releases/download/v${PV}/audacity-manual-${PV}.tar.gz
 )
+       audiocom? ( ${MY_THREADPOOL} )"
+S="${WORKDIR}/${PN}-${MY_P}"
+
+# GPL-2+, GPL-3 - Audacity itself
+# ZLIB - The ThreadPool single-header library
+# CC-BY-3.0 - Documentation
+LICENSE="GPL-2+
+       GPL-3
+       doc? ( CC-BY-3.0 )
+       audiocom? ( ZLIB )
+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="alsa audiocom doc ffmpeg +flac id3tag +ladspa +lv2 mad mpg123 ogg
+       opus +portmixer sbsms twolame vamp +vorbis wavpack"
+
+# The testsuite consists of two tests, 50% of which fail.
+RESTRICT="test"
+
+# dev-db/sqlite:3 hard dependency.
+# dev-libs/glib:2, x11-libs/gtk+:3 hard dependency, from
+#   cmake-proxies/cmake-modules/dependencies/wxwidgets.cmake
+# sys-apps/util-linux hard dependency, from cmake-proxies/CMakeLists.txt
+#   for libuuid
+# portmidi became non-optional: building without it results in build
+#   failures, even with some of the Debian patches.  It's probably not
+#   in our best interest to fix that as a patch series.
+# glib, gtk and gdk are all directly relied on in the source, not just
+
+# Libraries used at runtime via dlopen:
+# - dev-libs/{serd,sord} - for LV2 support
+# - media-libs/{opus,sratom} :: For Opus and LV2 respectively
+# - media-sound/lame :: For MP3 export
+# - media-video/ffmpeg :: For generic FFMPEG export
+#   This one has the interesting property of many versions being
+#   supported at runtime.  See: libraries/lib-ffmpeg-support/impl
+#   Current support grid:
+#   - Lavf - 5[789]
+#   - Lavc - 5[789]
+#   - Lavu - 5[2567]
+
+RDEPEND="dev-db/sqlite:3
+       dev-libs/expat
+       dev-libs/glib:2
+       media-libs/libsndfile
+       media-libs/libsoundtouch:=
+       media-libs/portaudio[alsa?]
+       media-libs/portmidi
+       media-libs/portsmf:=
+       media-libs/soxr
+       >=media-sound/lame-3.100-r3
+       x11-libs/gdk-pixbuf:2
+       x11-libs/gtk+:3
+       x11-libs/wxGTK:${WX_GTK_VER}[X]
+       sys-apps/util-linux
+       alsa? ( media-libs/alsa-lib )
+       audiocom? (
+               dev-libs/rapidjson
+               net-misc/curl
+       )
+       ffmpeg? ( media-video/ffmpeg )
+       flac? ( media-libs/flac:=[cxx] )
+       id3tag? ( media-libs/libid3tag:= )
+       lv2? (
+               dev-libs/serd
+               dev-libs/sord
+               >=media-libs/lilv-0.24.6-r2
+               media-libs/lv2
+               media-libs/sratom
+               media-libs/suil
+       )
+       mad? ( >=media-libs/libmad-0.15.1b )
+       mpg123? ( media-sound/mpg123 )
+       ogg? ( media-libs/libogg )
+       opus? ( media-libs/opus )
+       sbsms? ( media-libs/libsbsms )
+       twolame? ( media-sound/twolame )
+       vamp? ( media-libs/vamp-plugin-sdk )
+       vorbis? ( media-libs/libvorbis )
+       wavpack? ( media-sound/wavpack )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="app-arch/unzip
+       sys-devel/gettext
+       virtual/pkgconfig
+"
+
+REQUIRED_USE="
+       mad? ( !mpg123 )
+"
+
+PATCHES=(
+       # Equivalent to previous versions
+       "${FILESDIR}/${PN}-3.2.3-disable-ccache.patch"
+       # From Debian
+       "${FILESDIR}/${PN}-3.2.3-fix-rpaths.patch"
+
+       # Disables some header-based detection
+       "${FILESDIR}/${PN}-3.2.3-allow-overriding-alsa-jack.patch"
+
+       # For has_networking
+       "${FILESDIR}/${PN}-3.2.3-remove-conan-threadpool.patch"
+       "${FILESDIR}/${PN}-3.2.3-allow-finding-rapidjson-pkgconfig.patch"
+)
+
+src_prepare() {
+       cmake_src_prepare
+
+       local header_subs="${S}/lib-src/header-substitutes"
+       cat <<-EOF >"${header_subs}/allegro.h" || die
+       /* Hack the allegro.h header substitute to use system headers.  */
+       #include <portsmf/allegro.h>
+       EOF
+
+       # Keep in sync with has_networking and the ThreadPool.h SRC_URI.
+       if use audiocom; then
+               mkdir -p "${S}/"/lib-src/threadpool/ThreadPool/ || die
+               cp "${DISTDIR}"/progschj-ThreadPool-"${MY_THREADPOOL_DATE}".h \
+                  "${S}"/lib-src/threadpool/ThreadPool/ThreadPool.h || die
+       fi
+}
+
+src_configure() {
+       setup-wxwidgets
+
+       # * always use system libraries if possible
+       # * options listed roughly in the order specified in
+       #   cmake-proxies/CMakeLists.txt
+       # * USE_VST was omitted, it appears to no longer have dependencies
+       #   (this is different from VST3)
+       local mycmakeargs=(
+               # Tell the CMake-based build system it's building a release.
+               -DAUDACITY_BUILD_LEVEL=2
+               -Daudacity_use_nyquist=local
+               #-Daudacity_use_pch leaving it to the default behavior
+               -Daudacity_use_portmixer=$(usex portmixer system off)
+               -Daudacity_use_soxr=system
+
+               -Daudacity_conan_enabled=OFF
+
+               -Daudacity_has_networking=$(usex audiocom on off)
+               # Not useful on Gentoo.
+               -Daudacity_has_updates_check=OFF
+               -Daudacity_has_audiocom_upload=$(usex audiocom on off)
+               -Daudacity_has_threadpool=local
+
+               # The VST3 SDK is unpackaged, and it appears to be under a breed
+               # of a proprietary license and the GPL.
+               -Daudacity_has_vst3=OFF
+               -Daudacity_lib_preference=system
+               -Daudacity_obey_system_dependencies=ON
+               -Daudacity_use_expat=system
+               -Daudacity_use_ffmpeg=$(usex ffmpeg loaded off)
+               -Daudacity_use_libid3tag=$(usex id3tag system off)
+               -Daudacity_use_ladspa=$(usex ladspa)
+               -Daudacity_use_lame=system
+               -Daudacity_use_wxwidgets=system
+               -Daudacity_use_libmp3lame=system
+               -Daudacity_use_libmpg123=$(usex mpg123 system off)
+               -Daudacity_use_libmad=$(usex mad system off)
+               -Daudacity_use_wavpack=$(usex wavpack system off)
+               -Daudacity_use_libogg=$(usex ogg system off)
+               -Daudacity_use_libflac=$(usex flac system off)
+               -Daudacity_use_libopus=$(usex flac system off)
+               -Daudacity_use_libvorbis=$(usex vorbis system off)
+               -Daudacity_use_libsndfile=system
+               -Daudacity_use_portaudio=system
+               -Daudacity_use_midi=system
+               -Daudacity_use_vamp=$(usex vamp system off)
+               -Daudacity_use_lv2=$(usex lv2 system off)
+               -Daudacity_use_portsmf=system
+               -Daudacity_use_sbsms=$(usex sbsms system off)
+               -Daudacity_use_soundtouch=system
+               -Daudacity_use_twolame=$(usex twolame system off)
+
+               # Disable telemetry features.
+               -Daudacity_has_sentry_reporting=off
+               -Daudacity_has_crashreports=off
+
+               # See the allow-overriding-alsa-jack.patch patch
+               -DPA_HAS_ALSA=$(usex alsa on off)
+               ## Keep watch of PA_HAS_OSS in lib-src/portmixer/CMakeLists.txt;
+               ## AFAICT it introduces no deps as-is, but that could change.
+               ## Similar goes for PA_HAS_JACK.
+       )
+
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+
+       # Remove bad doc install
+       rm -r "${ED}"/usr/share/doc || die
+
+       if use doc ; then
+               docinto html
+               dodoc -r "${WORKDIR}"/help/manual/{m,man}
+               dodoc 
"${WORKDIR}"/help/manual/{favicon.ico,index.html,quick_help.html}
+               dosym ../../doc/${PF}/html /usr/share/${PN}/help/manual
+       fi
+}

diff --git 
a/media-sound/audacity/files/audacity-3.2.3-allow-finding-rapidjson-pkgconfig.patch
 
b/media-sound/audacity/files/audacity-3.2.3-allow-finding-rapidjson-pkgconfig.patch
new file mode 100644
index 000000000000..d36f51bc2098
--- /dev/null
+++ 
b/media-sound/audacity/files/audacity-3.2.3-allow-finding-rapidjson-pkgconfig.patch
@@ -0,0 +1,24 @@
+From 0a786020046c9d608f1e2f463575d4ca8febf909 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <ar...@aarsen.me>
+Date: Sun, 18 Dec 2022 13:41:06 +0100
+Subject: [PATCH 3/3] Add pkg-config fallback for RapidJSON
+
+---
+ cmake-proxies/CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cmake-proxies/CMakeLists.txt b/cmake-proxies/CMakeLists.txt
+index 7568bb32f..db40dcf63 100644
+--- a/cmake-proxies/CMakeLists.txt
++++ b/cmake-proxies/CMakeLists.txt
+@@ -289,6 +289,7 @@ if( ${_OPT}has_sentry_reporting OR 
${_OPT}has_audiocom_upload )
+       RapidJSON
+       rapidjson/1.1.0
+       REQUIRED
++      PKG_CONFIG "RapidJSON"
+    )
+ endif()
+ 
+-- 
+2.39.0
+

diff --git 
a/media-sound/audacity/files/audacity-3.2.3-allow-overriding-alsa-jack.patch 
b/media-sound/audacity/files/audacity-3.2.3-allow-overriding-alsa-jack.patch
new file mode 100644
index 000000000000..53ac8edc33fb
--- /dev/null
+++ b/media-sound/audacity/files/audacity-3.2.3-allow-overriding-alsa-jack.patch
@@ -0,0 +1,48 @@
+From e46dbcb9763f4367705c66009703f15ff0ff5558 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <ar...@aarsen.me>
+Date: Sat, 17 Dec 2022 21:13:56 +0100
+Subject: [PATCH] portmixer: Allow overriding PA_HAS_{ALSA,JACK}
+
+Not included for OSS as OSS is always included AFAICT.
+---
+ CMakeLists.txt                   | 3 +++
+ lib-src/portmixer/CMakeLists.txt | 9 ++++++---
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 42e765691..c18a939e6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -624,6 +624,9 @@ cmd_option( ${_OPT}use_portmixer "Build PortMixer support 
into Audacity" On)
+ if( ${_OPT}use_portmixer )
+    set(USE_PORTMIXER Yes)
+    add_subdirectory( "lib-src/portmixer" )
++else()
++  # Suppress bogus warnings about unused variables
++  set (unusedIgnore "${PA_HAS_ALSA}${PA_HAS_JACK}${PA_HAS_OSS}")
+ endif()
+ 
+ cmd_option( ${_OPT}use_nyquist "Build Nyquist support into Audacity" On)
+diff --git a/lib-src/portmixer/CMakeLists.txt 
b/lib-src/portmixer/CMakeLists.txt
+index 65a384fa0..1ddc8ed50 100644
+--- a/lib-src/portmixer/CMakeLists.txt
++++ b/lib-src/portmixer/CMakeLists.txt
+@@ -8,9 +8,12 @@ if (UNIX AND NOT APPLE)
+    include(CheckIncludeFile)
+    set(CMAKE_REQUIRED_LIBRARIES PortAudio::PortAudio)
+ 
+-   check_include_file( "pa_jack.h" PA_HAS_JACK )
+-
+-   check_include_file( "pa_linux_alsa.h" PA_HAS_ALSA )
++   if ( NOT DEFINED PA_HAS_JACK )
++     check_include_file( "pa_jack.h" PA_HAS_JACK )
++   endif()
++   if ( NOT DEFINED PA_HAS_ALSA )
++     check_include_file( "pa_linux_alsa.h" PA_HAS_ALSA )
++   endif()
+    if( PA_HAS_ALSA )
+       find_package( ALSA REQUIRED QUIET )
+    endif()
+-- 
+2.39.0
+

diff --git a/media-sound/audacity/files/audacity-3.2.3-disable-ccache.patch 
b/media-sound/audacity/files/audacity-3.2.3-disable-ccache.patch
new file mode 100644
index 000000000000..a40847bb941c
--- /dev/null
+++ b/media-sound/audacity/files/audacity-3.2.3-disable-ccache.patch
@@ -0,0 +1,33 @@
+From afd777fbcbaa9e9c14b80374c60ecd631eb537ea Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <ar...@aarsen.me>
+Date: Fri, 16 Dec 2022 23:37:36 +0100
+Subject: [PATCH] Don't force enable ccache
+
+---
+Analogous to the similar patches in prior versions.
+
+CMakeLists.txt | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9c1c7baf2..42e765691 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -142,14 +142,6 @@ set( CMAKE_PREFIX_PATH
+ set( CMAKE_CXX_STANDARD 17 )
+ set( CMAKE_CXX_STANDARD_REQUIRED ON )
+ 
+-# Use ccache if available
+-find_program( CCACHE_PROGRAM ccache )
+-mark_as_advanced( FORCE CCACHE_PROGRAM )
+-
+-if( CCACHE_PROGRAM )
+-   set_property( GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}" )
+-endif()
+-
+ # Define option() prefix
+ set( _OPT "audacity_" )
+ 
+-- 
+2.39.0
+

diff --git a/media-sound/audacity/files/audacity-3.2.3-fix-rpaths.patch 
b/media-sound/audacity/files/audacity-3.2.3-fix-rpaths.patch
new file mode 100644
index 000000000000..2f1578211c9c
--- /dev/null
+++ b/media-sound/audacity/files/audacity-3.2.3-fix-rpaths.patch
@@ -0,0 +1,144 @@
+From: Benjamin Drung <benjamin.dr...@canonical.com>
+Date: Thu, 22 Sep 2022 19:52:43 +0200
+Subject: Fix rpath for private libraries on Linux
+
+Installing audacity on Linux will produce private libraries that have
+`RUNPATH` set to the build directory instead of the installation
+directory.
+
+The root cause is that the library directory is copied to the
+installation directory without touching the libraries. The cmake wiki
+says in RPATH handling caveats [1]: "Since install-side RPATH tweaking
+is an operation that is done by target-specific installation handling,
+any target that should have its install RPATH changed (e.g. to
+`CMAKE_INSTALL_RPATH`) needs to end up in the installation via an
+`install(TARGETS ...)` signature and not via directory-based copying."
+
+So replace `install(DIRECTORY ...)` by individual `install(TARGETS ...)`
+for the libraries and modules. Then cmake will replace the `RUNPATH` to
+`$ORIGIN/../lib/audacity`, which is still incorrect. Therefore set
+`INSTALL_RPATH` explicitly.
+
+Fixes: https://github.com/audacity/audacity/issues/3289
+Forwarded: https://github.com/audacity/audacity/pull/3671
+[1] 
https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling#caveats
+Signed-off-by: Benjamin Drung <benjamin.dr...@canonical.com>
+---
+ CMakeLists.txt                                      |  1 +
+ cmake-proxies/cmake-modules/AudacityFunctions.cmake | 19 +++++++++++++++++++
+ modules/CMakeLists.txt                              |  7 -------
+ modules/mod-script-pipe/CMakeLists.txt              |  1 +
+ src/CMakeLists.txt                                  | 10 ----------
+ 5 files changed, 21 insertions(+), 17 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8428c8c..b9ff631 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -389,6 +389,7 @@ set( INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" )
+ set( _LIBDIR "${CMAKE_INSTALL_LIBDIR}" )
+ set( _DATADIR "${CMAKE_INSTALL_DATADIR}" )
+ set( _PKGLIB "${_LIBDIR}/audacity" )
++set( _PKGMODULE "${_PKGLIB}/modules" )
+ set( _PKGDATA "${_DATADIR}/audacity/" )
+ set( _MANDIR "${CMAKE_INSTALL_MANDIR}" )
+ set( _MODDIR "${_DEST}/modules" )
+diff --git a/cmake-proxies/cmake-modules/AudacityFunctions.cmake 
b/cmake-proxies/cmake-modules/AudacityFunctions.cmake
+index 47682eb..a8f144f 100644
+--- a/cmake-proxies/cmake-modules/AudacityFunctions.cmake
++++ b/cmake-proxies/cmake-modules/AudacityFunctions.cmake
+@@ -338,6 +338,17 @@ function( canonicalize_node_name var node )
+    set( "${var}" "${node}" PARENT_SCOPE )
+ endfunction()
+ 
++# Call install(TARGETS...) only on Linux systems (i.e. exclude MacOS and 
Windows)
++macro( install_target_linux target destination )
++   if( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" AND NOT 
CMAKE_SYSTEM_NAME MATCHES "Darwin" )
++      install( TARGETS "${target}" DESTINATION "${destination}" )
++   endif()
++endmacro()
++
++macro( install_audacity_module target )
++   install_target_linux( "${target}" "${_PKGMODULE}" )
++endmacro()
++
+ function( audacity_module_fn NAME SOURCES IMPORT_TARGETS
+    ADDITIONAL_DEFINES ADDITIONAL_LIBRARIES LIBTYPE )
+ 
+@@ -382,6 +393,7 @@ function( audacity_module_fn NAME SOURCES IMPORT_TARGETS
+          PROPERTIES
+             PREFIX ""
+             FOLDER "modules" # for IDE organization
++            INSTALL_RPATH "$ORIGIN/.."
+       )
+       if( CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin" )
+          add_custom_command(
+@@ -423,6 +435,7 @@ function( audacity_module_fn NAME SOURCES IMPORT_TARGETS
+             PREFIX ""
+             FOLDER "libraries" # for IDE organization
+             INSTALL_NAME_DIR ""
++            INSTALL_RPATH "$ORIGIN"
+             BUILD_WITH_INSTALL_NAME_DIR YES
+       )
+    endif()
+@@ -525,6 +538,12 @@ function( audacity_module_fn NAME SOURCES IMPORT_TARGETS
+    endforeach()
+    set( GRAPH_EDGES "${GRAPH_EDGES}" PARENT_SCOPE )
+ 
++   # Note: Some modules set EXCLUDE_FROM_ALL afterwards to not be installed.
++   # Therefore only install libraries, but not modules here.
++   if( NOT REAL_LIBTYPE STREQUAL "MODULE" )
++      install_target_linux( "${TARGET}" "${_PKGLIB}" )
++   endif()
++
+    # collect unit test targets if they are present
+    if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
+       add_subdirectory(tests)
+diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
+index d464383..15dead4 100644
+--- a/modules/CMakeLists.txt
++++ b/modules/CMakeLists.txt
+@@ -16,12 +16,5 @@ foreach( MODULE ${MODULES} )
+    add_subdirectory("${MODULE}")
+ endforeach()
+ 
+-if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
+-   if( NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio*")
+-      install( DIRECTORY "${_DEST}/modules"
+-               DESTINATION "${_PKGLIB}" )
+-   endif()
+-endif()
+-
+ #propagate collected edges up to root CMakeLists.txt
+ set( GRAPH_EDGES "${GRAPH_EDGES}" PARENT_SCOPE )
+diff --git a/modules/mod-script-pipe/CMakeLists.txt 
b/modules/mod-script-pipe/CMakeLists.txt
+index 5ee1862..ccfd50f 100644
+--- a/modules/mod-script-pipe/CMakeLists.txt
++++ b/modules/mod-script-pipe/CMakeLists.txt
+@@ -15,3 +15,4 @@ set( DEFINES
+ )
+ audacity_module( mod-script-pipe "${SOURCES}" "Audacity"
+    "${DEFINES}" "" )
++install_audacity_module( mod-script-pipe )
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 7b90c1b..c5f30ad 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -1621,17 +1621,7 @@ else()
+                DESTINATION "."
+                RESOURCE DESTINATION "${_APPDIR}/Resources" )
+    else()
+-
+       install( TARGETS ${TARGET} RUNTIME )
+-
+-      install( DIRECTORY "${_DEST}/${_LIBDIR}/"
+-               DESTINATION "${_LIBDIR}"
+-               USE_SOURCE_PERMISSIONS
+-               FILES_MATCHING PATTERN "*.so*" )
+-
+-      install( CODE "set( _LIBDIR \"${_LIBDIR}\")" )
+-      install( SCRIPT 
"${CMAKE_SOURCE_DIR}/scripts/build/linux/fix_rpath.cmake" )
+-
+       install( FILES "${_INTDIR}/audacity.desktop"
+                DESTINATION "${_DATADIR}/applications" )
+       install( FILES "${topdir}/LICENSE.txt" "${topdir}/README.txt"

diff --git 
a/media-sound/audacity/files/audacity-3.2.3-remove-conan-threadpool.patch 
b/media-sound/audacity/files/audacity-3.2.3-remove-conan-threadpool.patch
new file mode 100644
index 000000000000..1940ec8a6d9f
--- /dev/null
+++ b/media-sound/audacity/files/audacity-3.2.3-remove-conan-threadpool.patch
@@ -0,0 +1,58 @@
+From 7b5f56ec441fb472b61bae14e1efa353db4d7aca Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <ar...@aarsen.me>
+Date: Sun, 18 Dec 2022 13:37:35 +0100
+Subject: [PATCH] Allow using local dependency for threadpool
+
+We pull it in manually.
+---
+ cmake-proxies/CMakeLists.txt | 27 +++++++++++++++++++--------
+ 1 file changed, 19 insertions(+), 8 deletions(-)
+
+diff --git a/cmake-proxies/CMakeLists.txt b/cmake-proxies/CMakeLists.txt
+index 81bbf2efd..474814f07 100644
+--- a/cmake-proxies/CMakeLists.txt
++++ b/cmake-proxies/CMakeLists.txt
+@@ -258,12 +258,22 @@ if( ${_OPT}has_networking )
+       set ( curl_ssl "openssl" )
+    endif ()
+ 
+-   add_conan_lib(
+-      ThreadPool
+-      threadpool/20140926
+-      REQUIRED
+-      ALWAYS_ALLOW_CONAN_FALLBACK
+-   )
++   if ( ${_OPT}has_threadpool STREQUAL "local" )
++     # Gentoo: Hack in Portage-downloaded ThreadPool.h.
++     # This follows somewhat-like-upstream conventions, except it doesn't use
++     # the proxy library mechanism because there's no library.
++     add_library ( ThreadPool::ThreadPool INTERFACE IMPORTED GLOBAL )
++     target_include_directories ( ThreadPool::ThreadPool INTERFACE
++       ${CMAKE_SOURCE_DIR}/lib-src/threadpool
++     )
++   else()
++     add_conan_lib(
++       ThreadPool
++       threadpool/20140926
++       REQUIRED
++       ALWAYS_ALLOW_CONAN_FALLBACK
++     )
++   endif()
+ 
+    add_conan_lib(
+       CURL
+@@ -276,8 +286,9 @@ if( ${_OPT}has_networking )
+       CONAN_OPTIONS
+          libcurl:with_ssl=${curl_ssl}
+          libcurl:shared=True
+-   )
+-
++       )
++else()
++   set(unused "${${_OPT}has_threadpool}")
+ endif()
+ 
+ if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
+-- 
+2.39.0
+

diff --git a/media-sound/audacity/metadata.xml 
b/media-sound/audacity/metadata.xml
index d65acf902382..b55217fe7ef8 100644
--- a/media-sound/audacity/metadata.xml
+++ b/media-sound/audacity/metadata.xml
@@ -10,14 +10,20 @@
     <name>Richard Ash</name>
     <description>Upstream - please CC on bugs that concerns 
upstream</description>
   </maintainer>
+  <upstream>
+    <remote-id type="github">audacity/audacity</remote-id>
+  </upstream>
   <use>
+    <flag name="audiocom">Enable integrated uploading to audio.com</flag>
     <flag name="id3tag">Enables ID3 tagging with id3tag library</flag>
     <flag name="lv2">Add support for Ladspa V2</flag>
+    <flag name="mpg123">Use <pkg>media-sound/mpg123</pkg> instead of
+      <pkg>media-libs/libmad</pkg> for decoding MPEG decoding</flag>
     <flag name="portmidi">Enable support for MIDI via 
<pkg>media-libs/portmidi</pkg></flag>
     <flag name="portmixer">Enable the internal portmixer feature</flag>
     <flag name="portsmf">Enable support for Portable Standard Midi File 
Library</flag>
-    <flag name="sbsms">Enables sbsms library support for slower, more accurate
-      pitch and tempo changing</flag>
+    <flag name="sbsms">Enables sbsms library support for slower, more
+      accurate pitch and tempo changing</flag>
     <flag name="twolame">Enables twolame support (MPEG Audio Layer 2 
encoder)</flag>
     <flag name="vamp">Enables vamp plugins support (Audio analysing 
plugins)</flag>
     <flag name="vst">Enable VST plugin support</flag>

Reply via email to