1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 16:37:12 +01:00

Add a Dockerfile and Spec for Fedora 34

This commit is contained in:
Dmitry Vedenko
2021-07-30 18:54:40 +03:00
committed by Dmitry Vedenko
parent 58f2b2f99e
commit 583adc57d0
8 changed files with 244 additions and 289 deletions

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