1{ lib, stdenv, fetchFromGitHub, autoreconfHook, strace, which }:
2
3stdenv.mkDerivation rec {
4 pname = "libeatmydata";
5 version = "105";
6
7 src = fetchFromGitHub {
8 owner = "stewartsmith";
9 repo = pname;
10 rev = "${pname}-${version}";
11 sha256 = "0sx803h46i81h67xbpd3c7ky0nhaw4gij214nsx4lqig70223v9r";
12 };
13
14 patches = [ ./find-shell-lib.patch ];
15
16 patchFlags = [ "-p0" ];
17
18 postPatch = ''
19 substituteInPlace eatmydata.in \
20 --replace NIX_OUT_DIR $out
21
22 patchShebangs .
23 '';
24
25 nativeBuildInputs = [
26 autoreconfHook
27 ] ++ lib.optionals doCheck [ strace which ];
28
29 # while we can *build* in parallel, the tests also run in parallel which does
30 # not work with v105. Later versions (unreleased) have a fix for that. The
31 # problem is that on hydra we cannot use strace, so the tests don't run there.
32 enableParallelBuilding = true;
33 doCheck = false;
34
35 meta = with lib; {
36 description = "Small LD_PRELOAD library to disable fsync and friends";
37 homepage = "https://www.flamingspork.com/projects/libeatmydata/";
38 license = licenses.gpl3Plus;
39 mainProgram = "eatmydata";
40 platforms = platforms.unix;
41 };
42}