1 { lib, stdenv, fetchFromGitHub, fetchpatch, perl, coreutils }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 sha256 = "sha256-DYRuQmIhQu0CNEboBAtHOr/NnWxoXecuPMSR/UQ/VIQ=";
15 ./nix-store-date.patch
17 name = "0001-libfaketime.c-wrap-timespec_get-in-TIME_UTC-macro.patch";
18 url = "https://github.com/wolfcw/libfaketime/commit/e0e6b79568d36a8fd2b3c41f7214769221182128.patch";
19 sha256 = "sha256-KwwP76v0DXNW73p/YBvwUOPdKMAcVdbQSKexD/uFOYo=";
21 ] ++ (lib.optionals stdenv.cc.isClang [
22 # https://github.com/wolfcw/libfaketime/issues/277
23 ./0001-Remove-unsupported-clang-flags.patch
27 patchShebangs test src
28 for a in test/functests/test_exclude_mono.sh src/faketime.c ; do
29 substituteInPlace $a \
30 --replace /bin/bash ${stdenv.shell}
32 substituteInPlace src/faketime.c --replace @DATE_CMD@ ${coreutils}/bin/date
35 PREFIX = placeholder "out";
38 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=cast-function-type -Wno-error=format-truncation";
40 nativeCheckInputs = [ perl ];
43 description = "Report faked system time to programs without having to change the system-wide time";
44 homepage = "https://github.com/wolfcw/libfaketime/";
45 license = licenses.gpl2;
46 platforms = platforms.all;
47 maintainers = [ maintainers.bjornfor ];
48 mainProgram = "faketime";