# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=fribidi
pkgver=1.0.15
pkgrel=1
pkgdesc="A Free Implementation of the Unicode Bidirectional Algorithm"
url="https://github.com/fribidi/fribidi"
arch=(x86_64)
license=(LGPL-2.1-or-later)
depends=(
  glibc
)
makedepends=(
  git
  meson
)
provides=(libfribidi.so)
source=(
  "git+$url?signed#tag=v$pkgver"
  "git+https://github.com/fribidi/c2man#commit=577ed4095383ef5284225d45709e6b5f0598a064"
)
b2sums=('5085e333f8597d512e97f772261dca476caa2c642bb444694bb4346e96fed0f312cf808b6fb52af78a1fc2874047a19c20016be5819bedb655a815193255bfba'
        '4ce1f0e039bbac3d7015eff10b9738ac4b58dc59f736a8f7ba12857d67092444f500928447a08004ae3548ffb2c788a849ac76c89924db2d82653f547cc4cc6a')
  0AD041B27CA166DDA1FE3BAEA7B3409C0CA4ED14 # Dov Grobgeld <dov.grobgeld@gmail.com>
)

prepare() {
  mkdir -p path

  # Fix compilation with GCC 14
  echo "cc='gcc -fpermissive'" > c2man/config.sh

  cd fribidi
}

build() {
  local meson_options=(
  )

  cd c2man
  ./Configure -des
  make
  cp c2man -t ../path
  cd ..

  PATH="$PWD/path:$PATH" arch-meson fribidi build "${meson_options[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
