2023-08-04 22:07:22 +00:00
|
|
|
{ lib, stdenv, fetchgit, makeWrapper, coreutils }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "datefudge";
|
2020-08-20 17:08:02 +00:00
|
|
|
version = "1.24";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
2020-08-20 17:08:02 +00:00
|
|
|
url = "https://salsa.debian.org/debian/${pname}.git";
|
|
|
|
rev = "debian/${version}";
|
|
|
|
sha256 = "1nh433yx4y4djp0bs6aawqbwk7miq7fsbs9wpjlyh2k9dvil2lrm";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [ coreutils ];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "/usr" "/" \
|
|
|
|
--replace "-o root -g root" ""
|
|
|
|
substituteInPlace datefudge.sh \
|
|
|
|
--replace "@LIBDIR@" "$out/lib/"
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installFlags = [ "DESTDIR=$(out)" ];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postInstall = ''
|
|
|
|
chmod +x $out/lib/datefudge/datefudge.so
|
|
|
|
wrapProgram $out/bin/datefudge --prefix PATH : ${coreutils}/bin
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Fake the system date";
|
|
|
|
longDescription = ''
|
|
|
|
datefudge is a small utility that pretends that the system time is
|
|
|
|
different by pre-loading a small library which modifies the time,
|
|
|
|
gettimeofday and clock_gettime system calls.
|
|
|
|
'';
|
|
|
|
homepage = "https://packages.qa.debian.org/d/datefudge.html";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ leenaars ];
|
|
|
|
};
|
|
|
|
}
|