2022-01-03 16:56:52 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, perl, coreutils }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libfaketime";
|
2021-02-24 18:30:23 +00:00
|
|
|
version = "0.9.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wolfcw";
|
|
|
|
repo = "libfaketime";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-P1guVggteGtoq8+eeE966hDPkRwsn0m7oLCohyPrIb4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./no-date-in-gzip-man-page.patch
|
2021-03-09 03:18:52 +00:00
|
|
|
./nix-store-date.patch
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ (lib.optionals stdenv.cc.isClang [
|
2020-11-30 08:33:03 +00:00
|
|
|
# https://github.com/wolfcw/libfaketime/issues/277
|
|
|
|
./0001-Remove-unsupported-clang-flags.patch
|
|
|
|
]);
|
2020-04-24 23:36:52 +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-09 03:18:52 +00:00
|
|
|
substituteInPlace src/faketime.c --replace @DATE_CMD@ ${coreutils}/bin/date
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
PREFIX = placeholder "out";
|
|
|
|
LIBDIRNAME = "/lib";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=cast-function-type -Wno-error=format-truncation";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ perl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Report faked system time to programs without having to change the system-wide time";
|
|
|
|
homepage = "https://github.com/wolfcw/libfaketime/";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
2021-05-03 20:48:10 +00:00
|
|
|
mainProgram = "faketime";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|