diff --git a/linux/packages/arch/Dockerfile b/linux/packages/arch/Dockerfile new file mode 100644 index 000000000..01a59f340 --- /dev/null +++ b/linux/packages/arch/Dockerfile @@ -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"] diff --git a/linux/packages/arch/PKGBUILD b/linux/packages/arch/PKGBUILD new file mode 100644 index 000000000..3d46329e2 --- /dev/null +++ b/linux/packages/arch/PKGBUILD @@ -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 +} diff --git a/linux/packages/arch/dependencies.sh b/linux/packages/arch/dependencies.sh new file mode 100755 index 000000000..51ced27d3 --- /dev/null +++ b/linux/packages/arch/dependencies.sh @@ -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[@]}" diff --git a/linux/packages/arch/entrypoint.sh b/linux/packages/arch/entrypoint.sh new file mode 100644 index 000000000..c5c2c7aca --- /dev/null +++ b/linux/packages/arch/entrypoint.sh @@ -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