2023-07-25 16:12:44 +00:00
|
|
|
{ lib, stdenv, fetchgit, makeWrapper, coreutils }:
|
2016-06-29 21:13:45 +00:00
|
|
|
|
2020-07-26 22:31:07 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2016-06-29 21:13:45 +00:00
|
|
|
pname = "datefudge";
|
2024-10-14 04:16:31 +00:00
|
|
|
version = "1.27";
|
2016-06-29 21:13:45 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
2020-07-26 22:31:07 +00:00
|
|
|
url = "https://salsa.debian.org/debian/${pname}.git";
|
|
|
|
rev = "debian/${version}";
|
2024-10-14 04:16:31 +00:00
|
|
|
hash = "sha256-BN/Ct1FRZjvpkRCPpRlXmjeRvrNnuJBXwwI1P2HCisc=";
|
2016-06-29 21:13:45 +00:00
|
|
|
};
|
|
|
|
|
2021-11-01 20:15:50 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [ coreutils ];
|
|
|
|
|
2020-06-26 12:38:19 +00:00
|
|
|
postPatch = ''
|
2016-06-29 21:13:45 +00:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "/usr" "/" \
|
|
|
|
--replace "-o root -g root" ""
|
|
|
|
substituteInPlace datefudge.sh \
|
|
|
|
--replace "@LIBDIR@" "$out/lib/"
|
2020-06-26 12:38:19 +00:00
|
|
|
'';
|
2016-06-29 21:13:45 +00:00
|
|
|
|
|
|
|
installFlags = [ "DESTDIR=$(out)" ];
|
|
|
|
|
2021-11-01 20:15:50 +00:00
|
|
|
postInstall = ''
|
|
|
|
chmod +x $out/lib/datefudge/datefudge.so
|
|
|
|
wrapProgram $out/bin/datefudge --prefix PATH : ${coreutils}/bin
|
|
|
|
'';
|
2016-06-29 21:13:45 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-29 21:13:45 +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.
|
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://packages.qa.debian.org/d/datefudge.html";
|
2024-04-26 11:35:31 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2016-06-29 21:13:45 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ leenaars ];
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "datefudge";
|
2016-06-29 21:13:45 +00:00
|
|
|
};
|
|
|
|
}
|