summaryrefslogtreecommitdiff
path: root/sys-block/gparted/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
commit0f558761aa2dee1017b4751e4017205e015a9560 (patch)
tree037df795519468a25d9362b4e95cdaeb84eb1cf9 /sys-block/gparted/files
parent752d6256e5204b958b0ef7905675a940b5e9172f (diff)
gentoo resync : 29.12.2022
Diffstat (limited to 'sys-block/gparted/files')
-rw-r--r--sys-block/gparted/files/gparted-1.4.0-musl-basename.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/sys-block/gparted/files/gparted-1.4.0-musl-basename.patch b/sys-block/gparted/files/gparted-1.4.0-musl-basename.patch
new file mode 100644
index 000000000000..eeba8867ed42
--- /dev/null
+++ b/sys-block/gparted/files/gparted-1.4.0-musl-basename.patch
@@ -0,0 +1,53 @@
+https://gitlab.gnome.org/GNOME/gparted/-/merge_requests/99.patch
+https://bugs.gentoo.org/837794
+
+From 45c00927b72319f00855c7feaf4dcf109b3e4414 Mon Sep 17 00:00:00 2001
+From: Markus Volk <f_l_k@t-online.de>
+Date: Fri, 8 Apr 2022 08:58:46 +0000
+Subject: [PATCH] Use POSIX basename() in BCache_Info.cc (!99)
+
+Musl libc [1][2] doesn't implement the GNU variant of basename() [3][4],
+obtained via #include <string.h>. Therefore GParted fails to build on
+such distributions:
+
+ fdebug-prefix-map=TOPDIR/build/tmp/work/cortexa57-yoe-linux-musl/gparted/1.4.0-r0/recipe-sysroot-native=-fvisibility-inlines-hidden -c -o ../../gparted-1.4.0/src/BCache_Info.cc:52:33:
+
+ error: use of undeclared identifier 'basename'; did you mean 'g_basename'?
+ return "/dev/" + Glib::ustring(basename(buf));
+ ^~~~~~~~
+ g_basename
+
+Fix by using the POSIX implementation of basename() [5] instead,
+obtained via #include <libgen.h>, which musl libc does implement [6].
+Note that the POSIX implementation of basename() is allowed to modify
+the string passed to it. This is okay because
+BCache_Info::get_bcache_device() is using a modifiable local character
+buffer.
+
+[1] musl libc
+ https://musl.libc.org/
+[2] Projects using musl
+ https://wiki.musl-libc.org/projects-using-musl.html
+[3] The GNU C Library, 5.10 Finding Tokens in a String
+ https://www.gnu.org/software/libc/manual/html_node/Finding-Tokens-in-a-String.html
+[4] basename(3) - Linux manual page
+ https://man7.org/linux/man-pages/man3/basename.3.html
+[5] POSIX basename()
+ https://pubs.opengroup.org/onlinepubs/009695399/functions/basename.html
+[6] musl source, basename.c
+ http://git.musl-libc.org/cgit/musl/tree/src/misc/basename.c
+
+Closes !99 - Fix undeclared identifier 'basename' build failure with
+ musl libc
+--- a/src/BCache_Info.cc
++++ b/src/BCache_Info.cc
+@@ -17,7 +17,7 @@
+
+ #include "BCache_Info.h"
+
+-#include <string.h> // GNU version of basename()
++#include <libgen.h> // POSIX version of basename()
+ #include <unistd.h>
+ #include <glibmm/ustring.h>
+ #include <glibmm/fileutils.h>
+GitLab