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