1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-15 08:07:41 +02:00

Merge pull request #1388 from crsib/linux_packages

Linux packages
This commit is contained in:
Dmitry Vedenko 2021-08-03 12:13:00 +03:00 committed by GitHub
commit 9df3c4b398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 881 additions and 299 deletions

1
.gitignore vendored
View File

@ -208,3 +208,4 @@ win/xaudacity.ico
*.dll
.idea/
.vscode/

View File

@ -191,4 +191,17 @@ To find system packages, we rely on `pkg-config`. There are several packages tha
### Disabling Conan
Conan can be disabled completely using `-Daudacity_conan_enabled=Off` during the configuration.
This option implies `-Daudacity_obey_system_dependencies=On` and disables `local` for packages that are managed with Conan.
This option implies `-Daudacity_obey_system_dependencies=On` and disables `local` for packages that are managed with Conan.
### Disabling pre-built binaries downloads for Conan
It is possible to force Conan to build all the dependencies from the source code without using the pre-built binaries. To do so, please pass `-Daudaicity_conan_allow_prebuilt_binaries=Off` to CMake during the configration. This option will trigger rebuild every
time CMake configuration changes.
### Reducing Conan cache size
In order to reduce the space used by Conan cache, please run:
```
$ conan remove "*" --src --builds --force
```

View File

@ -94,7 +94,7 @@ add_conan_lib(
libid3tag
libid3tag/0.15.2b@audacity/stable
OPTION_NAME libid3tag
PKG_CONFIG "id3tag >= 0.15.1b"
PKG_CONFIG "id3tag >= 0.15.0b" # Ubuntu has broken PC file
CONAN_OPTIONS
libid3tag:zlib=${id3tag_zlib}
)
@ -103,7 +103,7 @@ add_conan_lib(
libmad
libmad/0.15.2b@audacity/stable
OPTION_NAME libmad
PKG_CONFIG "mad >= 0.15.1b"
PKG_CONFIG "mad >= 0.15.0b" # Ubuntu has broken PC file
)
if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
@ -164,7 +164,7 @@ set_conan_vars_to_parent()
# directory option symbol req chk version
addlib( libsndfile sndfile SNDFILE YES YES "sndfile >= 1.0.28" )
addlib( portaudio-v19 portaudio PORTAUDIO YES YES "" )
addlib( sqlite sqlite SQLITE YES YES "sqlite3 >= 3.32.0" )
addlib( sqlite sqlite SQLITE YES YES "sqlite3 >= 3.31.1" )
# Optional libraries
#
@ -177,7 +177,8 @@ addlib( libvorbis vorbis LIBVORBIS NO YES "vorbis >= 1.3.3"
addlib( libflac flac LIBFLAC NO YES "flac >= 1.3.1" "flac++ >= 1.3.1" )
addlib( lv2 lv2 LV2 NO YES "lilv-0 >= 0.24.6" "lv2 >= 1.16.0" "serd-0 >= 0.30.2" "sord-0 >= 0.16.4" "sratom-0 >= 0.6.4" "suil-0 >= 0.10.6" )
addlib( portmidi midi MIDI NO YES "portmidi >= 0.1" )
addlib( portmidi midi MIDI NO YES "PortMidi" )
if (NOT USE_MIDI AND
"EXPERIMENTAL_MIDI_OUT" IN_LIST EXPERIMENTAL_OPTIONS_LIST )
message(FATAL_ERROR "EXPERIMENTAL_MIDI_OUT requires USE_MIDI")

View File

@ -9,6 +9,12 @@ if( ${_OPT}conan_enabled )
)
endif()
if ( ${_OPT}conan_allow_prebuilt_binaries )
set ( CONAN_BUILD_MODE BUILD missing )
else()
set( CONAN_BUILD_MODE BUILD all )
endif()
set( CONAN_BUILD_REQUIRES )
set( CONAN_REQUIRES )
set( CONAN_PACKAGE_OPTIONS )
@ -253,7 +259,7 @@ function ( _conan_install build_type )
conan_cmake_install(PATH_OR_REFERENCE .
BUILD missing
${CONAN_BUILD_MODE}
SETTINGS ${settings}
)
endfunction()

View File

@ -655,11 +655,21 @@ function( addlib dir name symbol required check )
# And add it to our target
target_include_directories( ${TARGET} INTERFACE ${INCLUDES} )
target_link_libraries( ${TARGET} INTERFACE ${LIBRARIES} )
elseif( ${_OPT}obey_system_dependencies )
message( FATAL_ERROR "Failed to find the system package ${name}" )
else()
set( ${use} "local" )
set_property( CACHE ${use} PROPERTY VALUE "local" )
find_package( ${packages} QUIET )
if( TARGET ${TARGET} )
set( PKG_${TARGET}_FOUND Yes )
endif()
endif()
if( NOT PKG_${TARGET}_FOUND )
if( ${_OPT}obey_system_dependencies )
message( FATAL_ERROR "Failed to find the system package ${name}" )
else()
set( ${use} "local" )
set_property( CACHE ${use} PROPERTY VALUE "local" )
endif()
endif()
endif()

View File

@ -0,0 +1,31 @@
#[[
A module to look for PortMidi
]]
if( NOT PortMidi_FOUND )
find_path( PortMidi_INCLUDE_DIR portmidi.h )
find_library( PortMidi_LIBRARIES NAMES portmidi )
if( PortMidi_INCLUDE_DIR AND PortMidi_LIBRARIES )
set( PortMidi_FOUND Yes )
endif()
if( PortMidi_FOUND )
if( NOT PortMidi_FIND_QUIETLY )
message( STATUS "Found PortMidi: \n\tPortMidi_INCLUDE_DIR: ${PortMidi_INCLUDE_DIR}\n\tPortMidi_LIBRARIES: ${PortMidi_LIBRARIES}" )
endif()
if( NOT TARGET PortMidi::PortMidi )
add_library( PortMidi::PortMidi INTERFACE IMPORTED GLOBAL)
target_include_directories( PortMidi::PortMidi INTERFACE ${PortMidi_INCLUDE_DIR} )
target_link_libraries( PortMidi::PortMidi INTERFACE ${PortMidi_LIBRARIES} )
add_library(portmidi ALIAS PortMidi::PortMidi)
endif()
else()
if( PortMidi_FIND_REQUIRED )
message( FATAL_ERROR "Could not find PortMidi")
endif()
endif()
endif()

View File

@ -1,24 +0,0 @@
FROM fedora:latest
LABEL maintainer="d.vedenko@audacityteam.org"
LABEL description="A build environment to check the builds for Fedora package maintainers"
LABEL version="3.0"
RUN dnf install -y dos2unix wget
RUN dnf install -y fedora-packager @development-tools
COPY ["audacity.spec", "/root/rpmbuild/SPEC/audacity.spec"]
RUN dos2unix /root/rpmbuild/SPEC/audacity.spec
COPY ["audacity.cfg", "/etc/mock/audacity.cfg"]
RUN dos2unix /etc/mock/audacity.cfg
RUN wget -P /root/rpmbuild/SOURCES/ https://github.com/audacity/audacity/releases/download/Audacity-3.0.2/audacity-manual-3.0.2.zip
COPY ["entrypoint.sh", "/entrypoint.sh"]
RUN dos2unix /entrypoint.sh
CMD ["bash", "-ex", "/entrypoint.sh"]

View File

@ -1,6 +0,0 @@
config_opts['releasever'] = '34'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
config_opts['use_host_resolv'] = False
include('templates/fedora-branched.tpl')

View File

