diff --git a/root-packages/libgpiod/build.sh b/root-packages/libgpiod/build.sh new file mode 100644 index 000000000000000..6651680b04fdf76 --- /dev/null +++ b/root-packages/libgpiod/build.sh @@ -0,0 +1,15 @@ +TERMUX_PKG_HOMEPAGE=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git +TERMUX_PKG_DESCRIPTION="C library and tools for interacting with the GPIO character device. Requires kernel v4.6 or higher" +TERMUX_PKG_LICENSE="LGPL-2.1" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=2.2 +TERMUX_PKG_SRCURL="https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-${TERMUX_PKG_VERSION}.tar.gz" +TERMUX_PKG_SHA256=ae35329db7027c740e90c883baf27c26311f0614e6a7b115771b28188b992aec +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +--enable-tools=yes +ac_cv_func_versionsort=yes +" + +termux_step_pre_configure() { + autoreconf -vfi +} diff --git a/root-packages/libgpiod/gpiod.subpackage.sh b/root-packages/libgpiod/gpiod.subpackage.sh new file mode 100644 index 000000000000000..ab282c6e0a84968 --- /dev/null +++ b/root-packages/libgpiod/gpiod.subpackage.sh @@ -0,0 +1,4 @@ +TERMUX_SUBPKG_DESCRIPTION="Tools for interacting with Linux GPIO character device" +TERMUX_SUBPKG_INCLUDE=" +bin/* +" diff --git a/root-packages/libgpiod/versionsort.patch b/root-packages/libgpiod/versionsort.patch new file mode 100644 index 000000000000000..0f2d8853645d767 --- /dev/null +++ b/root-packages/libgpiod/versionsort.patch @@ -0,0 +1,45 @@ +--- ./tools/tools-common.c~ 2024-10-22 08:57:17.000000000 +0000 ++++ ./tools/tools-common.c 2024-12-24 10:09:30.231824790 +0000 +@@ -476,6 +476,42 @@ + return 1; + } + ++int strverscmp(const char *l0, const char *r0) ++{ ++ const unsigned char *l = (const void *)l0; ++ const unsigned char *r = (const void *)r0; ++ size_t i, dp, j; ++ int z = 1; ++ ++ /* Find maximal matching prefix and track its maximal digit ++ * suffix and whether those digits are all zeros. */ ++ for (dp=i=0; l[i]==r[i]; i++) { ++ int c = l[i]; ++ if (!c) return 0; ++ if (!isdigit(c)) dp=i+1, z=1; ++ else if (c!='0') z=0; ++ } ++ ++ if (l[dp]!='0' && r[dp]!='0') { ++ /* If we're not looking at a digit sequence that began ++ * with a zero, longest digit string is greater. */ ++ for (j=i; isdigit(l[j]); j++) ++ if (!isdigit(r[j])) return 1; ++ if (isdigit(r[j])) return -1; ++ } else if (z && dpd_name, (*b)->d_name); ++} ++ + int all_chip_paths(char ***paths_ptr) + { + int i, j, num_chips, ret = 0;