From 47e984429b1c03bc938fd617669343f3e1555743 Mon Sep 17 00:00:00 2001 From: teldra Date: Fri, 20 May 2022 10:12:25 +0200 Subject: [PATCH] gparted: update to 1.4.0. --- .../gparted/patches/fix_musl_basename.patch | 58 +++++++++++++++++++ srcpkgs/gparted/template | 4 +- 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/gparted/patches/fix_musl_basename.patch diff --git a/srcpkgs/gparted/patches/fix_musl_basename.patch b/srcpkgs/gparted/patches/fix_musl_basename.patch new file mode 100644 index 000000000000..607580d8177e --- /dev/null +++ b/srcpkgs/gparted/patches/fix_musl_basename.patch @@ -0,0 +1,58 @@ +From 45c00927b72319f00855c7feaf4dcf109b3e4414 Mon Sep 17 00:00:00 2001 +From: Markus Volk +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 . 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 , 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 +--- + src/BCache_Info.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/BCache_Info.cc b/src/BCache_Info.cc +index 129a5178..aecc9ef1 100644 +--- a/src/BCache_Info.cc ++++ b/src/BCache_Info.cc +@@ -17,7 +17,7 @@ + + #include "BCache_Info.h" + +-#include // GNU version of basename() ++#include // POSIX version of basename() + #include + #include + #include +-- +GitLab + diff --git a/srcpkgs/gparted/template b/srcpkgs/gparted/template index db6d59810086..d671afacf5b0 100644 --- a/srcpkgs/gparted/template +++ b/srcpkgs/gparted/template @@ -1,6 +1,6 @@ # Template file for 'gparted' pkgname=gparted -version=1.3.1 +version=1.4.0 revision=1 build_style=gnu-configure configure_args="--enable-libparted-dmraid" @@ -13,7 +13,7 @@ maintainer="teldra " license="GPL-2.0-or-later" homepage="https://gparted.sourceforge.io" distfiles="${SOURCEFORGE_SITE}/gparted/gparted/gparted-${version}/gparted-${version}.tar.gz" -checksum=5eee2e6d74b15ef96b13b3a2310c868ed2298e03341021e7d12a5a98a1d1e109 +checksum=e5293a792e53fdbeba29c4a834113cd9603d0d639330da931a468bf3687887be # Some tests are known to fail since 1.1.0 # This disables these: