summaryrefslogtreecommitdiff
path: root/xdiff/APKBUILD
blob: c2e32fa362c695731c145573909491face680b6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Contributor: John Vogel <jvogel4@stny.rr.com>
# Maintainer: John Vogel <jvogel4@stny.rr.com>
pkgname=xdiff
pkgver=2.40.1_git20230511
_commit=4e970f608ee778180e7f68ae1a1c59099a7c1307
pkgrel=0
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 samurai"
install=""
subpackages="$pkgname-static $pkgname-dev"
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-git-diff.h-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-shared \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=ON \
		-DBUILD_STATIC_LIBS=OFF \
		-DCMAKE_BUILD_TYPE=None \
		$crossopts
	cmake --build build-shared
	cmake -B build-static \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=OFF \
		-DBUILD_STATIC_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		$crossopts
	cmake --build build-static
}

package() {
	DESTDIR="$pkgdir" cmake --install build-shared
	DESTDIR="$pkgdir" cmake --install build-static
}

sha512sums="
6e4b70b2e3dcf59052c8dfd93598bd9d3bcdc3c2f7023aa57fe97913dc2b5c6d861a37886328e483fbcc97fc036b1347406f62cf93f1f3931dbdc3f35f0ddad3  xdiff-2.40.1_git20230511.tar.gz
8fd1b2bbd70dcdb69d5d969111863c5fe9802e264bcc04c921a542fc78be39efc659f2f33330d021e6bf6c023f4c9b2eaabc8aeecc6634196cf2716f70b6a3f8  0001-flesh-out-CMakeLists.txt-for-managable-build-install.patch
ca4b04b65201ef35a6498f8d4f41d8a4d69d4811a53e3ce02778496dd105c39f7bcd43fbca24196975d994822187b14e58070af73fa10598de86774eafefc8f1  0002-git-diff.h-fix-build-with-musl-libc.patch
"