libfaketime: clean

This commit is contained in:
Guilhem Saurel 2025-06-04 15:47:14 +02:00 committed by Bjørn Forsman
parent 665e4c13be
commit 3c4d0acfe2

View File

@ -7,7 +7,7 @@
coreutils,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "libfaketime";
# 0.9.10 break dict-db-wiktionary and quartus-prime-lite on linux,
# and 0.9.11 break everything on darwin
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "wolfcw";
repo = "libfaketime";
rev = "v${version}";
rev = "v${finalAttrs.version}";
sha256 =
if stdenv.hostPlatform.isDarwin then
"sha256-DYRuQmIhQu0CNEboBAtHOr/NnWxoXecuPMSR/UQ/VIQ="
@ -45,11 +45,10 @@ stdenv.mkDerivation rec {
postPatch = ''
patchShebangs test src
for a in test/functests/test_exclude_mono.sh src/faketime.c ; do
substituteInPlace $a \
--replace-fail /bin/bash ${stdenv.shell}
done
substituteInPlace src/faketime.c --replace-fail @DATE_CMD@ ${coreutils}/bin/date
substituteInPlace test/functests/test_exclude_mono.sh src/faketime.c \
--replace-fail /bin/bash ${stdenv.shell}
substituteInPlace src/faketime.c \
--replace-fail @DATE_CMD@ ${lib.getExe' coreutils "date"}
'';
PREFIX = placeholder "out";
@ -70,12 +69,12 @@ stdenv.mkDerivation rec {
doCheck = true;
meta = with lib; {
meta = {
description = "Report faked system time to programs without having to change the system-wide time";
homepage = "https://github.com/wolfcw/libfaketime/";
license = licenses.gpl2;
platforms = platforms.all;
maintainers = [ maintainers.bjornfor ];
license = lib.licenses.gpl2;
platforms = lib.platforms.all;
maintainers = [ lib.maintainers.bjornfor ];
mainProgram = "faketime";
};
}
})