summaryrefslogtreecommitdiff
path: root/app-misc/qman
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-09-15 16:25:10 -0500
committerroot <root@alpha.trunkmasters.com>2026-09-15 16:25:10 -0500
commit709cefca42ef2a976a9aff8afb44a95ffc545b79 (patch)
tree4a0c9baada24031c4187bce895ad742f7f5eb85f /app-misc/qman
parentc012d247f03a893c117c88f73bcf6cb6494dcd22 (diff)
downloadbaldeagleos-repo-709cefca42ef2a976a9aff8afb44a95ffc545b79.tar.gz
baldeagleos-repo-709cefca42ef2a976a9aff8afb44a95ffc545b79.tar.xz
baldeagleos-repo-709cefca42ef2a976a9aff8afb44a95ffc545b79.zip
Adding metadata
Diffstat (limited to 'app-misc/qman')
-rw-r--r--app-misc/qman/files/qman-1.5.0-musl-libc-fix.patch105
-rw-r--r--app-misc/qman/qman-1.5.0.ebuild13
-rw-r--r--app-misc/qman/qman-9999.ebuild6
3 files changed, 122 insertions, 2 deletions
diff --git a/app-misc/qman/files/qman-1.5.0-musl-libc-fix.patch b/app-misc/qman/files/qman-1.5.0-musl-libc-fix.patch
new file mode 100644
index 000000000000..ee87c00b9dd1
--- /dev/null
+++ b/app-misc/qman/files/qman-1.5.0-musl-libc-fix.patch
@@ -0,0 +1,105 @@
+From 714a67ff68f7e2a7b3f9ede538cc2e2b0f4870cc Mon Sep 17 00:00:00 2001
+From: Pantelis Panayiotou <p.panayiotou@gmail.com>
+Date: Fri, 5 Sep 2025 14:14:46 +0300
+Subject: [PATCH] Fallback of strcasestr() for systems that don't use libc
+ (issue #68)
+
+(GURU context: This is a backport of [1] to 1.5.0, fixing a build issue
+ on musl systems.)
+
+[1]: https://github.com/plp13/qman/commit/1dcda6e0fef34fa5c592b133b7d899dce4264f46
+---
+ src/program.c | 2 +-
+ src/util.c | 29 +++++++++++++++++++++++++++++
+ src/util.h | 11 ++++++++---
+ 3 files changed, 38 insertions(+), 4 deletions(-)
+
+diff --git a/src/program.c b/src/program.c
+index c194f48..219fa34 100644
+--- a/src/program.c
++++ b/src/program.c
+@@ -389,7 +389,7 @@ bool man_loc(char *dst, unsigned dst_len, const wchar_t *args,
+ ret = false;
+ FILE *pp = xpopen(cmdstr, "r");
+ while (-1 != sreadline(dst, dst_len, pp)) {
+- combo_ptr = strcasestr(dst, combo);
++ combo_ptr = xstrcasestr(dst, combo);
+ if (NULL != combo_ptr) {
+ combo_post = combo_ptr[strlen(combo)];
+ if ('.' == combo_post || '\0' == combo_post) {
+diff --git a/src/util.c b/src/util.c
+index 1216080..47adfab 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -326,6 +326,35 @@ size_t xmbstowcs(wchar_t *dest, const char *src, size_t n) {
+ return res;
+ }
+
++char *xstrcasestr(const char *haystack, const char *needle) {
++#if defined(__GLIBC__) && (defined(_GNU_SOURCE) || defined(_DEFAULT_SOURCE))
++ return strcasestr(haystack, needle);
++#else
++ unsigned i = 0, j;
++ char haystack_c, needle_c;
++
++ if (L'\0' == needle[0])
++ return (char *)haystack;
++
++ while (L'\0' != haystack[i]) {
++ j = 0;
++ while (TRUE) {
++ haystack_c = tolower(haystack[i + j]);
++ needle_c = tolower(needle[j]);
++ if (L'\0' == needle_c)
++ return (char *)&haystack[i];
++ else if (haystack_c != needle_c)
++ break;
++ else
++ j++;
++ }
++ i++;
++ }
++
++ return NULL;
++#endif
++}
++
+ int xsystem(const char *cmd, bool fail) {
+ int res = system(cmd);
+
+diff --git a/src/util.h b/src/util.h
+index 2f5caf1..2ca4185 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -193,7 +193,8 @@ void is_readable(const char *path);
+ // Safely call `calloc()`
+ extern void *xcalloc(size_t nmemb, size_t size);
+
+-// Safely call `reallocarray()`
++// Safely call `reallocarray()` if it exists, or our own local implementation if
++// it doesn't
+ extern void *xreallocarray(void *ptr, size_t nmemb, size_t size);
+
+ // Safely call `popen()`
+@@ -258,12 +259,16 @@ extern wchar_t *xwcsdup(const wchar_t *s);
+ // you're converting/copying parts of strings), use their vanilla counterparts
+ // instead.
+
+-// Safely call wcstombs()
++// Safely call `wcstombs()`
+ extern size_t xwcstombs(char *dest, const wchar_t *src, size_t n);
+
+-// Safely call mbstowcs()
++// Safely call `mbstowcs()`
+ size_t xmbstowcs(wchar_t *dest, const char *src, size_t n);
+
++// Safely call `strcasestr()` if it exists, or our own local implementation if
++// it doesn't
++extern char *xstrcasestr(const char *haystack, const char *needle);
++
+ // Safely call `system(cmd)`, to execute `cmd` in a new shell. If `fail` is
+ // true, and the return value of `system()` is non-zero, terminate. Otherwise
+ // return said return value.
+--
+2.55.0
+
diff --git a/app-misc/qman/qman-1.5.0.ebuild b/app-misc/qman/qman-1.5.0.ebuild
index 09e13f545bd1..2b9ddeb32a0c 100644
--- a/app-misc/qman/qman-1.5.0.ebuild
+++ b/app-misc/qman/qman-1.5.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -19,6 +19,9 @@ DEPEND="
sys-libs/ncurses:=
dev-libs/inih
virtual/zlib:=
+ elibc_musl? (
+ dev-libs/libbsd
+ )
"
BDEPEND="
dev-python/cogapp
@@ -28,10 +31,18 @@ BDEPEND="
"
RDEPEND="${DEPEND}"
+src_prepare() {
+ if use elibc_musl; then
+ eapply "${FILESDIR}"/${P}-musl-libc-fix.patch
+ fi
+ default
+}
+
src_configure() {
local emesonargs=(
$(meson_feature doc docs)
$(meson_feature test tests)
+ $(meson_feature elibc_musl libbsd)
-Ddocdir="/usr/share/doc/${PF}"
)
meson_src_configure
diff --git a/app-misc/qman/qman-9999.ebuild b/app-misc/qman/qman-9999.ebuild
index d200a7966eed..e5d37e8b8e93 100644
--- a/app-misc/qman/qman-9999.ebuild
+++ b/app-misc/qman/qman-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -20,6 +20,9 @@ DEPEND="
sys-libs/ncurses:=
dev-libs/inih
virtual/zlib:=
+ elibc_musl? (
+ dev-libs/libbsd
+ )
"
BDEPEND="
dev-python/cogapp
@@ -33,6 +36,7 @@ src_configure() {
local emesonargs=(
$(meson_feature doc docs)
$(meson_feature test tests)
+ $(meson_feature elibc_musl libbsd)
-Ddocdir="/usr/share/doc/${PF}"
)
meson_src_configure