# Contributor: John Vogel # Maintainer: John Vogel pkgname=xdiff pkgver=2.45.0_git20240513 _commit=5fa8f66616766361f49bfe0cc0d39451a6795449 pkgrel=1 pkgdesc="file differential library used by git, libgit2 and vim" url="https://github.com/libgit2/xdiff" arch="all" license="LGPL-2.1-or-later" makedepends="cmake" subpackages="$pkgname-dev $pkgname-doc" options="!check" source="$pkgname-$pkgver.tar.gz::https://github.com/libgit2/xdiff/archive/$_commit.tar.gz 0001-flesh-out-CMakeLists.txt-for-managable-build-install.patch 0002-fix-build-with-musl-libc.patch" builddir="$srcdir/xdiff-$_commit" build() { if [ "$CBUILD" != "$CHOST" ]; then local crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi cmake -B build-static \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=None \ $crossopts cmake --build build-static cmake -B build-shared \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_BUILD_TYPE=None \ $crossopts cmake --build build-shared } package() { DESTDIR="$pkgdir" cmake --install build-static --component libs DESTDIR="$pkgdir" cmake --install build-shared --component libs DESTDIR="$pkgdir" cmake --install build-shared --component files install -D -m 644 -t "$pkgdir"/usr/share/doc/"$pkgname" \ README.md COPYING } sha512sums=" 5aa0503b55c6d017d1b89bbf432ffba765276b5145ff3e0e6da64da7515dedf5d8343488fb5d4fa5d8960db6b852a31ebdf00552659a34fd768f0456f1015125 xdiff-2.45.0_git20240513.tar.gz 567d3ade90ac702de884b42dda738da08aa6b44e2592c095b205ea899932a3ae292362a99009ce6dffa4fb9192a4add0cb0faea7fe3846fcd4635b9b4d96864c 0001-flesh-out-CMakeLists.txt-for-managable-build-install.patch 11562aaed9c1a0bfe5beb9d02dee1a206f5803580b59b4fd0249586d18b79ed9d44ecab25c0e2c40b596ffcaa45213e38a8b419f5368b9d8145a03467d2b4bd8 0002-fix-build-with-musl-libc.patch "