# Maintainer: Nicola Squartini <tensor5@gmail.com>

# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
#  - disable LTO

pkgname=qpid-proton
pkgver=0.35.0
pkgrel=1
pkgdesc='High-performance, lightweight messaging library'
arch=('x86_64')
url='https://qpid.apache.org/proton'
license=('Apache')
depends=('libjsoncpp.so' 'python')
makedepends=('cmake' 'doxygen' 'go' 'python-setuptools' 'python-sphinx' 'python-wheel' 'swig')
source=("https://www.apache.org/dist/qpid/proton/${pkgver}/qpid-proton-${pkgver}.tar.gz")
sha512sums=('1031e3d45854107a516699e1d18269c6acb22549b2709c1fc1cd25eb870096de109077445f1b400edf231bb21a476a268e2d6674e986fc50e92a281549085543')

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

    mkdir build
    cd build
    cmake \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DLIB_SUFFIX='' \
        -DSYSINSTALL_BINDINGS=ON \
        -DENABLE_LINKTIME_OPTIMIZATION=OFF \
        -DENABLE_TOX_TEST=OFF \
        ..
    make
}

check() {
    cd ${pkgname}-${pkgver}/build

    make test
}

package() {
    cd ${pkgname}-${pkgver}/build

    make DESTDIR="${pkgdir}" install
}