git » audacity.git » main » tree

[main] / PKGBUILD

# Maintainer: David Runge <dvzrv@archlinux.org>
# Maintainer: Christian Heusel <gromit@archlinux.org>
# Contributor: Eric BĂ©langer <eric@archlinux.org>

_name=Audacity
pkgbase=audacity
pkgname=(
  audacity
  audacity-docs
)
pkgver=3.6.1
pkgrel=2
epoch=1
pkgdesc="A program that lets you manipulate digital audio waveforms"
arch=(x86_64 'armv7h')
url="https://audacityteam.org"
license=(GPL3)
makedepends=(
  alsa-lib
  chrpath
  cmake
  catch2-v2
  ffmpeg
  flac
  gcc-libs
  gdk-pixbuf2
  glib2
  glibc
  gtk3
  gtkmm3
 # jack
  lame
  libid3tag
  libmad
  libogg
  libsbsms
  libsndfile
  libsoxr
  libvorbis
  libxkbcommon-x11
  lilv
  lv2
  mpg123
  opusfile
  portaudio
  portmidi
  portsmf
  python
  rapidjson
  soundtouch
  sqlite
  suil
  twolame
  vamp-plugin-sdk
  vst3sdk
  wavpack
  wxwidgets-gtk3
  xcb-util
  xcb-util-cursor
  xcb-util-keysyms
)
source=(
  https://github.com/audacity/audacity/archive/refs/tags/$_name-$pkgver.tar.gz
  https://github.com/$pkgbase/$pkgbase/releases/download/$_name-$pkgver/$pkgbase-manual-$pkgver.tar.gz
  audacity_3_4_2_enable_tests_without_conan.patch
)
sha512sums=('f820560de316a4d0a4bcd76ee16d1913efd6c6fa2d013f9213a27f1327e6dffb425afc157ad96ce8dc219724019380709b8ac54900196b20865c9897aa2a2e69'
            'cf6e2f24b1bd8a6f76a53efdc1b1919c869cc91f623dbcabb3d17a849ce3b5dd7e7d208548f9dd690079ae9bd91e425fedbb61131214ac020a0d3e6979920652'
            'ab92475e599fd4345d33a7ae6cd47231ab614b92ca9a71e732a073b31ec18ad92f3d1384183b0821e75b4ba1bb4987c5369c1398604d6c4ea01a20f94fb7b976')
b2sums=('b3c4f98cae4156e2608a69d3b75d66c81c522a63215f26386eb681ef067fe79bc722ca3abdf0144118b4ecad3ac333db4991d33f0e5fe8cc0381bd05a7bb7089'
        'eb28a2885493b473e5c215329e954513fbe8a4318c51996e300b6a34bf04f23e5550dda8ecd00740b06330913b91f7f20c71b006fd0358cd3915a37c7a6a2c11'
        '0c176336ca8df12f443e6935e8293afa3408e0e7b6a290417007bbbc0500c8eb8716ae3265665a80d85d689f9b369e5edf7986e8507288af77e8eea4ebedd624')

prepare() {
    cd "$pkgname-$_name-$pkgver"
    # https://github.com/audacity/audacity/discussions/5841#discussioncomment-8138725
    patch --forward --strip=1 --input="${srcdir}/audacity_3_4_2_enable_tests_without_conan.patch"
}

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -D AUDACITY_BUILD_LEVEL=2
    -D audacity_conan_enabled=OFF
    -D audacity_has_networking=OFF
    -D audacity_has_crashreports=OFF
    -D audacity_has_updates_check=OFF
    -D audacity_has_sentry_reporting=OFF
    -D audacity_lib_preference=system
    -D audacity_obey_system_dependencies=ON
    -D audacity_use_vst3sdk=system
    -D audacity_has_tests=ON
    -S $pkgname-$_name-$pkgver
    -W no-dev
  )

  export VST3SDK='/usr/src/vst3sdk'
  export CFLAGS+=" -DNDEBUG"
  export CXXFLAGS+=" -DNDEBUG"
  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

#check() {
  # disable two tests which do not work without an alsa/jack instance
 # ctest --test-dir build --output-on-failure --exclude-regex "lib-stretching-sequence|journal_sanity"
#}

package_audacity() {
  license+=(BSD)
  groups=(pro-audio)
  depends=(
    alsa-lib libasound.so
    expat
    flac libFLAC.so libFLAC++.so
    gcc-libs
    glibc
    gdk-pixbuf2 libgdk_pixbuf-2.0.so
    glib2 libglib-2.0.so libgobject-2.0.so
    gtk3 libgdk-3.so libgtk-3.so
    hicolor-icon-theme
   # jack  # likely dlopen'ed
    lame  # likely dlopen'ed
    libid3tag libid3tag.so
    libmad
    libogg libogg.so
    libsbsms libsbsms.so
    libsndfile libsndfile.so
    libsoxr
    libvorbis libvorbis.so libvorbisenc.so libvorbisfile.so
    libx11
    lilv liblilv-0.so
    mpg123 libmpg123.so
    opusfile
    portaudio libportaudio.so
    portmidi libportmidi.so
    portsmf libportSMF.so
    python
    rapidjson
    soundtouch
    sqlite libsqlite3.so
    suil libsuil-0.so
    twolame libtwolame.so
    util-linux-libs
    wxwidgets-gtk3
    vamp-plugin-sdk libvamp-hostsdk.so
    wavpack
    wxwidgets-common
  )
  optdepends=(
    'audacity-docs: for documentation'
    'ffmpeg: for additional import/export capabilities'
  )
  provides=(
    ladspa-host
    lv2-host
    vamp-host
    vst-host
    vst3-host
  )


  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 $pkgname-$_name-$pkgver/lib-src/libnyquist/nyquist/license.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE.nyquist"
}

package_audacity-docs() {
  license+=(CCPL)
  pkgdesc+=" - documentation"

  install -vdm 755 "$pkgdir/usr/share/doc/$pkgbase/html/"
  cp -av help/manual/* "$pkgdir/usr/share/doc/$pkgbase/html/"
}