# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Nezmer <Nezmer@gmail.com>

pkgname=fribidi
pkgver=1.0.16
pkgrel=1
pkgdesc="A Free Implementation of the Unicode Bidirectional Algorithm"
url="https://github.com/fribidi/fribidi"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
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=('afbe4ef82ccafacca4a344d83e6cfb654e10cad205b885fb3756c70301e9ed0e2ff8c2c650b2805bb7eda82bd39b9a9dead0d0c4fb7c35a40c9313ad92996658'
        '4ce1f0e039bbac3d7015eff10b9738ac4b58dc59f736a8f7ba12857d67092444f500928447a08004ae3548ffb2c788a849ac76c89924db2d82653f547cc4cc6a')
validpgpkeys=(
  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:
