lol

datefudge: work correctly even if GNU date is not in PATH (#94045)

* datefudge: work correctly even if GNU date is not in PATH

Examples in manual assumes advanced features from date(1) like "last
Friday", which only available in GNU coreutils version of date(1)
utility. Without this patch, most examples from datefudge(1) manual will
fail in busybox environment, which is confusing.

* Apply suggestions from code review

* Update pkgs/tools/system/datefudge/default.nix

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

authored by

Dmitry Bogatov
Sandro
and committed by
GitHub
f538c07f 6834ca66

+9 -2
+9 -2
pkgs/tools/system/datefudge/default.nix
··· 1 - { lib, stdenv, fetchgit, fetchpatch }: 1 + { stdenv, lib, fetchgit, fetchpatch, makeWrapper, coreutils }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "datefudge"; ··· 9 9 rev = "debian/${version}"; 10 10 sha256 = "1nh433yx4y4djp0bs6aawqbwk7miq7fsbs9wpjlyh2k9dvil2lrm"; 11 11 }; 12 + 13 + nativeBuildInputs = [ makeWrapper ]; 14 + 15 + buildInputs = [ coreutils ]; 12 16 13 17 postPatch = '' 14 18 substituteInPlace Makefile \ ··· 20 24 21 25 installFlags = [ "DESTDIR=$(out)" ]; 22 26 23 - postInstall = "chmod +x $out/lib/datefudge/datefudge.so"; 27 + postInstall = '' 28 + chmod +x $out/lib/datefudge/datefudge.so 29 + wrapProgram $out/bin/datefudge --prefix PATH : ${coreutils}/bin 30 + ''; 24 31 25 32 meta = with lib; { 26 33 description = "Fake the system date";