summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 32698d0bae5ea80ef89301b743715d3dd984472b (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
# Maintainer: OSAMC <https://github.com/osam-cologne/archlinux-proaudio>
# Contributor: Florian Hülsmann <fh@cbix.de>

pkgbase=ola
pkgname=(ola ola-docs)
pkgver=0.10.9
pkgrel=8
pkgdesc='Open Lighting Architecture for controlling entertainment lighting equipment'
arch=(x86_64 aarch64)
url='https://www.openlighting.org'
license=(GPL-2.0-or-later LGPL-2.1-or-later)
depends=()
makedepends=(avahi cppunit doxygen flake8 libftdi-compat liblo libmicrohttpd ncurses protobuf-21
  python-numpy python-protobuf util-linux-libs)
source=("$pkgbase-$pkgver.tar.gz::https://github.com/OpenLightingProject/$pkgbase/archive/refs/tags/$pkgver.tar.gz"
        "fix-protobuf-v20.patch::https://github.com/OpenLightingProject/$pkgbase/pull/1875.patch"
        "fix-liblo.patch::https://github.com/OpenLightingProject/$pkgbase/pull/1954.patch"
        'fix-build-with-gcc-14.patch')
sha256sums=('d2a80d907f5a0a5169583060bd32aa0fdbb2fdfe18d1194dd922595ab6d447b5'
            '6e57bb39c94981f62da6cd6b5c2744ace8ebe4b7b9fa8ee383800c1e3b8d6742'
            '3a85761affce7e6c1ea5bdc29b6c1774e8d3a2cc4bb6fc52daac871cf72cf3ca'
            '35915faad416d4b555132cc0348e39a921f5857475562a6742f46236491feef5')
options=(!lto)

prepare() {
  cd $pkgbase-$pkgver
  # https://github.com/OpenLightingProject/ola/pull/1875
  patch -Np1 -i "$srcdir"/fix-protobuf-v20.patch
  # https://github.com/OpenLightingProject/ola/pull/1954
  patch -Np1 -i "$srcdir"/fix-liblo.patch
  patch -Np1 -i "$srcdir"/fix-build-with-gcc-14.patch
}

build() {
  local config_options=(
    --prefix=/usr
    --enable-silent-rules
    --enable-python-libs
    --enable-rdm-tests
    --enable-ja-rule
    --enable-e133
    --with-protoc=protoc-21
    #--enable-java-libs
  )
  cd $pkgbase-$pkgver
  autoreconf -i
  export CXXFLAGS="$CXXFLAGS -I/usr/include/abseil-cpp11 -I/usr/include/protobuf-21"
  export LDFLAGS="$LDFLAGS -L/usr/lib/protobuf-21"
  ./configure "${config_options[@]}"
  make
  make doxygen-doc
}

check() {
  cd $pkgbase-$pkgver
  make check || (cat ./test-suite.log && false)
}

package_ola() {
  depends+=(avahi libftdi-compat liblo.so libmicrohttpd.so libncursesw.so libprotobuf.so libuuid.so)
  optdepends=('python: for python bindings'
              'python-numpy: for python bindings'
              'python-protobuf: for python bindings')
  cd $pkgbase-$pkgver
  make DESTDIR="$pkgdir" install
}

package_ola-docs() {
  pkgdesc+=' (documentation)'
  arch=(any)
  cd $pkgbase-$pkgver
  mkdir -p "$pkgdir"/usr/share/doc/$pkgbase
  cp -a html/* "$pkgdir"/usr/share/doc/$pkgbase
}