1{
2 lib,
3 stdenv,
4 fetchgit,
5 makeWrapper,
6 coreutils,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "datefudge";
11 version = "1.27";
12
13 src = fetchgit {
14 url = "https://salsa.debian.org/debian/${pname}.git";
15 rev = "debian/${version}";
16 hash = "sha256-BN/Ct1FRZjvpkRCPpRlXmjeRvrNnuJBXwwI1P2HCisc=";
17 };
18
19 nativeBuildInputs = [ makeWrapper ];
20
21 buildInputs = [ coreutils ];
22
23 postPatch = ''
24 substituteInPlace Makefile \
25 --replace "/usr" "/" \
26 --replace "-o root -g root" ""
27 substituteInPlace datefudge.sh \
28 --replace "@LIBDIR@" "$out/lib/"
29 '';
30
31 installFlags = [ "DESTDIR=$(out)" ];
32
33 postInstall = ''
34 chmod +x $out/lib/datefudge/datefudge.so
35 wrapProgram $out/bin/datefudge --prefix PATH : ${coreutils}/bin
36 '';
37
38 meta = with lib; {
39 description = "Fake the system date";
40 longDescription = ''
41 datefudge is a small utility that pretends that the system time is
42 different by pre-loading a small library which modifies the time,
43 gettimeofday and clock_gettime system calls.
44 '';
45 homepage = "https://packages.qa.debian.org/d/datefudge.html";
46 license = licenses.gpl2Plus;
47 platforms = platforms.linux;
48 maintainers = with maintainers; [ leenaars ];
49 mainProgram = "datefudge";
50 };
51}