Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub, fetchpatch, 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 = [
15 ./find-shell-lib.patch
16
17 # Fixes "error: redefinition of 'open'" on musl
18 (fetchpatch {
19 url = "https://raw.githubusercontent.com/void-linux/void-packages/861ac185a6b60134292ff93d40e40b5391d0aa8e/srcpkgs/libeatmydata/patches/musl.patch";
20 stripLen = 1;
21 sha256 = "sha256-yfMfISbYL7r/R2C9hYPjvGcpUB553QSiW0rMrxG11Oo=";
22 })
23 ];
24
25 patchFlags = [ "-p0" ];
26
27 postPatch = ''
28 substituteInPlace eatmydata.in \
29 --replace NIX_OUT_DIR $out
30
31 patchShebangs .
32 '';
33
34 nativeBuildInputs = [
35 autoreconfHook
36 ] ++ lib.optionals doCheck [ strace which ];
37
38 # while we can *build* in parallel, the tests also run in parallel which does
39 # not work with v105. Later versions (unreleased) have a fix for that. The
40 # problem is that on hydra we cannot use strace, so the tests don't run there.
41 enableParallelBuilding = true;
42 doCheck = false;
43
44 meta = with lib; {
45 description = "Small LD_PRELOAD library to disable fsync and friends";
46 homepage = "https://www.flamingspork.com/projects/libeatmydata/";
47 license = licenses.gpl3Plus;
48 mainProgram = "eatmydata";
49 platforms = platforms.unix;
50 };
51}