public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-fs/ext4magic/, sys-fs/ext4magic/files/
@ 2016-04-19  6:29 Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2016-04-19  6:29 UTC (permalink / raw
  To: gentoo-commits

commit:     029e17b98f838bdf8d1c6c1b89946db6dd63d2fe
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 19 06:28:57 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Apr 19 06:28:57 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=029e17b9

sys-fs/ext4magic: fix building w/newer glibc #580192

 sys-fs/ext4magic/ext4magic-0.3.2.ebuild                |  4 ++++
 sys-fs/ext4magic/files/ext4magic-0.3.2-sysmacros.patch | 13 +++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/sys-fs/ext4magic/ext4magic-0.3.2.ebuild b/sys-fs/ext4magic/ext4magic-0.3.2.ebuild
index 3c16018..a7f2b13 100644
--- a/sys-fs/ext4magic/ext4magic-0.3.2.ebuild
+++ b/sys-fs/ext4magic/ext4magic-0.3.2.ebuild
@@ -24,6 +24,10 @@ DEPEND="${RDEPEND}"
 
 DOCS="AUTHORS ChangeLog NEWS README TODO"
 
+src_prepare() {
+	epatch "${FILESDIR}"/${P}-sysmacros.patch #580192
+}
+
 src_configure() {
 	# build-system incorrectly recognizes '--disable-feature' options as enabled!
 	econf \

diff --git a/sys-fs/ext4magic/files/ext4magic-0.3.2-sysmacros.patch b/sys-fs/ext4magic/files/ext4magic-0.3.2-sysmacros.patch
new file mode 100644
index 0000000..954d961
--- /dev/null
+++ b/sys-fs/ext4magic/files/ext4magic-0.3.2-sysmacros.patch
@@ -0,0 +1,13 @@
+https://sourceforge.net/p/ext4magic/tickets/4/
+https://bugs.gentoo.org/580192
+
+--- a/src/recover.c
++++ b/src/recover.c
+@@ -21,6 +21,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <sys/stat.h> 
++#include <sys/sysmacros.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <utime.h>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/ext4magic/, sys-fs/ext4magic/files/
@ 2018-04-04 12:08 Göktürk Yüksek
  0 siblings, 0 replies; 3+ messages in thread
From: Göktürk Yüksek @ 2018-04-04 12:08 UTC (permalink / raw
  To: gentoo-commits

commit:     9d427990c39a9ab3cf97b6feb243e9f28620f79c
Author:     Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  4 12:07:03 2018 +0000
Commit:     Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
CommitDate: Wed Apr  4 12:08:32 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d427990

sys-fs/ext4magic: fix #650074

Also bump EAPI and enable USE=expert_mode by default.

Bug: https://sourceforge.net/p/ext4magic/tickets/10/
Closes: https://bugs.gentoo.org/650074
Package-Manager: Portage-2.3.27, Repoman-2.3.9

 sys-fs/ext4magic/ext4magic-0.3.2-r1.ebuild         | 36 ++++++++++++++++++++++
 .../files/ext4magic-0.3.2-i_dir_acl.patch          | 32 +++++++++++++++++++
 2 files changed, 68 insertions(+)

diff --git a/sys-fs/ext4magic/ext4magic-0.3.2-r1.ebuild b/sys-fs/ext4magic/ext4magic-0.3.2-r1.ebuild
new file mode 100644
index 00000000000..f26ce3b1d1d
--- /dev/null
+++ b/sys-fs/ext4magic/ext4magic-0.3.2-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Tool for recovery of deleted or overwritten files on ext3/ext4 filesystems"
+HOMEPAGE="https://sourceforge.net/projects/ext4magic/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug +expert-mode file-attr"
+
+RDEPEND="app-arch/bzip2
+	>=sys-apps/file-5.04
+	sys-apps/util-linux
+	>=sys-fs/e2fsprogs-1.41.9
+	sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+DOCS="AUTHORS ChangeLog NEWS README TODO"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.3.2-sysmacros.patch
+	"${FILESDIR}"/${PN}-0.3.2-i_dir_acl.patch
+)
+
+src_configure() {
+	# build-system incorrectly recognizes '--disable-feature' options as enabled!
+	econf \
+		$(usex debug '--enable-debug' '') \
+		$(usex debug '--enable-debug-magic' '') \
+		$(usex expert-mode '--enable-expert-mode' '') \
+		$(usex file-attr '--enable-file-attr' '')
+}

diff --git a/sys-fs/ext4magic/files/ext4magic-0.3.2-i_dir_acl.patch b/sys-fs/ext4magic/files/ext4magic-0.3.2-i_dir_acl.patch
new file mode 100644
index 00000000000..9c7e86a2af1
--- /dev/null
+++ b/sys-fs/ext4magic/files/ext4magic-0.3.2-i_dir_acl.patch
@@ -0,0 +1,32 @@
+From: Gokturk Yuksek <gokturk@gentoo.org>
+Subject: [PATCH] src/inode: supersede i_dir_acl with i_size_high
+
+The upstream has removed the macro that defined i_dir_acl as
+i_size_high which causes a build failure with the later versions of
+e2fsprogs. Replace every reference to inode->i_dir_acl with
+inode->i_size_high.
+
+Bug: https://bugs.gentoo.org/650074
+Bug: https://sourceforge.net/p/ext4magic/tickets/10/
+
+[0] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=578fcbfd2e61e0b13ce8c7b62804c941d6c1eb8e
+
+--- a/src/inode.c
++++ b/src/inode.c
+@@ -404,14 +404,14 @@
+         fprintf(out,
+                         "%sFile ACL: %d    Directory ACL: %d Translator: %d\n",
+                         prefix,
+-                        inode->i_file_acl, LINUX_S_ISDIR(inode->i_mode) ? inode->i_dir_acl : 0,
++                        inode->i_file_acl, LINUX_S_ISDIR(inode->i_mode) ? inode->i_size_high : 0,
+                         inode->osd1.hurd1.h_i_translator);
+         else
+                 fprintf(out, "%sFile ACL: %llu    Directory ACL: %d\n",
+                         prefix,
+                         inode->i_file_acl | ((long long)
+                                 (inode->osd2.linux2.l_i_file_acl_high) << 32),
+-                        LINUX_S_ISDIR(inode->i_mode) ? inode->i_dir_acl : 0);
++                        LINUX_S_ISDIR(inode->i_mode) ? inode->i_size_high : 0);
+         if (os == EXT2_OS_LINUX)
+                 fprintf(out, "%sLinks: %d   Blockcount: %llu\n",
+                         prefix, inode->i_links_count,


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-fs/ext4magic/, sys-fs/ext4magic/files/
@ 2024-01-08  3:34 Göktürk Yüksek
  0 siblings, 0 replies; 3+ messages in thread
From: Göktürk Yüksek @ 2024-01-08  3:34 UTC (permalink / raw
  To: gentoo-commits

commit:     6df45df54e7fd8e2c9151d333b5404dc88b9e96e
Author:     Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  8 03:22:27 2024 +0000
Commit:     Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
CommitDate: Mon Jan  8 03:33:37 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6df45df5

sys-fs/ext4magic: fix building with musl #716136

Also update EAPI 6 -> 8, and update LICENSES.

Closes: https://bugs.gentoo.org/716136
Signed-off-by: Göktürk Yüksek <gokturk <AT> gentoo.org>

 sys-fs/ext4magic/ext4magic-0.3.2-r2.ebuild         |  37 +++++
 .../files/ext4magic-0.3.2-fix-sys-types-h.patch    | 183 +++++++++++++++++++++
 2 files changed, 220 insertions(+)

diff --git a/sys-fs/ext4magic/ext4magic-0.3.2-r2.ebuild b/sys-fs/ext4magic/ext4magic-0.3.2-r2.ebuild
new file mode 100644
index 000000000000..1ddc9bc13dec
--- /dev/null
+++ b/sys-fs/ext4magic/ext4magic-0.3.2-r2.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Tool for recovery of deleted or overwritten files on ext3/ext4 filesystems"
+HOMEPAGE="https://sourceforge.net/projects/ext4magic/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD-2 FSFAP GPL-2 GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="debug +expert-mode file-attr"
+
+RDEPEND="app-arch/bzip2
+	>=sys-apps/file-5.04
+	sys-apps/util-linux
+	>=sys-fs/e2fsprogs-1.41.9
+	sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+DOCS="AUTHORS ChangeLog NEWS README TODO"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.3.2-sysmacros.patch
+	"${FILESDIR}"/${PN}-0.3.2-i_dir_acl.patch
+	"${FILESDIR}"/${PN}-0.3.2-fix-sys-types-h.patch
+)
+
+src_configure() {
+	# build-system incorrectly recognizes '--disable-feature' options as enabled!
+	econf \
+		$(usex debug '--enable-debug' '') \
+		$(usex debug '--enable-debug-magic' '') \
+		$(usex expert-mode '--enable-expert-mode' '') \
+		$(usex file-attr '--enable-file-attr' '')
+}

diff --git a/sys-fs/ext4magic/files/ext4magic-0.3.2-fix-sys-types-h.patch b/sys-fs/ext4magic/files/ext4magic-0.3.2-fix-sys-types-h.patch
new file mode 100644
index 000000000000..f1e1d1c91716
--- /dev/null
+++ b/sys-fs/ext4magic/files/ext4magic-0.3.2-fix-sys-types-h.patch
@@ -0,0 +1,183 @@
+From 22960546489285b03857609c5c3f6c25ae91a6cd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?G=C3=B6kt=C3=BCrk=20Y=C3=BCksek?= <gokturk@gentoo.org>
+Date: Sun, 7 Jan 2024 16:59:09 -0800
+Subject: [PATCH 1/1] Include config.h in various files before any other
+ include statements
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is an indirect way to fix a compilation failure with musl
+libc. Glibc includes sys/stat.h as part of stdlib.h[1], which
+eventually typedefs dev_t[2]. Musl libc doesn't seem to pull that in
+like glibc does. The header file ext2fs.h uses dev_t in some of its
+function signatures[3], but the inclusion of sys/types.h is guarded by
+the macro `#ifdef HAVE_SYS_TYPES_H`[4].
+
+So every time ext4magic tries to include ext2fs.h while building with musl, it fails with:
+
+```
+In file included from hard_link_stack.h:23,
+from hard_link_stack.c:25:
+/usr/include/ext2fs/ext2fs.h:1402:39: error: unknown type name 'dev_t'; did you mean 'div_t'?
+1402 | extern char *ext2fs_find_block_device(dev_t device);
+|                                       ^~~~~
+|                                       div_t
+/usr/include/ext2fs/ext2fs.h:1822:62: error: unknown type name 'mode_t'
+1822 | extern int ext2fs_open_file(const char *pathname, int flags, mode_t mode);
+|                                                              ^~~~~~
+make[2]: *** [Makefile:467: ext4magic-hard_link_stack.o] Error 1
+```
+
+Autoconf actually declares HAVE_SYS_TYPES_H during ext4magic build, we
+just need to include config.h in the relevant C files so that the
+macro propagates. The alternative would be to pass -DHAVE_SYS_TYPES_H
+to gcc but that solution seems more of a hack compared to including
+config.h as it's meant to be included.
+
+[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=include/stdlib.h;h=580da9be15adf0c1034986f62dd89aaaf6498c3f;hb=HEAD#l20
+[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=io/sys/stat.h;h=1fa6d6e62ecb2e4b4f0039d0154307a6c27e3fa9;hb=HEAD#l40
+[3] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/lib/ext2fs/ext2fs.h#n1402
+[4] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/lib/ext2fs/ext2fs.h#n68
+
+Bug: https://bugs.gentoo.org/716136
+Signed-off-by: Göktürk Yüksek <gokturk@gentoo.org>
+---
+ src/block.c            | 4 ++++
+ src/file_type.c        | 5 +++++
+ src/hard_link_stack.c  | 4 ++++
+ src/imap_search.c      | 4 ++++
+ src/inode.c            | 5 +++++
+ src/lookup_local.c     | 5 +++++
+ src/magic_block_scan.c | 5 +++++
+ src/util.c             | 5 +++++
+ 8 files changed, 37 insertions(+)
+
+diff --git a/src/block.c b/src/block.c
+index 84fc1bb..4681d8e 100644
+--- a/src/block.c
++++ b/src/block.c
+@@ -12,6 +12,10 @@
+  * %End-Header%
+  */
+ 
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ /*
+  This is a workaround to allow compilation, but the one line that uses
+  this constant will never run because we open the fs read-only.
+diff --git a/src/file_type.c b/src/file_type.c
+index a1396c1..cf1790a 100644
+--- a/src/file_type.c
++++ b/src/file_type.c
+@@ -17,6 +17,11 @@
+  *                                                                         *
+  *   C Implementation: file_type                                           *
+  ***************************************************************************/
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+diff --git a/src/hard_link_stack.c b/src/hard_link_stack.c
+index abef55e..df7666f 100644
+--- a/src/hard_link_stack.c
++++ b/src/hard_link_stack.c
+@@ -16,6 +16,10 @@
+  *   along with this program; if not, see <http://www.gnu.org/licenses/>.  *
+  ***************************************************************************/
+ 
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ //construct for global collect of hardlinks
+ 
+ #include <stdio.h>
+diff --git a/src/imap_search.c b/src/imap_search.c
+index 3c9c180..b8025c9 100644
+--- a/src/imap_search.c
++++ b/src/imap_search.c
+@@ -19,6 +19,10 @@
+  * C Implementation: imap_search                                           *
+  ***************************************************************************/
+ 
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ //header  util.h
+ 
+ #include "util.h"
+diff --git a/src/inode.c b/src/inode.c
+index 5cbf52e..db8c915 100644
+--- a/src/inode.c
++++ b/src/inode.c
+@@ -15,6 +15,11 @@
+  *   You should have received a copy of the GNU General Public License     *
+  *   along with this program; if not, see <http://www.gnu.org/licenses/>.  *
+  ***************************************************************************/
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+diff --git a/src/lookup_local.c b/src/lookup_local.c
+index c566809..9dcd8aa 100644
+--- a/src/lookup_local.c
++++ b/src/lookup_local.c
+@@ -15,6 +15,11 @@
+  *   You should have received a copy of the GNU General Public License     *
+  *   along with this program; if not, see <http://www.gnu.org/licenses/>.  *
+  ***************************************************************************/
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ //header  util.h
+ 
+ #include <stdio.h>
+diff --git a/src/magic_block_scan.c b/src/magic_block_scan.c
+index 000cf80..d0844e1 100644
+--- a/src/magic_block_scan.c
++++ b/src/magic_block_scan.c
+@@ -18,6 +18,11 @@
+  *                                                                         *
+  *   C Implementation: magic_block_scan                                    * 
+  ***************************************************************************/
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+diff --git a/src/util.c b/src/util.c
+index b148baa..99a58fc 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -15,6 +15,11 @@
+  *   You should have received a copy of the GNU General Public License     *
+  *   along with this program; if not, see <http://www.gnu.org/licenses/>.  *
+  ***************************************************************************/
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+-- 
+2.43.0
+


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-08  3:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-04 12:08 [gentoo-commits] repo/gentoo:master commit in: sys-fs/ext4magic/, sys-fs/ext4magic/files/ Göktürk Yüksek
  -- strict thread matches above, loose matches on Subject: below --
2024-01-08  3:34 Göktürk Yüksek
2016-04-19  6:29 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox