nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5}:
6
7stdenv.mkDerivation rec {
8 pname = "foremost";
9 version = "1.5.7";
10
11 src = fetchurl {
12 sha256 = "0d2zxw0ijg8cd3ksgm8cf8jg128zr5x7z779jar90g9f47pm882h";
13 url = "https://foremost.sourceforge.net/pkg/${pname}-${version}.tar.gz";
14 };
15
16 patches = [ ./makefile.patch ];
17
18 # -fcommon: Workaround build failure on -fno-common toolchains like upstream
19 # gcc-10. Otherwise build fails as:
20 # ld: api.o:(.bss+0xbdba0): multiple definition of `wildcard'; main.o:(.bss+0xbd760): first defined here
21 env.NIX_CFLAGS_COMPILE = "-fcommon";
22
23 makeFlags = [ "PREFIX=$(out)" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "mac" ];
24
25 enableParallelBuilding = true;
26
27 hardeningDisable = [ "format" ];
28
29 preInstall = ''
30 mkdir -p $out/{bin,share/man/man8}
31 '';
32
33 meta = {
34 description = "Recover files based on their contents";
35 longDescription = ''
36 Foremost is a console program to recover files based on their headers,
37 footers, and internal data structures. Foremost can work on image files, such
38 as those generated by dd, Safeback, Encase, etc, or directly on a drive.
39 The headers and footers can be specified by a configuration file or you can
40 use command line switches to specify built-in file types. These built-in types
41 look at the data structures of a given file format allowing for a more
42 reliable and faster recovery.
43 '';
44 homepage = "https://foremost.sourceforge.net/";
45 license = lib.licenses.publicDomain;
46 maintainers = [ lib.maintainers.jiegec ];
47 platforms = lib.platforms.linux ++ lib.platforms.darwin;
48 mainProgram = "foremost";
49 };
50}