From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-block/gparted/, sys-block/gparted/files/
Date: Thu, 21 Apr 2022 23:12:52 +0000 (UTC) [thread overview]
Message-ID: <1650582765.d1a95e7e586a51f7485fe2db57ffaf62e8333b2f.sam@gentoo> (raw)
commit: d1a95e7e586a51f7485fe2db57ffaf62e8333b2f
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 21 23:11:13 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 21 23:12:45 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1a95e7e
sys-block/gparted: fix build with musl-1.2.3
Closes: https://bugs.gentoo.org/838466
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../gparted/files/gparted-1.3.1-musl-nullptr.patch | 51 ++++++++++++++++++++++
sys-block/gparted/gparted-1.3.1.ebuild | 6 ++-
sys-block/gparted/gparted-1.4.0.ebuild | 4 ++
3 files changed, 60 insertions(+), 1 deletion(-)
diff --git a/sys-block/gparted/files/gparted-1.3.1-musl-nullptr.patch b/sys-block/gparted/files/gparted-1.3.1-musl-nullptr.patch
new file mode 100644
index 000000000000..2a4f648db609
--- /dev/null
+++ b/sys-block/gparted/files/gparted-1.3.1-musl-nullptr.patch
@@ -0,0 +1,51 @@
+https://gitlab.gnome.org/GNOME/gparted/-/commit/3d4b1c1e7b33f229efd254fb0cc06660af627ea0
+https://bugs.gentoo.org/838466
+
+From: Dominika Liberda <ja@sdomi.pl>
+Date: Sun, 10 Apr 2022 21:09:56 +0200
+Subject: [PATCH] Fix NULL == 0 assumption in call to ped_partition_flag_next()
+ (!100)
+
+GParted fails to build on Alpine Linux Edge (development tree for the
+next release) like this:
+
+ GParted_Core.cc: In constructor 'GParted::GParted_Core::GParted_Core()':
+ GParted_Core.cc:75:64: error: invalid 'static_cast' from type 'std::nullptr_t' to type 'PedPartitionFlag'
+ 75 | for ( PedPartitionFlag flag = ped_partition_flag_next( static_cast<PedPartitionFlag>( NULL ) ) ;
+ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The code is failing to compile now because musl libc 1.2.3 has became
+more C++11 strict [1][2] by defining NULL [3] as nullptr [4] rather than
+as 0. The parameter to ped_partition_flag_next() [5] should always have
+been numeral 0 cast to an enumeration and never the NULL pointer.
+
+Fixes this commit [6] from 2004-12-27 which changed the parameter from 0
+to NULL.
+
+[1] define NULL as nullptr when used in C++11 or later
+ https://git.musl-libc.org/cgit/musl/commit?id=98e688a9da5e7b2925dda17a2d6820dddf1fb28
+[2] NULL vs nullptr (Why was it replaced?) [duplicate]
+ https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced
+[3] C++ reference, NULL
+ https://en.cppreference.com/w/cpp/types/NULL
+[4] C++ reference, nullptr
+ https://en.cppreference.com/w/cpp/language/nullptr
+[5] libparted Documentation, ped_partition_flag_next()
+ https://www.gnu.org/software/parted/api/group__PedPartition.html#g0ce9ce4247b320011bc8e9d957c8cdbb
+[6] Added cylsize to Device and made Operation contain a Device instead
+ commit 174f0cff77c5799a713954a22b2c54306d03036c
+
+Closes !100 - Fix NULL == 0 assumption in call to
+ ped_partition_flag_next()
+--- a/src/GParted_Core.cc
++++ b/src/GParted_Core.cc
+@@ -72,7 +72,7 @@ GParted_Core::GParted_Core()
+ ped_exception_set_handler( ped_exception_handler ) ;
+
+ //get valid flags ...
+- for ( PedPartitionFlag flag = ped_partition_flag_next( static_cast<PedPartitionFlag>( NULL ) ) ;
++ for ( PedPartitionFlag flag = ped_partition_flag_next( static_cast<PedPartitionFlag>( 0 ) ) ;
+ flag ;
+ flag = ped_partition_flag_next( flag ) )
+ flags .push_back( flag ) ;
+GitLab
diff --git a/sys-block/gparted/gparted-1.3.1.ebuild b/sys-block/gparted/gparted-1.3.1.ebuild
index 1368424f32cc..1119005c1bb3 100644
--- a/sys-block/gparted/gparted-1.3.1.ebuild
+++ b/sys-block/gparted/gparted-1.3.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -35,6 +35,10 @@ BDEPEND="
virtual/pkgconfig
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.3.1-musl-nullptr.patch
+)
+
src_configure() {
gnome2_src_configure \
--enable-doc \
diff --git a/sys-block/gparted/gparted-1.4.0.ebuild b/sys-block/gparted/gparted-1.4.0.ebuild
index 1a1cd973c18d..a209f0a714db 100644
--- a/sys-block/gparted/gparted-1.4.0.ebuild
+++ b/sys-block/gparted/gparted-1.4.0.ebuild
@@ -35,6 +35,10 @@ BDEPEND="
virtual/pkgconfig
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.3.1-musl-nullptr.patch
+)
+
src_configure() {
gnome2_src_configure \
--enable-doc \
reply other threads:[~2022-04-21 23:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1650582765.d1a95e7e586a51f7485fe2db57ffaf62e8333b2f.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox