From 6dff416c1d6721891bbabf48c186096a33708bbb Mon Sep 17 00:00:00 2001 From: John Vogel Date: Sun, 10 Sep 2023 07:14:01 -0400 Subject: local/xdiff: fix shared lib build --- ...MakeLists.txt-for-managable-build-install.patch | 65 ++++++++++++++++++++ xdiff/0001-git-xdiff.h-fix-build-with-musl.patch | 27 -------- .../0002-git-diff.h-fix-build-with-musl-libc.patch | 27 ++++++++ xdiff/0002-more-usable-cmake-builds.patch | 71 ---------------------- xdiff/APKBUILD | 8 +-- 5 files changed, 96 insertions(+), 102 deletions(-) create mode 100644 xdiff/0001-flesh-out-CMakeLists.txt-for-managable-build-install.patch delete mode 100644 xdiff/0001-git-xdiff.h-fix-build-with-musl.patch create mode 100644 xdiff/0002-git-diff.h-fix-build-with-musl-libc.patch delete mode 100644 xdiff/0002-more-usable-cmake-builds.patch diff --git a/xdiff/0001-flesh-out-CMakeLists.txt-for-managable-build-install.patch b/xdiff/0001-flesh-out-CMakeLists.txt-for-managable-build-install.patch new file mode 100644 index 0000000..ef85ab9 --- /dev/null +++ b/xdiff/0001-flesh-out-CMakeLists.txt-for-managable-build-install.patch @@ -0,0 +1,65 @@ +From f9e099d60b7c427b69298b0e04b71d6128188397 Mon Sep 17 00:00:00 2001 +From: John Vogel +Date: Sat, 9 Sep 2023 21:23:42 -0400 +Subject: [PATCH 1/2] flesh out CMakeLists.txt for managable build/install + +--- + CMakeLists.txt | 44 ++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 40 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 766b546..6e7e610 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,8 +1,44 @@ + 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) ++ ++add_library(xdiff ${xdiff_LIB_SRCS}) ++ ++option(BUILD_SHARED_LIBS "build a shared library" ON) ++option(BUILD_STATIC_LIBS "build a static library" OFF) ++ ++install(FILES ++ git-xdiff.h ++ xdiff.h ++ xdiffi.h ++ xemit.h ++ xinclude.h ++ xmacros.h ++ xprepare.h ++ xtypes.h ++ xutils.h ++ DESTINATION include/xdiff) ++ ++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/0001-git-xdiff.h-fix-build-with-musl.patch b/xdiff/0001-git-xdiff.h-fix-build-with-musl.patch deleted file mode 100644 index 7f976c7..0000000 --- a/xdiff/0001-git-xdiff.h-fix-build-with-musl.patch +++ /dev/null @@ -1,27 +0,0 @@ -From f1e2f9e1e52d5362389ee98e66402474dea1867a Mon Sep 17 00:00:00 2001 -From: John Vogel -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-git-diff.h-fix-build-with-musl-libc.patch b/xdiff/0002-git-diff.h-fix-build-with-musl-libc.patch new file mode 100644 index 0000000..099ff55 --- /dev/null +++ b/xdiff/0002-git-diff.h-fix-build-with-musl-libc.patch @@ -0,0 +1,27 @@ +From e0d91c7d06fef4911cca35b40ea810cc5268ceff Mon Sep 17 00:00:00 2001 +From: John Vogel +Date: Sat, 9 Sep 2023 21:24:37 -0400 +Subject: [PATCH 2/2] git-diff.h: fix build with musl libc + +--- + 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 deleted file mode 100644 index 687956d..0000000 --- a/xdiff/0002-more-usable-cmake-builds.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 411b4cc5d0941f2ea7e5e9f22f3df2991d2b6588 Mon Sep 17 00:00:00 2001 -From: John Vogel -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 index 7cf9c5f..c2e32fa 100644 --- a/xdiff/APKBUILD +++ b/xdiff/APKBUILD @@ -13,8 +13,8 @@ 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" + 0001-flesh-out-CMakeLists.txt-for-managable-build-install.patch + 0002-git-diff.h-fix-build-with-musl-libc.patch" builddir="$srcdir/xdiff-$_commit" @@ -45,6 +45,6 @@ package() { 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 +8fd1b2bbd70dcdb69d5d969111863c5fe9802e264bcc04c921a542fc78be39efc659f2f33330d021e6bf6c023f4c9b2eaabc8aeecc6634196cf2716f70b6a3f8 0001-flesh-out-CMakeLists.txt-for-managable-build-install.patch +ca4b04b65201ef35a6498f8d4f41d8a4d69d4811a53e3ce02778496dd105c39f7bcd43fbca24196975d994822187b14e58070af73fa10598de86774eafefc8f1 0002-git-diff.h-fix-build-with-musl-libc.patch " -- cgit v1.2.3