summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5c6b8109215a4a961632146c0e001f0edc5533b0 (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
# Maintainer: Jean Pierre Cimalando <jp-dev@inbox.ru>
# Contributor: Christopher Arndt <aur -at- chrisarndt -dot- de>

pkgname=(adlplug-git opnplug-git)
_pkgname=ADLplug
pkgver=v1.0.1.r35.025baba
pkgrel=1
pkgdesc="FM chip synthesizer"
arch=('i686' 'x86_64')
url="https://github.com/jpcima/ADLplug"
license=('GPL')
groups=('pro-audio')
depends=('fmt' 'jack' 'liblo' 'freetype2' 'libxext' 'hicolor-icon-theme')
makedepends=('git' 'cmake' 'libxrandr' 'libxinerama' 'libxcursor')
source=('git+https://github.com/jpcima/ADLplug.git'
        'git+https://github.com/Wohlstand/libADLMIDI.git'
        'git+https://github.com/Wohlstand/libOPNMIDI.git'
        'git+https://github.com/jpcima/JUCE.git'
        'git+https://github.com/fmtlib/fmt.git'
        'git+https://github.com/jpcima/simpleini.git'
        "juce-gcc9.patch::https://github.com/WeAreROLI/JUCE/commit/4e0adb2af8b424c43d22bd431011c9a6c57d36b6.patch")
sha512sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            '263fe21e7362f4b8c4009d33e8a086ddf57ddd44267343b924f1304a58580a38e6bd2d36c9548ec706be733476d27e5c89f8095f401b9b841ade63d9cb812a77')

pkgver() {
  cd "${srcdir}/${_pkgname}"
  printf "%s" "$(git describe --long --exclude nightly --exclude latest | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

prepare() {
  cd "${srcdir}/${_pkgname}"
  git submodule init
  for submodule in \
    thirdparty/libADLMIDI thirdparty/libOPNMIDI \
    thirdparty/JUCE thirdparty/fmt thirdparty/simpleini
  do
    git config "submodule.${submodule}.url" "${srcdir}/`basename "${submodule}"`"
  done
  git submodule update

  patch -Np1 -d thirdparty/JUCE -i "${srcdir}"/juce-gcc9.patch

  cd "${srcdir}"
  cp -rf "${_pkgname}" "${_pkgname}-opn"
}

build() {
  cd "${srcdir}/${_pkgname}"
  mkdir -p build
  cd build
  cmake -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=/usr/lib \
        -DADLplug_CHIP=OPL3 \
        -DADLplug_USE_SYSTEM_FMT=ON \
        ..
  make

  cd "${srcdir}/${_pkgname}-opn"
  mkdir -p build
  cd build
  cmake -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=/usr/lib \
        -DADLplug_CHIP=OPN2 \
        -DADLplug_USE_SYSTEM_FMT=ON \
        ..
  make
}

package_adlplug-git() {
  pkgdesc="FM synthesizer for ADLMIDI with OPL3 chip emulation"
  provides=('adlplug')
  conflicts=('adlplug')

  cd "${srcdir}/${_pkgname}"
  make -C build DESTDIR="${pkgdir}/" install
  install -vDm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

package_opnplug-git() {
  pkgdesc="FM synthesizer for OPNMIDI with OPN2 chip emulation"
  provides=('opnplug')
  conflicts=('opnplug')

  cd "${srcdir}/${_pkgname}-opn"
  make -C build DESTDIR="${pkgdir}/" install
  install -vDm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}