git » libxslt.git » main » tree

[main] / PKGBUILD

# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: John Proctor <jproctor@prium.net>

pkgbase=libxslt
pkgname=(
  libxslt
  libxslt-docs
)
pkgver=1.1.39
pkgrel=2
pkgdesc="XML stylesheet transformation library"
url="https://gitlab.gnome.org/GNOME/libxslt/-/wikis/home"
arch=('armv7h' 'aarch64')
license=(custom:MIT)
depends=(
  libgcrypt
  libxml2
  xz
)
makedepends=(
  git
  python
)
checkdepends=(
  docbook-xml
)
_commit=743ab691bed98ed11ac99bbd9d903d59fb814ab8  # tags/v1.1.39^0
source=(
  "git+https://gitlab.gnome.org/GNOME/libxslt.git#commit=$_commit"
)
b2sums=('SKIP')

pkgver() {
  cd libxslt
  git describe --tags | sed 's/-rc/rc/;s/^v//;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd libxslt
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  local configure_options=(
    --prefix=/usr
    --sysconfdir=/etc
    --localstatedir=/var
    --disable-static
    --with-python=/usr/bin/python3
  )

  cd libxslt
  ./configure "${configure_options[@]}"
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd libxslt
  make check
}

package_libxslt() {
  optdepends=('python: Python bindings')
  provides=(lib{,e}xslt.so)

  cd libxslt
  make DESTDIR="$pkgdir" install

  mkdir -p ../doc/usr/share
  mv "$pkgdir"/usr/share/{doc,gtk-doc} -t ../doc/usr/share

  install -Dm644 Copyright -t "$pkgdir/usr/share/licenses/$pkgname"
}

package_libxslt-docs() {
  pkgdesc+=" (documentation)"
  depends=()

  mv doc/* "$pkgdir"

  install -Dm644 libxslt/Copyright -t "$pkgdir/usr/share/licenses/$pkgname"
}

# vim:set sw=2 sts=-1 et:
b2sums=('c8e56e0ae2b8f02e6a4a71c7f1c007917a200248072535a81159ba21ac2045b51892a93603c1a93c1c572af46da01ce562297b1439994c15da6981ed990ee931')
b2sums=('c8e56e0ae2b8f02e6a4a71c7f1c007917a200248072535a81159ba21ac2045b51892a93603c1a93c1c572af46da01ce562297b1439994c15da6981ed990ee931')