Skip to content

Commit

Permalink
media-sound/audacity: add 3.2.2
Browse files Browse the repository at this point in the history
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
Signed-off-by: Arsen Arsenović <arsen@aarsen.me>
  • Loading branch information
ArsenArsen committed Jan 14, 2023
1 parent 0e1f976 commit 3d3b5f6
Show file tree
Hide file tree
Showing 8 changed files with 516 additions and 2 deletions.
3 changes: 3 additions & 0 deletions media-sound/audacity/Manifest
@@ -1,2 +1,5 @@
DIST Audacity-2.4.2.tar.gz 61248430 BLAKE2B bb7e31e22d2a09c38767b019ed5c2c2be31741594715d73452fc4622d171a6209e87009b6f820873cc1cff2f6b85547a3dea0a2d8d4dd7195617509e571ee9b8 SHA512 0d9cdabf5ba2c7207e8d8e4a8bdfc3e7d32277386436ecb480e3ff781720f5449a56b310ba91c78ca67afb752e2ab736abd5b7ce40d19d153bfc4a2067343a3d
DIST Audacity-3.2.2.tar.gz 56986082 BLAKE2B 9800f5f0d782c4f6a3d10765bc57cde6e8dd9bd47581bed80502120d1ecb098e67092fdeb0873f248acc8448958e907e74877bfa94e2b144f3e8289dcd79d26d SHA512 629d502acc78b02d50a191045a8ececabf7096a77fe63f491291a36cca452c47dec74aef55d0f837345dab2e5f6296d40a2396dea5788a998d619820335abc73
DIST audacity-manual-2.4.2.zip 22459298 BLAKE2B 001ca56f73c3c48f9b49b3b6478c6de6fb4c305fb869b11d93e41d5aee7ee45133bd7047c4d281fed4859d6c6061352dfaeb995e7b2602e42e09ab04e05e00dc SHA512 8afc7faffb0da87efe0c2cb64f8593777357252b4893ae0522ec7b37b4f7806ad9582ca9e4b751d085c2598aba6b580dacd805daa00b236a4ff8f6663a80135c
DIST audacity-manual-3.2.2.tar.gz 22372238 BLAKE2B 890705377bec542210b6d41ce4851a85094b3496054e63c2e5a9d59c025ed8c512c62273721fb7088152504a11cf73b7c314e020f4e81682bee7d468bf9ce15a SHA512 6bf84f50a722cb42f2f8bfeb523697e023121dea0dad63c253194e50c127368466395ec37b6fd58e7154b2b620186b46333c6615937202e376b7e234120ebb18
DIST progschj-ThreadPool-20140926.h 2612 BLAKE2B 54d050ad443512e60e5c99449dd7133f3884c1067288cfc36b96c06855537b83d9b599cd8b8fb7f24e20cbc4898585b11d98d3a33dc7571a886b57c806ad3b14 SHA512 f927489de9afe0217bb0552c45bea238693f9f183a062cb12a48e19576dc50a4d0ba449a12397012ae790cc5ebd741decc08128b66f795310dba4778122e9f3d
221 changes: 221 additions & 0 deletions media-sound/audacity/audacity-3.2.2.ebuild
@@ -0,0 +1,221 @@
# Copyright 1999-2022 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.2-disable-ccache.patch"
# From Debian
"${FILESDIR}/${PN}-3.2.2-fix-rpaths.patch"

# Disables some header-based detection
"${FILESDIR}/${PN}-3.2.2-allow-overriding-alsa-jack.patch"

# For has_networking
"${FILESDIR}/${PN}-3.2.2-remove-conan-threadpool.patch"
"${FILESDIR}/${PN}-3.2.2-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=(
-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
}
@@ -0,0 +1,24 @@
From 0a786020046c9d608f1e2f463575d4ca8febf909 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@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

@@ -0,0 +1,37 @@
From 5d6a6cbc9b2b9f8621fbc441d010e2e7f60c388d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@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.
---
After committing, I realized that PA_HAS_JACK is also completely unused. The
block that enables it was left in, but commented, for future reference.

lib-src/portmixer/CMakeLists.txt | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

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,13 @@ 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()
+ set( PA_HAS_JACK FALSE )
if( PA_HAS_ALSA )
find_package( ALSA REQUIRED QUIET )
endif()
--
2.39.0

33 changes: 33 additions & 0 deletions media-sound/audacity/files/audacity-3.2.2-disable-ccache.patch
@@ -0,0 +1,33 @@
From afd777fbcbaa9e9c14b80374c60ecd631eb537ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@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

0 comments on commit 3d3b5f6

Please sign in to comment.