diff --git a/linux/packages/ubuntu-20.04/Dockerfile b/linux/packages/ubuntu-20.04/Dockerfile new file mode 100644 index 000000000..f71c16cb9 --- /dev/null +++ b/linux/packages/ubuntu-20.04/Dockerfile @@ -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"] diff --git a/linux/packages/ubuntu-20.04/debian/changelog b/linux/packages/ubuntu-20.04/debian/changelog new file mode 100644 index 000000000..698a44a5c --- /dev/null +++ b/linux/packages/ubuntu-20.04/debian/changelog @@ -0,0 +1,5 @@ +audacity (3.0.3-1) UNRELEASED; urgency=medium + + * Initial release. (Closes: #XXXXXX) + + -- Dmitry Vedenko Mon, 02 Aug 2021 14:55:02 +0300 diff --git a/linux/packages/ubuntu-20.04/debian/control b/linux/packages/ubuntu-20.04/debian/control new file mode 100644 index 000000000..4339c9c2f --- /dev/null +++ b/linux/packages/ubuntu-20.04/debian/control @@ -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. diff --git a/linux/packages/ubuntu-20.04/debian/copyright b/linux/packages/ubuntu-20.04/debian/copyright new file mode 100644 index 000000000..e69de29bb diff --git a/linux/packages/ubuntu-20.04/debian/rules b/linux/packages/ubuntu-20.04/debian/rules new file mode 100755 index 000000000..4c95fb861 --- /dev/null +++ b/linux/packages/ubuntu-20.04/debian/rules @@ -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 diff --git a/linux/packages/ubuntu-20.04/debian/source/format b/linux/packages/ubuntu-20.04/debian/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/linux/packages/ubuntu-20.04/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/linux/packages/ubuntu-20.04/dependencies.sh b/linux/packages/ubuntu-20.04/dependencies.sh new file mode 100755 index 000000000..080364b9a --- /dev/null +++ b/linux/packages/ubuntu-20.04/dependencies.sh @@ -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[@]}" diff --git a/linux/packages/ubuntu-20.04/entrypoint.sh b/linux/packages/ubuntu-20.04/entrypoint.sh new file mode 100644 index 000000000..528bedd0a --- /dev/null +++ b/linux/packages/ubuntu-20.04/entrypoint.sh @@ -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