2022-12-02 08:20:57 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, strace, which }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-05-03 17:38:23 +00:00
|
|
|
pname = "libeatmydata";
|
|
|
|
version = "105";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stewartsmith";
|
|
|
|
repo = pname;
|
|
|
|
rev = "${pname}-${version}";
|
|
|
|
sha256 = "0sx803h46i81h67xbpd3c7ky0nhaw4gij214nsx4lqig70223v9r";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
patches = [
|
|
|
|
./find-shell-lib.patch
|
|
|
|
|
|
|
|
# Fixes "error: redefinition of 'open'" on musl
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://raw.githubusercontent.com/void-linux/void-packages/861ac185a6b60134292ff93d40e40b5391d0aa8e/srcpkgs/libeatmydata/patches/musl.patch";
|
|
|
|
stripLen = 1;
|
|
|
|
sha256 = "sha256-yfMfISbYL7r/R2C9hYPjvGcpUB553QSiW0rMrxG11Oo=";
|
|
|
|
})
|
|
|
|
];
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
patchFlags = [ "-p0" ];
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
2020-05-03 17:38:23 +00:00
|
|
|
substituteInPlace eatmydata.in \
|
|
|
|
--replace NIX_OUT_DIR $out
|
|
|
|
|
|
|
|
patchShebangs .
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals doCheck [ strace which ];
|
2020-05-03 17:38:23 +00:00
|
|
|
|
|
|
|
# while we can *build* in parallel, the tests also run in parallel which does
|
|
|
|
# not work with v105. Later versions (unreleased) have a fix for that. The
|
|
|
|
# problem is that on hydra we cannot use strace, so the tests don't run there.
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Small LD_PRELOAD library to disable fsync and friends";
|
2020-05-03 17:38:23 +00:00
|
|
|
homepage = "https://www.flamingspork.com/projects/libeatmydata/";
|
|
|
|
license = licenses.gpl3Plus;
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "eatmydata";
|
2020-05-03 17:38:23 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|