2021-03-05 21:23:09 +00:00
|
|
|
{ lib, stdenv, fetchurl, perl, coreutils }:
|
2014-11-02 12:52:39 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "libfaketime";
|
2021-02-23 05:52:49 +00:00
|
|
|
version = "0.9.9";
|
2014-11-02 12:52:39 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-11-15 06:45:50 +00:00
|
|
|
url = "https://github.com/wolfcw/libfaketime/archive/v${version}.tar.gz";
|
2021-02-23 05:52:49 +00:00
|
|
|
sha256 = "sha256-V9AYEVA2HAqbXI7vBbETkvYTStosLZmOkuY9rtY5ZHw=";
|
2014-11-02 12:52:39 +00:00
|
|
|
};
|
|
|
|
|
2014-04-13 13:46:27 +00:00
|
|
|
patches = [
|
|
|
|
./no-date-in-gzip-man-page.patch
|
2021-03-05 21:23:09 +00:00
|
|
|
./nix-store-date.patch
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ (lib.optionals stdenv.cc.isClang [
|
2020-11-25 19:15:00 +00:00
|
|
|
# https://github.com/wolfcw/libfaketime/issues/277
|
|
|
|
./0001-Remove-unsupported-clang-flags.patch
|
|
|
|
]);
|
2014-04-13 13:46:27 +00:00
|
|
|
|
2018-08-08 18:47:05 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs test src
|
|
|
|
for a in test/functests/test_exclude_mono.sh src/faketime.c ; do
|
|
|
|
substituteInPlace $a \
|
|
|
|
--replace /bin/bash ${stdenv.shell}
|
|
|
|
done
|
2021-03-05 21:23:09 +00:00
|
|
|
substituteInPlace src/faketime.c --replace @DATE_CMD@ ${coreutils}/bin/date
|
2018-08-08 18:47:05 +00:00
|
|
|
'';
|
|
|
|
|
2019-05-14 19:57:41 +00:00
|
|
|
PREFIX = placeholder "out";
|
|
|
|
LIBDIRNAME = "/lib";
|
2014-11-02 12:52:39 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=cast-function-type -Wno-error=format-truncation";
|
2019-01-11 06:46:39 +00:00
|
|
|
|
2018-08-08 18:47:05 +00:00
|
|
|
checkInputs = [ perl ];
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2014-11-02 12:52:39 +00:00
|
|
|
description = "Report faked system time to programs without having to change the system-wide time";
|
2017-11-15 06:45:50 +00:00
|
|
|
homepage = "https://github.com/wolfcw/libfaketime/";
|
2014-11-02 12:52:39 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
2021-04-30 13:18:21 +00:00
|
|
|
mainProgram = "faketime";
|
2014-11-02 12:52:39 +00:00
|
|
|
};
|
|
|
|
}
|