diff options
Diffstat (limited to 'harmony/libgit2')
-rw-r--r-- | harmony/libgit2/APKBUILD | 52 | ||||
-rw-r--r-- | harmony/libgit2/build-both-static-dynamic.patch | 53 | ||||
-rw-r--r-- | harmony/libgit2/libressl.patch | 12 | ||||
-rw-r--r-- | harmony/libgit2/pkgconfig-do-not-quote-Libs.patch | 26 |
4 files changed, 143 insertions, 0 deletions
diff --git a/harmony/libgit2/APKBUILD b/harmony/libgit2/APKBUILD new file mode 100644 index 000000000..e7e4bbfad --- /dev/null +++ b/harmony/libgit2/APKBUILD @@ -0,0 +1,52 @@ +# Contributor: Sergei Lukin <sergej.lukin@gmail.com> +# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net> +# Contributor: Pierre-Gilas MILLON <pgmillon@gmail.com> +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=libgit2 +pkgver=0.26.0 +pkgrel=0 +pkgdesc="A linkable library for Git" +url="https://libgit2.github.com/" +arch="all" +license="GPL-2.0" +depends="" +depends_dev="curl-dev libssh2-dev" +makedepends="$depends_dev python3 cmake zlib-dev openssl-dev" +subpackages="$pkgname-dev" +source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz + build-both-static-dynamic.patch + " +builddir="$srcdir/$pkgname-$pkgver" + +# secfixes: +# 0.25.1-r0: +# - CVE-2016-10128 +# - CVE-2016-10129 +# - CVE-2016-10130 +# 0.24.3-r0: +# - CVE-2016-8568 +# - CVE-2016-8569 + +build() { + cd "$builddir" + cmake \ + -DCMAKE_BUILD_TYPE=RelWithDebugInfo \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DCMAKE_C_FLAGS="$CFLAGS" + make +} + +check() { + cd "$builddir" + CTEST_OUTPUT_ON_FAILURE=TRUE ctest +} + +package() { + cd "$builddir" + make DESTDIR="$pkgdir" install +} + +sha512sums="b6e51f2216c7c23f352572b780ea1325a25a517396709f036bb573295c2bd02aa505ba616846ac7e07863e99e640e7d47fefc5727478a257b283da99060ee47c libgit2-0.26.0.tar.gz +39534d10f38f394446f93df810233464807fca3b0e903ee40067971ecbe1d78102bbe04283435032f757f970e6846ecf279eb727ab137c01e84427bd16913ee6 build-both-static-dynamic.patch" diff --git a/harmony/libgit2/build-both-static-dynamic.patch b/harmony/libgit2/build-both-static-dynamic.patch new file mode 100644 index 000000000..eeb179a1e --- /dev/null +++ b/harmony/libgit2/build-both-static-dynamic.patch @@ -0,0 +1,53 @@ +From: Jakub Jirutka <jakub@jirutka.cz> +Date: Mon, 11 Apr 2017 3:23:00 +0200 +Subject: [PATCH] Build both static and dynamic library + +This is very hack-ish, it makes option BUILD_SHARED_LIBS unusable. +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,7 +28,6 @@ + # Build options + # + OPTION( SONAME "Set the (SO)VERSION of the target" ON ) +-OPTION( BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON ) + OPTION( THREADSAFE "Build libgit2 as threadsafe" ON ) + OPTION( BUILD_CLAR "Build Tests using the Clar suite" ON ) + OPTION( BUILD_EXAMPLES "Build library usage example apps" OFF ) +@@ -44,6 +43,8 @@ + OPTION( CURL "Use curl for HTTP if available" ON) + OPTION( DEBUG_POOL "Enable debug pool allocator" OFF ) + ++SET( BUILD_SHARED_LIBS ON ) ++ + IF(DEBUG_POOL) + ADD_DEFINITIONS(-DGIT_DEBUG_POOL) + ENDIF() +@@ -602,7 +603,8 @@ + ENDIF() + + # Compile and link libgit2 +-ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1} ${WIN_RC}) ++ADD_LIBRARY(objlib OBJECT ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1} ${WIN_RC}) ++ADD_LIBRARY(git2 SHARED $<TARGET_OBJECTS:objlib>) + TARGET_LINK_LIBRARIES(git2 ${SECURITY_DIRS}) + TARGET_LINK_LIBRARIES(git2 ${COREFOUNDATION_DIRS}) + TARGET_LINK_LIBRARIES(git2 ${SSL_LIBRARIES}) +@@ -611,6 +613,9 @@ + TARGET_LINK_LIBRARIES(git2 ${ICONV_LIBRARIES}) + TARGET_OS_LIBRARIES(git2) + ++ADD_LIBRARY(git2_static STATIC $<TARGET_OBJECTS:objlib>) ++SET_TARGET_PROPERTIES(git2_static PROPERTIES OUTPUT_NAME git2 CLEAN_DIRECT_OUTPUT 1) ++ + # Workaround for Cmake bug #0011240 (see http://public.kitware.com/Bug/view.php?id=11240) + # Win64+MSVC+static libs = linker error + IF(MSVC AND GIT_ARCH_64 AND NOT BUILD_SHARED_LIBS) +@@ -639,7 +644,7 @@ + ENDIF () + + # Install +-INSTALL(TARGETS git2 ++INSTALL(TARGETS git2 git2_static + RUNTIME DESTINATION ${BIN_INSTALL_DIR} + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR} diff --git a/harmony/libgit2/libressl.patch b/harmony/libgit2/libressl.patch new file mode 100644 index 000000000..967cdc498 --- /dev/null +++ b/harmony/libgit2/libressl.patch @@ -0,0 +1,12 @@ +diff -ru src.orig/libgit2-0.25.1/src/openssl_stream.h src/libgit2-0.25.1/src/openssl_stream.h +--- libgit2-0.25.1/src/copenssl_stream.h.orig ++++ libgit2-0.25.1/src/openssl_stream.h +@@ -27,7 +27,7 @@ + + + +-# if OPENSSL_VERSION_NUMBER < 0x10100000L ++# if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + + GIT_INLINE(BIO_METHOD*) BIO_meth_new(int type, const char *name) + { diff --git a/harmony/libgit2/pkgconfig-do-not-quote-Libs.patch b/harmony/libgit2/pkgconfig-do-not-quote-Libs.patch new file mode 100644 index 000000000..86133612e --- /dev/null +++ b/harmony/libgit2/pkgconfig-do-not-quote-Libs.patch @@ -0,0 +1,26 @@ +From 452ba68cde25423d13ebb36f0a54559f07aa53a2 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko <ignatenko@redhat.com> +Date: Tue, 7 Feb 2017 16:37:47 +0100 +Subject: [PATCH] pkgconfig: do not quote Libs + +It doesn't make sense at all. +--- + libgit2.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libgit2.pc.in b/libgit2.pc.in +index 329a560a7..880266a30 100644 +--- a/libgit2.pc.in ++++ b/libgit2.pc.in +@@ -6,7 +6,7 @@ Name: libgit2 + Description: The git library, take 2 + Version: @LIBGIT2_VERSION_STRING@ + +-Libs: -L"${libdir}" -lgit2 ++Libs: -L${libdir} -lgit2 + Libs.private: @LIBGIT2_PC_LIBS@ + Requires.private: @LIBGIT2_PC_REQUIRES@ + +-- +2.11.0 + |