commit:     944c89dcba6ac65d0349ebea383d3149e2f03add
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Sat Feb 15 08:35:05 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb 15 15:57:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=944c89dc

sys-fs/f2fs-tools: fix build with C23

Add upstream patch

Closes: https://bugs.gentoo.org/944297
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40580
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-fs/f2fs-tools/f2fs-tools-1.16.0-r2.ebuild      | 62 ++++++++++++++++++++++
 .../f2fs-tools/files/f2fs-tools-1.16.0-c23.patch   | 41 ++++++++++++++
 2 files changed, 103 insertions(+)

diff --git a/sys-fs/f2fs-tools/f2fs-tools-1.16.0-r2.ebuild 
b/sys-fs/f2fs-tools/f2fs-tools-1.16.0-r2.ebuild
new file mode 100644
index 000000000000..68457da3ba7e
--- /dev/null
+++ b/sys-fs/f2fs-tools/f2fs-tools-1.16.0-r2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic
+
+DESCRIPTION="Tools for Flash-Friendly File System (F2FS)"
+HOMEPAGE="https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/about/";
+if [[ ${PV} == *9999 ]]; then
+       inherit git-r3
+       
EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/${PN}.git";
+       EGIT_BRANCH="dev"
+else
+       
SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/${PN}.git/snapshot/${P}.tar.gz";
+       KEYWORDS="~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0/10"
+IUSE="lz4 lzo selinux"
+
+RDEPEND="
+       lz4? ( app-arch/lz4:= )
+       lzo? ( dev-libs/lzo:2 )
+       sys-apps/util-linux
+       selinux? ( sys-libs/libselinux )
+       elibc_musl? ( sys-libs/queue-standalone )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-musl-1.2.4-lfs.patch
+       "${FILESDIR}"/${P}-c23.patch
+)
+
+src_prepare() {
+       default
+       eautoreconf
+}
+
+src_configure() {
+       # -Werror=lto-type-mismatch
+       # https://bugs.gentoo.org/863896
+       # Sent an email to linux-f2fs-devel@ but it hasn't been accepted yet...
+       filter-lto
+
+       local myconf=(
+               # This is required to install to /sbin, bug #481110
+               --bindir="${EPREFIX}"/sbin
+               $(use_with lz4)
+               $(use_with lzo lzo2)
+               $(use_with selinux)
+       )
+
+       econf "${myconf[@]}"
+}
+
+src_install() {
+       default
+       find "${ED}" -name "*.la" -delete || die
+}

diff --git a/sys-fs/f2fs-tools/files/f2fs-tools-1.16.0-c23.patch 
b/sys-fs/f2fs-tools/files/f2fs-tools-1.16.0-c23.patch
new file mode 100644
index 000000000000..272a6bf81b28
--- /dev/null
+++ b/sys-fs/f2fs-tools/files/f2fs-tools-1.16.0-c23.patch
@@ -0,0 +1,41 @@
+https://bugs.gentoo.org/944297
+https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?id=6617d15a660becc23825007ab3fc2d270b5b250f
+
+From 6617d15a660becc23825007ab3fc2d270b5b250f Mon Sep 17 00:00:00 2001
+From: Jaegeuk Kim <[email protected]>
+Date: Thu, 24 Oct 2024 20:33:38 +0000
+Subject: f2fs-tools: use stdbool.h instead of bool
+
+The existing bool definition is broken for c23, where bool is now a keyword.
+
+Signed-off-by: Elliott Hughes <[email protected]>
+Signed-off-by: Jaegeuk Kim <[email protected]>
+---
+ include/f2fs_fs.h | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
+index 9534da9..0cb9228 100644
+--- a/include/f2fs_fs.h
++++ b/include/f2fs_fs.h
+@@ -28,6 +28,7 @@
+ #include <stddef.h>
+ #include <string.h>
+ #include <time.h>
++#include <stdbool.h>
+ 
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+@@ -119,9 +120,6 @@ typedef uint16_t   u16;
+ typedef uint8_t               u8;
+ typedef u32           block_t;
+ typedef u32           nid_t;
+-#ifndef bool
+-typedef u8            bool;
+-#endif
+ typedef unsigned long pgoff_t;
+ typedef unsigned short        umode_t;
+ 
+-- 
+cgit 1.2.3-korg
+

Reply via email to