From da2eba0f3a2a3a154558d4ce74754de74e862cbf Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Sat, 15 Dec 2018 08:33:25 +0100 Subject: [PATCH] libdevmapper: add patch and specify TERMUX_PKG_API_LEVEL=23 API_LEVEL=23 is necessary for fmemopen --- root-packages/libdevmapper/build.sh | 9 +-- root-packages/libdevmapper/no-langinfo.patch | 30 ++++++++ root-packages/libdevmapper/pthread-fix.patch | 76 -------------------- 3 files changed, 35 insertions(+), 80 deletions(-) create mode 100644 root-packages/libdevmapper/no-langinfo.patch delete mode 100644 root-packages/libdevmapper/pthread-fix.patch diff --git a/root-packages/libdevmapper/build.sh b/root-packages/libdevmapper/build.sh index 3933ab3c6..454f10b8f 100644 --- a/root-packages/libdevmapper/build.sh +++ b/root-packages/libdevmapper/build.sh @@ -1,17 +1,18 @@ TERMUX_PKG_HOMEPAGE=https://sourceware.org/lvm2/ TERMUX_PKG_DESCRIPTION="A device-mapper library from LVM2 package" -TERMUX_PKG_DEPENDS="libandroid-support" +TERMUX_PKG_DEPENDS="libandroid-support, libaio" TERMUX_PKG_VERSION=2.03.00 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/sourceware/lvm2/releases/LVM2.${TERMUX_PKG_VERSION}.tgz TERMUX_PKG_SHA256=405992bf76960e60c7219d84d5f1e22edc34422a1ea812e21b2ac3c813d0da4e TERMUX_PKG_BUILD_IN_SRC=yes +TERMUX_PKG_API_LEVEL=23 termux_step_make() { - make -j"${TERMUX_MAKE_PROCESSES}" lib.device-mapper + make -j"${TERMUX_MAKE_PROCESSES}" lib.device-mapper } termux_step_make_install() { - cd libdm - make install + cd libdm + make install } diff --git a/root-packages/libdevmapper/no-langinfo.patch b/root-packages/libdevmapper/no-langinfo.patch new file mode 100644 index 000000000..441ca64ef --- /dev/null +++ b/root-packages/libdevmapper/no-langinfo.patch @@ -0,0 +1,30 @@ +--- ../dmsetup.c.orig 2018-12-13 11:29:47.098416214 +0000 ++++ ./libdm/dm-tools/dmsetup.c 2018-12-13 11:47:21.254839518 +0000 +@@ -26,7 +26,9 @@ + #include + #include + #include +-#include ++#ifndef __ANDROID__ ++# include ++#endif + #include + #include + #include +@@ -6463,12 +6465,15 @@ + struct winsize winsz; + size_t len; + ++ #ifndef __ANDROID__ + /* Symbol set default */ + if (!strcmp(nl_langinfo(CODESET), "UTF-8")) + _tsym = &_tsym_utf; + else + _tsym = &_tsym_ascii; +- ++ #else ++ _tsym = &_tsym_utf; ++ #endif + /* Default */ + _tree_switches[TR_DEVICE] = 1; + _tree_switches[TR_TRUNCATE] = 1; diff --git a/root-packages/libdevmapper/pthread-fix.patch b/root-packages/libdevmapper/pthread-fix.patch deleted file mode 100644 index b78ab935a..000000000 --- a/root-packages/libdevmapper/pthread-fix.patch +++ /dev/null @@ -1,76 +0,0 @@ -diff -uNr LVM2.2.02.177/configure LVM2.2.02.177.mod/configure ---- LVM2.2.02.177/configure 2017-12-18 22:44:34.000000000 +0200 -+++ LVM2.2.02.177.mod/configure 2018-05-26 12:58:21.206743983 +0300 -@@ -10806,11 +10806,11 @@ - - done - -- check_lib_no_libs dlm dlm_lock -lpthread -+ check_lib_no_libs dlm dlm_lock - if test $NOTFOUND = 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no pkg for libdlm, using -ldlm" >&5 - $as_echo "no pkg for libdlm, using -ldlm" >&6; } -- DLM_LIBS="-ldlm -lpthread" -+ DLM_LIBS="-ldlm" - HAVE_DLM=yes - fi - elif test $pkg_failed = untried; then -@@ -10831,11 +10831,11 @@ - - done - -- check_lib_no_libs dlm dlm_lock -lpthread -+ check_lib_no_libs dlm dlm_lock - if test $NOTFOUND = 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no pkg for libdlm, using -ldlm" >&5 - $as_echo "no pkg for libdlm, using -ldlm" >&6; } -- DLM_LIBS="-ldlm -lpthread" -+ DLM_LIBS="-ldlm" - HAVE_DLM=yes - fi - else -@@ -14130,7 +14130,7 @@ - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lpthread $LIBS" -+LIBS="$LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -14161,7 +14161,7 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_lock" >&5 - $as_echo "$ac_cv_lib_pthread_pthread_mutex_lock" >&6; } - if test "x$ac_cv_lib_pthread_pthread_mutex_lock" = xyes; then : -- PTHREAD_LIBS="-lpthread" -+ PTHREAD_LIBS="-lc" - else - hard_bailout - fi -diff -uNr LVM2.2.02.177/configure.in LVM2.2.02.177.mod/configure.in ---- LVM2.2.02.177/configure.in 2017-12-18 22:44:34.000000000 +0200 -+++ LVM2.2.02.177.mod/configure.in 2018-05-26 12:57:25.986743573 +0300 -@@ -907,10 +907,10 @@ - PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes], - [NOTFOUND=0 - AC_CHECK_HEADERS(libdlm.h,,[$bailout]) -- check_lib_no_libs dlm dlm_lock -lpthread -+ check_lib_no_libs dlm dlm_lock - if test $NOTFOUND = 0; then - AC_MSG_RESULT([no pkg for libdlm, using -ldlm]) -- DLM_LIBS="-ldlm -lpthread" -+ DLM_LIBS="-ldlm" - HAVE_DLM=yes - fi]) - fi -@@ -1627,8 +1627,8 @@ - [M_LIBS="-lm"], hard_bailout) - - ################################################################################ --AC_CHECK_LIB([pthread], [pthread_mutex_lock], -- [PTHREAD_LIBS="-lpthread"], hard_bailout) -+#AC_CHECK_LIB([pthread], [pthread_mutex_lock], -+# [PTHREAD_LIBS="-lpthread"], hard_bailout) - - ################################################################################ - dnl -- Disable selinux