1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchpatch,
6 file,
7 libuuid,
8 e2fsprogs,
9 zlib,
10 bzip2,
11}:
12
13stdenv.mkDerivation rec {
14 version = "0.3.2";
15 pname = "ext4magic";
16
17 src = fetchurl {
18 url = "mirror://sourceforge/ext4magic/${pname}-${version}.tar.gz";
19 sha256 = "8d9c6a594f212aecf4eb5410d277caeaea3adc03d35378257dfd017ef20ea115";
20 };
21
22 patches = [
23 (fetchpatch {
24 url = "https://sourceforge.net/p/ext4magic/tickets/10/attachment/ext4magic-0.3.2-i_dir_acl.patch";
25 hash = "sha256-DHXjDQ+kT6uLuPb7ODRHfeRRYVxO5OiRafHFiVrzjKk=";
26 })
27 ./glibc-fix.patch
28 (fetchpatch {
29 url = "https://salsa.debian.org/pkg-security-team/ext4magic/-/raw/0e52341dbe8681a6e1a59d902e5e33ec13be1cbe/debian/patches/fix-segfault-extent-free.patch";
30 hash = "sha256-MI363/E676E8ZH41k/XnQ2kdWzKAp5uQF/h2FN7X/x8=";
31 })
32 ];
33
34 buildInputs = [
35 file
36 libuuid
37 e2fsprogs
38 zlib
39 bzip2
40 ];
41 installFlags = [ "PREFIX=$(out)" ];
42
43 meta = with lib; {
44 description = "Recover / undelete files from ext3 or ext4 partitions";
45 longDescription = ''
46 ext4magic can recover/undelete files from ext3 or ext4 partitions
47 by retrieving file-information from the filesystem journal.
48
49 If the information in the journal are sufficient, ext4magic can
50 recover the most file types, with original filename, owner and group,
51 file mode bits and also the old atime/mtime stamps.
52
53 It's much more effective and works much better than extundelete.
54 '';
55 homepage = "https://ext4magic.sourceforge.net/ext4magic_en.html";
56 license = licenses.gpl2Plus;
57 platforms = platforms.linux;
58 maintainers = [ maintainers.rkoe ];
59 mainProgram = "ext4magic";
60 };
61}