diff options
Diffstat (limited to 'xdiff')
| -rw-r--r-- | xdiff/0001-git-xdiff.h-fix-build-with-musl.patch | 27 | ||||
| -rw-r--r-- | xdiff/0002-more-usable-cmake-builds.patch | 71 | ||||
| -rw-r--r-- | xdiff/APKBUILD | 50 |
3 files changed, 148 insertions, 0 deletions
diff --git a/xdiff/0001-git-xdiff.h-fix-build-with-musl.patch b/xdiff/0001-git-xdiff.h-fix-build-with-musl.patch new file mode 100644 index 0000000..7f976c7 --- /dev/null +++ b/xdiff/0001-git-xdiff.h-fix-build-with-musl.patch @@ -0,0 +1,27 @@ +From f1e2f9e1e52d5362389ee98e66402474dea1867a Mon Sep 17 00:00:00 2001 +From: John Vogel <jvogel4@stny.rr.com> +Date: Fri, 8 Sep 2023 18:55:43 -0400 +Subject: [PATCH] git-xdiff.h: fix build with musl + +--- + git-xdiff.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/git-xdiff.h b/git-xdiff.h +index d812d0d..1e8c260 100644 +--- a/git-xdiff.h ++++ b/git-xdiff.h +@@ -50,6 +50,10 @@ + #define xdl_regex_t regex_t + #define xdl_regmatch_t regmatch_t + ++#ifndef REG_STARTEND ++#define REG_STARTEND 00004 ++#endif ++ + inline int xdl_regexec_buf( + const xdl_regex_t *preg, const char *buf, size_t size, + size_t nmatch, xdl_regmatch_t pmatch[], int eflags) +-- +2.42.0 + diff --git a/xdiff/0002-more-usable-cmake-builds.patch b/xdiff/0002-more-usable-cmake-builds.patch new file mode 100644 index 0000000..687956d --- /dev/null +++ b/xdiff/0002-more-usable-cmake-builds.patch @@ -0,0 +1,71 @@ +From 411b4cc5d0941f2ea7e5e9f22f3df2991d2b6588 Mon Sep 17 00:00:00 2001 +From: John Vogel <jvogel4@stny.rr.com> +Date: Fri, 8 Sep 2023 21:31:28 -0400 +Subject: [PATCH 2/2] more usable cmake builds + +--- + CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 46 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 766b546..43e2515 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,8 +1,50 @@ + cmake_minimum_required(VERSION 3.5.1) + +-project(xdiff VERSION "0.1" LANGUAGES C) ++project(xdiff C) + +-file(GLOB SRC "*.c" "*.h") +-list(SORT SRC) ++set(XDIFF_MAJOR_VERSION 2) ++set(XDIFF_MINOR_VERSION 40) ++set(XDIFF_PATCH_VERSION 1) + +-add_library(xdiff OBJECT ${SRC}) ++set(XDIFF_VERSION ++ ${XDIFF_MAJOR_VERSION}.${XDIFF_MINOR_VERSION}.${XDIFF_PATCH_VERSION}) ++ ++set(xdiff_LIB_SRCS ++ xdiffi.c ++ xemit.c ++ xhistogram.c ++ xmerge.c ++ xpatience.c ++ xprepare.c ++ xutils.c) ++ ++option(BUILD_SHARED_LIBS "build a shared library" ON) ++option(BUILD_STATIC_LIBS "build a static library" ON) ++ ++add_library(xdiff ${xdiff_LIB_SRCS}) ++ ++install(FILES ++ git-xdiff.h ++ xdiff.h ++ xdiffi.h ++ xemit.h ++ xinclude.h ++ xmacros.h ++ xprepare.h ++ xtypes.h ++ xutils.h ++ DESTINATION include/xdiff) ++# DESTINATION ${CMAKE_INSTALL_DIR}/include/xdiff) ++ ++if (BUILD_SHARED_LIBS) ++ set_target_properties(xdiff PROPERTIES C_VISIBILITY_PRESET hidden) ++else (BUILD_SHARED_LIBS) ++ target_compile_options(xdiff PUBLIC -DXDIFF_STATIC_DEFINE) ++endif (BUILD_SHARED_LIBS) ++ ++set_target_properties(xdiff PROPERTIES ++ VERSION ${XDIFF_VERSION} ++ SOVERSION ${XDIFF_MAJOR_VERSION}.${XDIFF_MINOR_VERSION}) ++install(TARGETS xdiff ${INSTALL_TARGETS_DEFAULT_ARGS} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +-- +2.42.0 + diff --git a/xdiff/APKBUILD b/xdiff/APKBUILD new file mode 100644 index 0000000..7cf9c5f --- /dev/null +++ b/xdiff/APKBUILD @@ -0,0 +1,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-git-xdiff.h-fix-build-with-musl.patch + 0002-more-usable-cmake-builds.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 +52d98ed4f8ac9db3a63e2bfa87dde957641d713557dca7e4888a787abb7c9980d34ec86031c71f4a91770200573a6796538dcb808afb11c28210c4d9fb97f40d 0001-git-xdiff.h-fix-build-with-musl.patch +33b4f3ad6dc80fc4796e6f90afbc74bc4d981c55b3caadefbeb6de29360081d13f914af9c240b40c8b5b9e95f42bab6dad1042bad374df6dd717e6effa56df40 0002-more-usable-cmake-builds.patch +" |
