# Contributor: Sergei Lukin # Contributor: Sören Tempel # Contributor: Pierre-Gilas MILLON # Maintainer: Natanael Copa pkgname=libgit2 pkgver=0.28.4 pkgrel=0 pkgdesc="A linkable library for Git" url="https://libgit2.org/" arch="all" license="GPL-2.0-only WITH GCC-exception-2.0" depends_dev="curl-dev libssh2-dev http-parser-dev" makedepends="$depends_dev python3 cmake zlib-dev openssl-dev" subpackages="$pkgname-static $pkgname-dev $pkgname-tests::noarch" source="$pkgname-$pkgver.tar.gz::https://github.com/libgit2/libgit2/archive/v$pkgver.tar.gz " # secfixes: # 0.28.4-r0: # - CVE-2019-1348 # - CVE-2019-1349 # - CVE-2019-1350 # - CVE-2019-1351 # - CVE-2019-1352 # - CVE-2019-1353 # - CVE-2019-1354 # - CVE-2019-1387 # 0.27.4-r0: # - CVE-2018-15501 # 0.27.3-r0: # - CVE-2018-10887 # - CVE-2018-10888 # 0.25.1-r0: # - CVE-2016-10128 # - CVE-2016-10129 # - CVE-2016-10130 # 0.24.3-r0: # - CVE-2016-8568 # - CVE-2016-8569 prepare() { default_prepare mkdir -p "$builddir"/build sed -i 's|/usr/bin/env python|/usr/bin/env python3|' tests/generate.py } build() { cd "$builddir"/build cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_C_FLAGS="$CFLAGS" make # Build static library mkdir -p "$builddir"/build-static cd "$builddir"/build-static cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_C_FLAGS="$CFLAGS" \ -DBUILD_SHARED_LIBS=OFF make } check() { cd "$builddir"/build # Test 'offline' fails on s390x, aarch64 and ppc64le ctest -E offline } package() { make -C build DESTDIR="$pkgdir" install make -C build-static DESTDIR="$pkgdir" install } tests() { pkgdesc="$pkgdesc (tests)" mkdir -p "$subpkgdir"/usr/src/$pkgname/ cp -a "$builddir"/tests "$subpkgdir"/usr/src/$pkgname/ } sha512sums="b81160608003b25d9b922d259ebbbbf941b6bd5100fa1875497c8cd29de320e292fff568c757a7a85b2b3044ddc1cb92c74dbcb13d630d62ecf9a8559b619d15 libgit2-0.28.4.tar.gz"