summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7321eec7b957ecd60dda69cd7985a3da4fa847bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Maintainer: Karol "Kenji Takahashi" Wo┼║niak <kenji.sx>
# Maintainer: Jakob Gahde <j5lx@fmail.co.uk>
# Maintainer: Teteros <teteros at teknik dot io>

pkgname=radium
pkgver=5.9.49
pkgrel=1
pkgdesc="A graphical music editor. A next generation tracker."
arch=('i686' 'x86_64')
url="https://users.notam02.no/~kjetism/radium"
license=('GPL')
depends=(
  'desktop-file-utils'
  'fftw'
  'glu'
  'hicolor-icon-theme'
  'jack'
  'liblrdf'
  'libmpc'
  'libsamplerate'
  'python2'
  'qt5-webkit'
  'qt5-x11extras'
  'speex'
)
makedepends=(
  'boost'
  'cmake'
  'libxcursor'
  'libxinerama'
  'libxkbfile'
  'libxrandr'
  'llvm40'
  'qt5-tools'
  'steinberg-vst36'
)
optdepends=(
  'calf-ladspa: Default chorus plugin'
  'ladspa-plugins: Package group for default radium plugins incl in binary releases'
)
options=(!strip) # https://github.com/kmatheussen/radium/issues/1153#issuecomment-421543245
source=("https://github.com/kmatheussen/${pkgname}/archive/${pkgver}.tar.gz"
        "use-libtirpc-headers.patch"
        "use-system-libxcb.patch"
        "use-system-vstsdk.patch"
        "use-static-llvm40.patch")
sha256sums=('aa3c7e4d30d3f9b120c0db890a0817399c4b53a1d329e6812e01eae7cf3bae7f'
            'f2596261f9ebd859f9850cbfc97edb7fd5d45cf8768ce47d0721cbf4b2d80c7e'
            '94de9befbe6530c721917445ee3a0c0202371e1b2229784b2ea6e0c0efaf7808'
            '2ec5e24af44f07afd507b1ef52f6d47d754ee336d89f384cd9181fbde2f7d13a'
            '8b5a038fd3320bd49ed2cd81150aa2550c5f5389529f24fbcd603755977644a7')

prepare() {
  cd "${pkgname}-${pkgver}"

  # glibc-2.27 deprecated legacy rpc, header files for libpd are in libtirpc
  patch -p1 < "${srcdir}/use-libtirpc-headers.patch"

  # Use system libxcb 1.13 instead of radium's to reduce build time
  patch -p1 < "${srcdir}/use-system-libxcb.patch"

  # JUCE expects the VST SDK in home directory, this adds paths for SDK in steinberg-vst36 from AUR
  patch -p1 < "${srcdir}/use-system-vstsdk.patch"

  # Bundled FAUST package is not compatible with LLVM above 4.0.1
  # Link llvm40 statically in radium and faust binaries to avoid conflicts with system llvm
  # https://github.com/kmatheussen/radium/issues/1174
  patch -p1 < "${srcdir}/use-static-llvm40.patch"

  # The optional calf-ladspa package in AUR switched to LMMS's 'veal' fork of Calf LADSPA
  # Radium's demo and new .rad song files reference the old/unmaintained calf plugins used in its binary distribution
  # Currently only Calf's 'Multi-Chorus' plugin is used in the preset chorus bus which is replaced by a pipe if missing
  # Simple sed search and replace can be used to replace the old chorus plugin name with the one used in 'veal' plugins
  # https://github.com/kmatheussen/radium/issues/1158
  for file in bin/sounds/*.rad; do sed -i -e 's/Calf MultiChorus LADSPA/Calf Multi Chorus LADSPA/g' "$file"; done
}

build() {
  cd "${pkgname}-${pkgver}"

  RADIUM_QT_VERSION=5 make packages
  RADIUM_QT_VERSION=5 BUILDTYPE=RELEASE ./build_linux.sh
}

package() {
  cd "${pkgname}-${pkgver}"

  # Install radium and its packages to /opt
  ./install.sh "${pkgdir}/opt"

  # Create startup script according to bin/packages/README
  mkdir -p "${pkgdir}/usr/bin"
  echo '#!/bin/bash' > "${pkgdir}/usr/bin/radium"
  echo LADSPA_PATH="$LADSPA_PATH:/usr/lib/ladspa" \
    QT_QPA_PLATFORM_PLUGIN_PATH="$($(RADIUM_QT_VERSION=5 ./find_moc_and_uic_paths.sh qmake) -query QT_INSTALL_PLUGINS)" \
    /opt/radium/radium >> "${pkgdir}/usr/bin/radium"
  chmod +x "${pkgdir}/usr/bin/radium"

  # Icons, .desktop and mimetype files
  mkdir -p "${pkgdir}/usr/share/icons/hicolor/"{16x16,32x32,128x128,256x256}"/apps" \
    "${pkgdir}/usr/share/applications" \
    "${pkgdir}/usr/share/mime/packages"
  ln -s "/opt/radium/radium_16x16x8.png" "${pkgdir}/usr/share/icons/hicolor/16x16/apps/radium.png"
  ln -s "/opt/radium/radium_32x32x24.png" "${pkgdir}/usr/share/icons/hicolor/32x32/apps/radium.png"
  ln -s "/opt/radium/radium_128x128x32.png" "${pkgdir}/usr/share/icons/hicolor/128x128/apps/radium.png"
  ln -s "/opt/radium/radium_256x256x32.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/radium.png"
  ln -s "/opt/radium/radium.desktop" "${pkgdir}/usr/share/applications/radium.desktop"
  ln -s "/opt/radium/radium-mimetype.xml" "${pkgdir}/usr/share/mime/packages/radium.xml"
}

# vim:set sw=2 ts=2 indentexpr=GetShIndent() et: