# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Sylvain HENRY <hsyl20@yahoo.fr>
# Contributor: Hervé YVIQUEL <elldekaa@gmail.com>

pkgname=hwloc
pkgver=2.13.0
pkgrel=1
pkgdesc='Portable Hardware Locality is a portable abstraction of hierarchical architectures'
url='https://www.open-mpi.org/projects/hwloc/'
arch=('x86_64' 'aarch64')
license=('BSD-3-Clause')
depends=(
  'glibc'
  'libpciaccess'
  'libtool'
  'ncurses'
  'systemd-libs'
)
makedepends=(
  'cairo'
  'libx11'
  'libxml2'
  'systemd'
)
optdepends=(
  'cairo: PDF, Postscript, and PNG export support'
  'libxml2: full XML import/export support'
)
options=('!docs')
source=("https://www.open-mpi.org/software/hwloc/v${pkgver%.*}/downloads/${pkgname}-${pkgver}.tar.bz2"
        "eperm-tests.patch")
sha512sums=('88958a624211fbc3fd2f424de8eed2d6b47a0e3b3cf524725c9695d8a73929de71f3615d4f2e610678a8e1b169c7a592eae45464493f6288b16b0ce368015b28'
            'SKIP')
b2sums=('4c92526d67fb075ee46b36b921dacc0e07e4fc967e2542c3a21ba541a278469d9f6b1dcc0a8592ebb96ba546d5f31aee37acb22b6b560dff7a3bced444ad5582'
        'SKIP')

prepare() {
  cd hwloc-${pkgver}

  patch -Np1 < ../eperm-tests.patch
  autoreconf
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --enable-plugins \
    --sysconfdir=/etc
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make check
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
