diff options
Diffstat (limited to 'sys-fs/ext4magic')
-rw-r--r-- | sys-fs/ext4magic/Manifest | 2 | ||||
-rw-r--r-- | sys-fs/ext4magic/ext4magic-0.3.2-r2.ebuild | 37 | ||||
-rw-r--r-- | sys-fs/ext4magic/files/ext4magic-0.3.2-fix-sys-types-h.patch | 183 |
3 files changed, 222 insertions, 0 deletions
diff --git a/sys-fs/ext4magic/Manifest b/sys-fs/ext4magic/Manifest index 59f986aac3ec..757de74e9869 100644 --- a/sys-fs/ext4magic/Manifest +++ b/sys-fs/ext4magic/Manifest @@ -1,5 +1,7 @@ +AUX ext4magic-0.3.2-fix-sys-types-h.patch 6218 BLAKE2B 2e8fc739e44dc294d52df1a0c8ef0d3e14b72f17f63cbb29dccf0dc9c936427bbcc6474fa870d91993c5566a7c8a40c40ed0e27b898af9ece9519fa45bac002d SHA512 c275029f97e49a5b4f010472686f7a7b7db16027164bc02a19787678c2e352a36b8af4b13c0dbe1fc0a9537346087e32e969913e4062c018f3de88fc65a63ea9 AUX ext4magic-0.3.2-i_dir_acl.patch 1541 BLAKE2B 97a1fe34351bba96baaa963455561342a3fdbd7d0279bff9a544305f7d8d71d89f14c2f24d2246527a6eea9424e55b314ccc0c06f5edd367c7c4176f3509aa03 SHA512 d0df0f7275f6fa94d58658af9d96f059ae3bc29d47e767ee943a03b698550e52a5f9ff8ce491e617a47a2cf80ebcf20416dc54e3d0019713f387cffa2621904d AUX ext4magic-0.3.2-sysmacros.patch 291 BLAKE2B ef3e5d23d4438a72f090e776cf0a6019361c100f502b9ac23afb11446f82b720e5564095720acca7ba6816a8d5b08628bb4d2011736e0bad028d5d417a3b6936 SHA512 9914c9db3876194b08fe2f9752c0f49f72e88a5bbead72095dc186a3c60eef7a29326d51624381f177d31ee50ad4f9076dbef755936770fbfdf55fa7be82ab35 DIST ext4magic-0.3.2.tar.gz 426941 BLAKE2B 7123af6a928e606980efba85e4c4b1f9284776176c4d5a2f978a4fb1639f68ebe3fccc07c972baeee661b2d26940b8dd252024b515e26bad7ed8635434288dfc SHA512 81bc9ba40dc2ea0bfb01bec160a1bbf0bf8a7983241aba34190d3571386f4d7dc63409866737b8d64516a3594eba11c819bbb721a1942c0a675d5675a7bba9a1 EBUILD ext4magic-0.3.2-r1.ebuild 954 BLAKE2B 8525e8d294487b35690d22bda8f1680344a05eaa67e1af473b211e07fe535091e58da766471e707d605f09a6035b6bdf90801d3f803caeeef1be5798ade00685 SHA512 c44a44ca5412c00c4da5688924f91abb74a02af18adaf02a816de51d075610a2781508ac9abd5a5732025d0effc53c05761d0d92e03c05c14286a0d003d989b0 +EBUILD ext4magic-0.3.2-r2.ebuild 1024 BLAKE2B bb57eab3360a9bf94ffc96548419624ff27f4164db5d0ddd7b925637112b4904bfdade66423337c91f13fcae19a4c9b518c612d04435cfcb88c9afee855afd15 SHA512 5e9cd8f8c6b532708f3ab5f437ca856f8d9284f1d633ecbee9ff5d763bfea134009315c3870a62140cbba35d9137a4e6797a71bb3f4984099bcd5def7f4966e6 MISC metadata.xml 579 BLAKE2B 9647068a5cee73429829ef5caa748e9ad4a3312168af65d8f14ccde66afdd827db6e099b7dad3ad80a8c199aa15e797c5a7f7c680181e0f9fb74a5eb37d094e3 SHA512 9befd5850655d891b50df839d905ea2ee2a5c8999af7e1da72cf06b5f4eedb5a4db1f7b3accb8f436c390da26e343c1af472e0253e947b040b83f7ef8afa6005 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 + |