2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "foremost";
|
|
|
|
version = "1.5.7";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
sha256 = "0d2zxw0ijg8cd3ksgm8cf8jg128zr5x7z779jar90g9f47pm882h";
|
2023-02-02 18:25:31 +00:00
|
|
|
url = "https://foremost.sourceforge.net/pkg/${pname}-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./makefile.patch ];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# -fcommon: Workaround build failure on -fno-common toolchains like upstream
|
|
|
|
# gcc-10. Otherwise build fails as:
|
|
|
|
# ld: api.o:(.bss+0xbdba0): multiple definition of `wildcard'; main.o:(.bss+0xbd760): first defined here
|
|
|
|
NIX_CFLAGS_COMPILE = "-fcommon";
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ] ++ lib.optionals stdenv.isDarwin [ "mac" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/{bin,share/man/man8}
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Recover files based on their contents";
|
|
|
|
longDescription = ''
|
|
|
|
Foremost is a console program to recover files based on their headers,
|
|
|
|
footers, and internal data structures. Foremost can work on image files, such
|
|
|
|
as those generated by dd, Safeback, Encase, etc, or directly on a drive.
|
|
|
|
The headers and footers can be specified by a configuration file or you can
|
|
|
|
use command line switches to specify built-in file types. These built-in types
|
|
|
|
look at the data structures of a given file format allowing for a more
|
|
|
|
reliable and faster recovery.
|
|
|
|
'';
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://foremost.sourceforge.net/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.publicDomain;
|
2022-08-21 13:32:41 +00:00
|
|
|
maintainers = [ maintainers.jiegec ];
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|