@ -1,245 +0,0 @@
# Spec file is based on https://src.fedoraproject.org/fork/imcinerney/rpms/audacity/tree/im/depupdate
# Compile options:
# invoke with: rpmbuild --with ffmpeg --with local_ffmpeg audacity.spec to use local ffmpeg
%bcond_with ffmpeg
%bcond_with local_ffmpeg
#global commit0 53a5c930a4b5b053ab06a8b975458fc51cf41f6c
#global shortcommit0 #(c=#{commit0}; echo ${c:0:7})
Name: audacity
Version: 3.0.3
Release: 0%{?dist}
Summary: Multitrack audio editor
License: GPLv2
URL: https://www.audacityteam.org/
#Source0: http://www.fosshub.com/Audacity.html/%{name}-minsrc-%{version}.tar.xz
# For alpha git snapshots for testing use the github archive as upstream source:
#Source0: https://github.com/audacity/#{name}/archive/#{commit0}/#{name}-#{commit0}.tar.gz
# ie wget https://github.com/audacity/audacity/archive/ecdb1d81c9312789c6233aba2190572344b22188/audacity-ecdb1d81c9312789c6233aba2190572344b22188.tar.gz
# Fake URL for Docker environment
Source0: %{name}.tar.gz
#define tartopdir audacity-minsrc-%{version}
#define tartopdir audacity-#{commit0}
%define tartopdir audacity
Source1: http://www.fosshub.com/Audacity.html/%{name}-manual-3.0.2.zip
BuildRequires: cmake
BuildRequires: gettext-devel
%if 0%{?rhel} == 7
BuildRequires: devtoolset-7-toolchain, devtoolset-7-libatomic-devel
%endif
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libjpeg-turbo-devel
BuildRequires: alsa-lib-devel
BuildRequires: desktop-file-utils
BuildRequires: expat-devel
BuildRequires: flac-devel
BuildRequires: git
BuildRequires: jack-audio-connection-kit-devel
BuildRequires: ladspa-devel
BuildRequires: lame-devel
BuildRequires: libid3tag-devel
BuildRequires: libmad-devel
BuildRequires: taglib-devel
%if 0%{?rhel} && 0%{?rhel} == 8
#note: epel-8 currently doesn't have twolame-devel.
%else
BuildRequires: twolame-devel
%endif
BuildRequires: libogg-devel
BuildRequires: libsndfile-devel
BuildRequires: libvorbis-devel
BuildRequires: portaudio-devel >= 19-16
BuildRequires: portmidi-devel
BuildRequires: soundtouch-devel
BuildRequires: soxr-devel
BuildRequires: vamp-plugin-sdk-devel >= 2.0
BuildRequires: zip
BuildRequires: zlib-devel
BuildRequires: python3
BuildRequires: libuuid-devel
# We need /usr/bin/wx-config so that configure can detect the wx-config version:
#if 0#{?rhel} || 0#{?fedora} < 28
#BuildRequires: wxGTK3-devel
#endif
# But we will actually use the --toolkit=gtk2 version using --with-wx-version
#BuildRequires: compat-wxGTK3-gtk2-devel
BuildRequires: wxGTK-devel
BuildRequires: gtk3-devel
BuildRequires: glib2-devel
%if 0%{?rhel} >= 8 || 0%{?fedora}
BuildRequires: libappstream-glib
%endif
%if %{with ffmpeg}
%if ! %{with local_ffmpeg}
BuildRequires: ffmpeg-devel
%endif
%endif
# Note, we also need sqlite compiled with the SQLITE_DBPAGE table enabled, which
# the system version seems to be. (https://github.com/flathub/org.audacityteam.Audacity/issues/62)
BuildRequires: sqlite-devel >= 3.32
# LV2 interface and the plugins used
BuildRequires: lv2-devel >= 1.16
BuildRequires: lilv-devel >= 0.24.6
BuildRequires: serd-devel >= 0.30.2
BuildRequires: sord-devel >= 0.16.4
BuildRequires: sratom-devel >= 0.6.4
BuildRequires: suil-devel >= 0.10.6
# For new symbols in portaudio
Requires: portaudio%{?_isa} >= 19-16
ExcludeArch: s390x
%description
Audacity is a cross-platform multitrack audio editor. It allows you to
record sounds directly or to import files in various formats. It features
a few simple effects, all of the editing features you should need, and
unlimited undo. The GUI was built with wxWidgets and the audio I/O
supports PulseAudio, OSS and ALSA under Linux.
%package manual
Summary: Manual for Audacity - Offline Install
BuildArch: noarch
# -manual suits either audacity or audacity-freeworld; both create the path:
Requires: /usr/bin/audacity
%description manual
Audacity Manual can be installed locally if preferred, or accessed on-line
if internet connection is available.
For the most up to date manual content, use the on-line manual.
%prep
%setup -q -n %{tartopdir}
%build
%if 0%{?rhel} == 7
export WX_CONFIG=wx-config-3.0
%endif
%if 0%{?rhel} == 7
. /opt/rh/devtoolset-7/enable
%endif
%if (0%{?fedora} && 0%{?fedora} < 33)
mkdir build
cd build
%cmake \
.. \
%else
%cmake \
%endif
-DCMAKE_BUILD_TYPE=Release \
-Daudacity_conan_enabled=Off \
-Daudacity_lib_preference=system \
-Daudacity_use_sqlite=system \
-Daudacity_use_sndfile=system \
-Daudacity_use_soxr=system \
-Daudacity_use_lame=system \
%if 0%{?rhel} == 8
-Daudacity_use_twolame=off \
%else
-Daudacity_use_twolame=system \
%endif
-Daudacity_use_flac=system \
-Daudacity_use_ladspa=on \
-Daudacity_use_vorbis=system \
-Daudacity_use_id3tag=system \
-Daudacity_use_expat=system \
-Daudacity_use_soundtouch=system \
-Daudacity_use_vamp=system \
-Daudacity_use_lv2=system \
-Daudacity_use_portaudio=local \
-Daudacity_use_midi=system \
-Daudacity_use_ogg=system \
%if %{with ffmpeg}
%if ! %{with local_ffmpeg}
-Daudacity_use_ffmpeg=loaded \
%endif
%else
-Daudacity_use_ffmpeg=off \
%endif
%cmake_build
%install
%if (0%{?fedora} && 0%{?fedora} < 33)
cd build
%endif
%cmake_install
%if (0%{?fedora} && 0%{?fedora} < 33)
cd -
%endif
rm -Rf $RPM_BUILD_ROOT%{_datadir}/%{name}/include
# Remove a helper script, that runs audacity in GitHub CI builds
rm -f $RPM_BUILD_ROOT/usr/%{name}
%if 0%{?rhel} >= 8 || 0%{?fedora}
if appstream-util --help | grep -q replace-screenshots ; then
# Update the screenshot shown in the software center
#
# NOTE: It would be *awesome* if this file was pushed upstream.
#
# See http://people.freedesktop.org/~hughsient/appdata/#screenshots for more details.
#
appstream-util replace-screenshots $RPM_BUILD_ROOT%{_datadir}/metainfo/audacity.appdata.xml \
https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/audacity/a.png
fi
%endif
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/help/manual
# audacity manual must be unzipped to correct location
unzip %{SOURCE1} -d $RPM_BUILD_ROOT%{_datadir}/%{name}/help
%{find_lang} %{name}
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
$RPM_BUILD_ROOT%{_datadir}/applications/audacity.desktop
mkdir %{buildroot}%{_datadir}/doc/%{name}/nyquist
cp -pr lib-src/libnyquist/nyquist/license.txt %{buildroot}%{_datadir}/doc/%{name}/nyquist
cp -pr lib-src/libnyquist/nyquist/Readme.txt %{buildroot}%{_datadir}/doc/%{name}/nyquist
rm %{buildroot}%{_datadir}/doc/%{name}/LICENSE.txt
%files -f %{name}.lang
%{_bindir}/%{name}
%{_libdir}/%{name}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/EQDefaultCurves.xml
# Modules go to lib/audacity
#{_datadir}/%{name}/modules/
%{_datadir}/%{name}/nyquist/
%{_datadir}/%{name}/plug-ins/
%exclude %{_datadir}/%{name}/help
%{_mandir}/man*/*
%{_datadir}/applications/*
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/pixmaps/*
%{_datadir}/icons/hicolor/*/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/mime/packages/*
%{_datadir}/doc/%{name}
%license LICENSE.txt
%files manual
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/help
%{_datadir}/%{name}/help/manual/

View File

@ -1,14 +0,0 @@
#!/usr/bin/env bash
if [ ! -d "audacity" ]
then
git clone https://github.com/audacity/audacity
fi
tar --exclude '.git' -czf /root/rpmbuild/SOURCES/audacity.tar.gz audacity
ls /root/rpmbuild/SOURCES/
rpmbuild -bs /root/rpmbuild/SPEC/audacity.spec
mock -r audacity /root/rpmbuild/SRPMS/*

View File

@ -0,0 +1,21 @@
FROM archlinux:base-devel
LABEL maintainer="d.vedenko@audacityteam.org"
LABEL description="A build environment to check the builds for Arch package maintainers"
LABEL version="3.0"
RUN pacman -Syu --noconfirm
COPY ["dependencies.sh", "/dependencies.sh"]
RUN ./dependencies.sh
COPY ["entrypoint.sh", "/entrypoint.sh"]
RUN useradd -m user
#RUN echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user
USER user
WORKDIR /home/user
COPY ["PKGBUILD", "/home/user/PKGBUILD"]
ENTRYPOINT ["bash", "-ex", "/entrypoint.sh"]

View File

@ -0,0 +1,97 @@
pkgname=audacity-test
pkgver=3.0.3
pkgrel=1
pkgdesc="Audacity is an easy-to-use, multi-track audio editor and recorder"
groups=(audio)
url="https://audacityteam.org"
license=(GPL)
arch=(x86_64)
depends=(zlib
alsa-lib
gtk2
expat
libid3tag
libogg
libvorbis
flac
lame
twolame
libmad
libsndfile
jack
lilv
lv2
portsmf
portmidi
suil
vamp-plugin-sdk
libsoxr
soundtouch
libpng
libjpeg-turbo
libsm
)
makedepends=(
git
cmake
python-pip
ffmpeg
)
optdepends=('ffmpeg: additional import/export capabilities')
provides=(audacity audacity-test)
conflicts=(audacity audacity-test)
source=(
"audacity-sources.tar.gz"
"audacity-offline-dependencies-arch-linux.tar.gz"
)
md5sums=(
'SKIP'
'SKIP'
)
build() {
depsDir=$(readlink -f ./audacity-offline-dependencies)
python3 -m venv conan_env
source conan_env/bin/activate
pip3 install --no-index --find-links "$depsDir/pip_cache" conan
export CONAN_USER_HOME="$depsDir/conan_home"
mkdir -p $CONAN_USER_HOME
conan config home
conan config init
conan config set storage.download_cache="$CONAN_USER_HOME/download_cache"
cmake_args=(
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=/usr
-D audacity_conan_allow_prebuilt_binaries=no
-D audacity_lib_preference=system # Change the libs default to 'system'
-D audacity_obey_system_dependencies=On # And force it!
-D audacity_use_pch=no
-D audacity_use_wxwidgets=local # wxWidgets 3.1 is not available
-D audacity_use_portaudio=local # System portaudio is not yet usable
-D audacity_use_sbsms=local # sbsms is only available in AUR
)
cmake -S audacity -B build "${cmake_args[@]}"
cmake --build build -- -j`nproc`
}
package() {
cd build
make DESTDIR="$pkgdir/" install
}

View File

@ -0,0 +1,42 @@
#!/usr/bin/env bash
build_deps=(
gcc
git
cmake
python-pip
)
deps=(
zlib
alsa-lib
gtk2
expat
libid3tag
libogg
libvorbis
flac
lame
twolame
libmad
libsndfile
jack
lilv
lv2
portsmf
portmidi
suil
vamp-plugin-sdk
libsoxr
soundtouch
# sbsms is not available on arch
# sbsms
libpng
libjpeg-turbo
libsm
ffmpeg
)
pacman -S --noconfirm \
"${build_deps[@]}" \
"${deps[@]}"

View File

@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -euxo pipefail
cmake_args=(
-D CMAKE_BUILD_TYPE=Release
-D audacity_conan_allow_prebuilt_binaries=no
-D audacity_lib_preference=system # Change the libs default to 'system'
-D audacity_obey_system_dependencies=On # And force it!
-D audacity_use_pch=no
-D audacity_use_wxwidgets=local # wxWidgets 3.1 is not available
-D audacity_use_portaudio=local # System portaudio is not yet usable
-D audacity_use_sbsms=local # sbsms is only available in AUR
)
if [[ $1 == "prepare" ]]; then
tar -xzf /work_dir/audacity-sources.tar.gz
audacity/linux/packages/prepare_offline_dependencies.sh "${cmake_args[@]}"
cp audacity-offline-dependencies.tar.gz /work_dir/audacity-offline-dependencies-arch-linux.tar.gz
elif [[ $1 == "build" ]]; then
tar -xzf /work_dir/audacity-sources.tar.gz
tar -xzf /work_dir/audacity-offline-dependencies-arch-linux.tar.gz
audacity/linux/packages/build_package.sh "${cmake_args[@]}"
cp audacity-linux_x86_64.tar.gz /work_dir/audacity-arch-linux_x86_64.tar.gz
elif [[ $1 == "package" ]]; then
cp /work_dir/*.tar.gz ./
makepkg
cp *.zst /work_dir
fi

24
linux/packages/build_package.sh Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -euxo pipefail
if [[ -d "audacity-offline-dependencies" ]]; then
depsDir=$(readlink -f ./audacity-offline-dependencies)
python3 -m venv conan_env
source conan_env/bin/activate
pip3 install --no-index --find-links "$depsDir/pip_cache" conan
export CONAN_USER_HOME="$depsDir/conan_home"
mkdir -p $CONAN_USER_HOME
conan config home
conan config init
conan config set storage.download_cache="$CONAN_USER_HOME/download_cache"
conan profile update settings.compiler.libcxx=libstdc++11 default
fi
cmake -S audacity -B build $@
cmake --build build -- -j`nproc`
tar -czf audacity-linux_x86_64.tar.gz -C build/bin .

View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -euxo pipefail
scriptLocation=$(dirname "$(readlink -f "$0")")
audacityLocation=$(readlink -f "$scriptLocation/../..")
workDir="$scriptLocation/work_dir"
mkdir -p "$workDir"
pushd "$workDir"
tar --exclude '.git' \
--exclude "audacity-sources.tar.gz" \
-C "$audacityLocation/.." \
-czf audacity-sources.tar.gz audacity
for distro in "$@"
do
echo "Building $distro"
imageName="audacity-packaging-$distro"
docker build -t $imageName "$scriptLocation/$distro"
docker run -ti --volume=$workDir:/work_dir --rm $imageName prepare
docker run -ti --volume=$workDir:/work_dir --rm --network none $imageName build
docker run -ti --volume=$workDir:/work_dir --rm --network none $imageName package
done
rm audacity-sources.tar.gz
popd
cp -r $workDir/* ./
rm -R "$workDir"

View File

@ -0,0 +1,19 @@
FROM fedora:34
LABEL maintainer="d.vedenko@audacityteam.org"
LABEL description="A build environment to check the builds for Fedora package maintainers"
LABEL version="3.0"
COPY ["dependencies.sh", "/dependencies.sh"]
RUN ./dependencies.sh
COPY ["entrypoint.sh", "/entrypoint.sh"]
RUN useradd -m user
#RUN echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user
USER user
WORKDIR /home/user
COPY ["audacity.spec", "/home/user/audacity.spec"]
ENTRYPOINT ["bash", "-ex", "/entrypoint.sh"]

View File

@ -0,0 +1,128 @@
# Spec file is based on https://src.fedoraproject.org/fork/imcinerney/rpms/audacity/tree/im/depupdate
%global _privatelibs lib-.*[.]so.*
%global __provides_exclude ^(%{_privatelibs})$
%global __requires_exclude ^(%{_privatelibs})$
Name: audacity
Version: 3.0~test
Release: 0%{?dist}
Summary: Multitrack audio editor
License: GPLv2
URL: https://www.audacityteam.org/
Source0: audacity-sources.tar.gz
%define tartopdir audacity
BuildRequires: cmake
BuildRequires: gettext-devel
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: git
BuildRequires: python3
BuildRequires: libjpeg-turbo-devel
BuildRequires: alsa-lib-devel
BuildRequires: desktop-file-utils
BuildRequires: expat-devel
BuildRequires: flac-devel
BuildRequires: jack-audio-connection-kit-devel
BuildRequires: ladspa-devel
BuildRequires: lame-devel
BuildRequires: libid3tag-devel
BuildRequires: libmad-devel
BuildRequires: taglib-devel
BuildRequires: twolame-devel
BuildRequires: libogg-devel
BuildRequires: libsndfile-devel
BuildRequires: libvorbis-devel
BuildRequires: portaudio-devel >= 19-16
BuildRequires: portmidi-devel
BuildRequires: soundtouch-devel
BuildRequires: soxr-devel
BuildRequires: vamp-plugin-sdk-devel >= 2.0
BuildRequires: zlib-devel
BuildRequires: libuuid-devel
BuildRequires: wxGTK-devel
BuildRequires: gtk3-devel
BuildRequires: glib2-devel
BuildRequires: libappstream-glib
BuildRequires: sqlite-devel >= 3.32
BuildRequires: lv2-devel >= 1.16
BuildRequires: lilv-devel >= 0.24.6
BuildRequires: serd-devel >= 0.30.2
BuildRequires: sord-devel >= 0.16.4
BuildRequires: sratom-devel >= 0.6.4
BuildRequires: suil-devel >= 0.10.6
BuildRequires: flac-devel
Requires: portaudio%{?_isa} >= 19-16
ExcludeArch: s390x
%description
Audacity is a cross-platform multitrack audio editor. It allows you to
record sounds directly or to import files in various formats. It features
a few simple effects, all of the editing features you should need, and
unlimited undo. The GUI was built with wxWidgets and the audio I/O
supports PulseAudio, OSS and ALSA under Linux.
%prep
%setup -q -n %{tartopdir}
%build
%cmake \
-D CMAKE_BUILD_TYPE=Release \
-D audacity_conan_enabled=Off \
-D audacity_conan_allow_prebuilt_binaries=no \
-D audacity_lib_preference=system \
-D audacity_obey_system_dependencies=On \
-D audacity_use_pch=no \
-D audacity_use_portaudio=local \
-D audacity_use_portsmf=local \
-D audacity_use_sbsms=local \
%cmake_build
%install
%cmake_install
rm -Rf $RPM_BUILD_ROOT%{_datadir}/%{name}/include
# Remove a helper script, that runs audacity in GitHub CI builds
rm -f $RPM_BUILD_ROOT/usr/%{name}
%{find_lang} %{name}
desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications \
$RPM_BUILD_ROOT%{_datadir}/applications/audacity.desktop
mkdir %{buildroot}%{_datadir}/doc/%{name}/nyquist
cp -pr lib-src/libnyquist/nyquist/license.txt %{buildroot}%{_datadir}/doc/%{name}/nyquist
cp -pr lib-src/libnyquist/nyquist/Readme.txt %{buildroot}%{_datadir}/doc/%{name}/nyquist
rm %{buildroot}%{_datadir}/doc/%{name}/LICENSE.txt
%files -f %{name}.lang
%{_bindir}/%{name}
%{_libdir}/%{name}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/EQDefaultCurves.xml
%{_datadir}/%{name}/nyquist/
%{_datadir}/%{name}/plug-ins/
%exclude %{_datadir}/%{name}/help
%{_mandir}/man*/*
%{_datadir}/applications/*
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/pixmaps/*
%{_datadir}/icons/hicolor/*/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/mime/packages/*
%{_datadir}/doc/%{name}
%license LICENSE.txt

View File

@ -0,0 +1,55 @@
#!/usr/bin/env bash
build_deps=(
fedora-packager
@development-tools
cmake
gettext-devel
gcc
g++
git
python3
python3-pip
)
deps=(
libjpeg-turbo-devel
alsa-lib-devel
desktop-file-utils
expat-devel
flac-devel
jack-audio-connection-kit-devel
ladspa-devel
lame-devel
libid3tag-devel
libmad-devel
taglib-devel
twolame-devel
libogg-devel
libsndfile-devel
libvorbis-devel
portaudio-devel
portmidi-devel
soundtouch-devel
soxr-devel
vamp-plugin-sdk-devel
zlib-devel
libuuid-devel
wxGTK-devel
gtk3-devel
glib2-devel
libappstream-glib
#ffmpeg-devel
sqlite-devel
lv2-devel
lilv-devel
serd-devel
sord-devel
sratom-devel
suil-devel
flac-devel
)
dnf install -y \
"${build_deps[@]}" \
"${deps[@]}"

View File

@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -euxo pipefail
cmake_args=(
-D CMAKE_BUILD_TYPE=Release
-D audacity_conan_enabled=Off
-D audacity_conan_allow_prebuilt_binaries=no
-D audacity_lib_preference=system # Change the libs default to 'system'
-D audacity_obey_system_dependencies=On # And force it!
-D audacity_use_pch=no
-D audacity_use_portaudio=local # System portaudio is not yet usable
-D audacity_use_portsmf=local
-D audacity_use_sbsms=local
)
if [[ $1 == "prepare" ]]; then
tar -xzf /work_dir/audacity-sources.tar.gz
audacity/linux/packages/prepare_offline_dependencies.sh "${cmake_args[@]}"
cp audacity-offline-dependencies.tar.gz /work_dir/audacity-offline-dependencies-fedora34.tar.gz
elif [[ $1 == "build" ]]; then
tar -xzf /work_dir/audacity-sources.tar.gz
tar -xzf /work_dir/audacity-offline-dependencies-fedora34.tar.gz
audacity/linux/packages/build_package.sh "${cmake_args[@]}"
cp audacity-linux_x86_64.tar.gz /work_dir/audacity-fedora34_x86_64.tar.gz
elif [[ $1 == "package" ]]; then
mkdir -p rpmbuild/SOURCES
cp /work_dir/*.tar.gz ./rpmbuild/SOURCES/
rpmbuild -ba --rpmfcdebug audacity.spec
cp -rv ./rpmbuild/RPMS /work_dir
cp -rv ./rpmbuild/SRPMS /work_dir
fi

View File

@ -0,0 +1,63 @@
#!/usr/bin/env bash
# Usage prepare_offline_environment.sh cmake-options...
set -euxo pipefail
packageName="audacity-offline-dependencies"
scriptLocation=$(dirname "$(readlink -f "$0")")
audacityLocation=$(readlink -f "$scriptLocation/../..")
resultsLocation=$(pwd)
packageLocation="$resultsLocation/$packageName"
echo "Audacity location: $audacityLocation"
echo "Result location: $resultsLocation"
mkdir -p $packageLocation
cd $packageLocation
# Create pip download cache containing all the
# packages requiredf to istall Conan
mkdir -p pip_cache
pushd pip_cache
pip3 download conan
popd
# Cache all Conan dependencies
mkdir -p temp
pushd temp
python3 -m venv conan_env
source conan_env/bin/activate
pip3 install --no-index --find-links "$packageLocation/pip_cache" conan
export CONAN_USER_HOME="$packageLocation/conan_home"
mkdir -p $CONAN_USER_HOME
conan config home
conan config init
conan config set storage.download_cache="$CONAN_USER_HOME/download_cache"
conan profile update settings.compiler.libcxx=libstdc++11 default
# Configure Audacity so we can collect the required
# packages.
cmake ${@} $audacityLocation
conan remove "*" --src --builds --packages --force
popd
rm -R temp
cd $resultsLocation
tar -czf "$packageName.tar.gz" $packageName
rm -R $packageLocation

21
linux/packages/ubuntu-20.04/Dockerfile vendored Normal file
View File

@ -0,0 +1,21 @@
FROM ubuntu:20.04
LABEL maintainer="d.vedenko@audacityteam.org"
LABEL description="A build environment to check the builds for Ubuntu package maintainers"
LABEL version="3.0"
COPY ["dependencies.sh", "/dependencies.sh"]
RUN ./dependencies.sh
COPY ["entrypoint.sh", "/entrypoint.sh"]
RUN useradd -m user
COPY ["debian", "/home/user/audacity-3.0.3/debian"]
RUN chown -R user /home/user/audacity-3.0.3
USER user
WORKDIR /home/user
ENTRYPOINT ["bash", "-ex", "/entrypoint.sh"]

View File

@ -0,0 +1,5 @@
audacity (3.0.3-1) UNRELEASED; urgency=medium
* Initial release. (Closes: #XXXXXX)
-- Dmitry Vedenko <dvedenko@ubuntu> Mon, 02 Aug 2021 14:55:02 +0300

View File

@ -0,0 +1,53 @@
Source: audacity
Section: sound
Priority: optional
Maintainer:
Uploaders:
Standards-Version: 4.5.0
Build-Depends: cmake,
debhelper-compat (= 12),
gettext,
git,
libgtk2.0-dev,
libasound2-dev,
libavformat-dev,
libjack-jackd2-dev,
zlib1g-dev,
libexpat1-dev,
libmp3lame-dev,
libsndfile-dev,
libsoxr-dev,
portaudio19-dev,
libsqlite3-dev,
libavcodec-dev,
libavformat-dev,
libavutil-dev,
libid3tag0-dev,
libmad0-dev,
libvamp-hostsdk3v5,
libogg-dev,
libvorbis-dev,
libflac-dev,
libflac++-dev,
lv2-dev,
liblilv-dev,
libserd-dev,
libsord-dev,
libsratom-dev,
libsuil-dev,
libportmidi-dev,
libportsmf-dev,
libsbsms-dev,
libsoundtouch-dev,
libtwolame-dev,
libpng-dev,
libjpeg-turbo8-dev
Homepage: https://www.audacityteam.org/
Rules-Requires-Root: no
Package: audacity
Architecture: amd64
Depends: ${misc:Depends},
${shlibs:Depends}
Description: Audacity is a multi-track audio editor for Linux/Unix, MacOS and
Windows.

View File

44
linux/packages/ubuntu-20.04/debian/rules vendored Executable file
View File

@ -0,0 +1,44 @@
#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export CONAN_USER_HOME = $(shell pwd)/audacity-offline-dependencies/conan_home
export PATH := $(shell pwd)/conan_env/bin:$(PATH)
%:
dh $@
override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=Release \
-Daudacity_conan_allow_prebuilt_binaries=no \
-Daudacity_lib_preference=system \
-Daudacity_obey_system_dependencies=On \
-Daudacity_use_pch=no \
-Daudacity_use_wxwidgets=local \
-Daudacity_use_portaudio=local \
-Daudacity_use_vamp=local \
-Daudacity_use_sbsms=local
# tests fails with system portaudio
override_dh_auto_test:
override_dh_shlibdeps:
dh_shlibdeps -l$(shell pwd)/debian/audacity/usr/lib/$(DEB_BUILD_GNU_TYPE)/audacity
execute_after_dh_auto_install:
#mv debian/audacity/usr/share/appdata/ debian/audacity/usr/share/metainfo/
rm debian/audacity/usr/share/doc/audacity/LICENSE.txt
execute_before_dh_auto_configure:
python3 -m venv conan_env
conan_env/bin/pip3 install --no-index --find-links "./audacity-offline-dependencies/pip_cache" conan
mkdir -p ${CONAN_USER_HOME}
conan config home
conan config init
conan config set storage.download_cache="${CONAN_USER_HOME}/download_cache"
conan profile update settings.compiler.libcxx=libstdc++11 default

View File

@ -0,0 +1 @@
3.0 (quilt)

63
linux/packages/ubuntu-20.04/dependencies.sh vendored Executable file
View File

@ -0,0 +1,63 @@
#!/usr/bin/env bash
export TZ=Europe/London
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
build_deps=(
build-essential
fakeroot
devscripts
gcc
g++
git
python3
python3-setuptools
python3-venv
python3-wheel
python3-pip
python3-dev
wget
cmake
)
deps=(
libgtk2.0-dev
libasound2-dev
libavformat-dev
libjack-jackd2-dev
zlib1g-dev
libexpat1-dev
libmp3lame-dev
libsndfile-dev
libsoxr-dev
portaudio19-dev
libsqlite3-dev
libavcodec-dev
libavformat-dev
libavutil-dev
libid3tag0-dev
libmad0-dev
libvamp-hostsdk3v5
libogg-dev
libvorbis-dev
libflac-dev
libflac++-dev
lv2-dev
liblilv-dev
libserd-dev
libsord-dev
libsratom-dev
libsuil-dev
libportmidi-dev
libportsmf-dev
libsbsms-dev
libsoundtouch-dev
libtwolame-dev
libpng-dev
libjpeg-turbo8-dev
)
apt-get update
apt-get install -y \
"${build_deps[@]}" \
"${deps[@]}"

View File

@ -0,0 +1,58 @@
#!/usr/bin/env bash
set -euxo pipefail
cmake_args=(
-D CMAKE_BUILD_TYPE=Release
-D audacity_conan_allow_prebuilt_binaries=no
-D audacity_lib_preference=system # Change the libs default to 'system'
-D audacity_obey_system_dependencies=On # And force it!
-D audacity_use_pch=no
-D audacity_use_wxwidgets=local # wxWidgets 3.1 is not available
-D audacity_use_portaudio=local # System portaudio is not yet usable
-D audacity_use_vamp=local
-D audacity_use_sbsms=local # We rely on 2.2.0, 2.0.l2 is API incompatible
)
if [[ $1 == "prepare" ]]; then
tar -xzf /work_dir/audacity-sources.tar.gz
audacity/linux/packages/prepare_offline_dependencies.sh "${cmake_args[@]}"
cp audacity-offline-dependencies.tar.gz /work_dir/audacity-offline-dependencies-ubuntu-20.04.tar.gz
elif [[ $1 == "build" ]]; then
tar -xzf /work_dir/audacity-sources.tar.gz
tar -xzf /work_dir/audacity-offline-dependencies-ubuntu-20.04.tar.gz
audacity/linux/packages/build_package.sh "${cmake_args[@]}"
cp audacity-linux_x86_64.tar.gz /work_dir/audacity-ubuntu-20.04_x86_64.tar.gz
elif [[ $1 == "package" ]]; then
mkdir orig
pushd orig
tar -xzf /work_dir/audacity-sources.tar.gz
pushd audacity
tar -xzf /work_dir/audacity-offline-dependencies-ubuntu-20.04.tar.gz
popd
mv audacity audacity-3.0.3
tar -czf ../audacity_3.0.3.orig.tar.gz audacity-3.0.3
popd
cp -r orig/audacity-3.0.3/* audacity-3.0.3
rm -r orig
pushd audacity-3.0.3
debuild -us -uc
popd
cp -v *.deb /work_dir/
fi