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";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "1.26";
|
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}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-CVy5mOX3jNM1cNIn8HhVs8Mhh70pkz9pG08muFuPNfk=";
|
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";
|
2024-05-15 15:35:15 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ leenaars ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "datefudge";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|