# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
pkgname=libutf8proc
pkgver=2.9.0
_sover=3.0.0
pkgrel=1
pkgdesc='C library for processing UTF-8 encoded Unicode strings'
arch=(armv7h 'aarch64')
url='https://github.com/JuliaStrings/utf8proc'
license=(custom)
makedepends=(cmake git ninja)
source=("git+$url#commit=34db3f7954e9298e89f42641ac78e0450f80a70d" # tag: v2.9.0
$pkgname.pc.in)
b2sums=('SKIP'
'27cfd2086b63b0d9b08720d966d760e4237734a85a293eab81065f49857aa11ed57682a4bd26e4081701d34e61c156170b65bbf38f19387539f5472d0d94db23')
prepare() {
sed "s#@VERSION@#$pkgver#" libutf8proc.pc.in > libutf8proc.pc
}
build() {
cmake \
-B build \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_LIBDIR=lib \
-D CMAKE_INSTALL_PREFIX=/usr \
-D BUILD_SHARED_LIBS=ON \
-G Ninja \
-S utf8proc
ninja -C build
}
package() {
# The install command does not work for libutf8proc
#DESTDIR="$pkgdir" ninja -C $pkgname-$pkgver/build install
cd utf8proc
install -Dm644 utf8proc.h "$pkgdir/usr/include/utf8proc.h"
install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
install -Dm644 "$srcdir/$pkgname.pc" "$pkgdir/usr/lib/pkgconfig/$pkgname.pc"
install -Dm644 ../build/$pkgname.so.$_sover \
"$pkgdir/usr/lib/$pkgname.so.$_sover"
ln -s /usr/lib/$pkgname.so.$_sover "$pkgdir/usr/lib/$pkgname.so"
/sbin/ldconfig -n "$pkgdir/usr/lib"
}