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