2024-08-23 15:21:44 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchurl,
|
|
|
|
stdenv,
|
|
|
|
substituteAll,
|
|
|
|
vim,
|
|
|
|
sendmailPath ? "/usr/sbin/sendmail",
|
|
|
|
}:
|
2007-01-10 15:44:58 +00:00
|
|
|
|
2024-08-23 15:21:44 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-07-27 14:21:24 +00:00
|
|
|
pname = "cron";
|
|
|
|
version = "4.1";
|
|
|
|
|
2007-01-10 15:44:58 +00:00
|
|
|
src = fetchurl {
|
2024-08-23 15:21:44 +00:00
|
|
|
url = "ftp://ftp.isc.org/isc/cron/cron_${finalAttrs.version}.shar";
|
|
|
|
hash = "sha256-xEWDd1b7mI8slduNxV15N9FLygzfopLegTIsolVuw5o=";
|
2007-01-10 15:44:58 +00:00
|
|
|
};
|
|
|
|
|
2024-08-23 15:21:44 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./0000-nixpkgs-specific.diff;
|
|
|
|
inherit sendmailPath;
|
|
|
|
VIPATH = lib.getExe' vim "vim";
|
|
|
|
DEFPATH = lib.concatStringsSep ":" [
|
|
|
|
"/run/wrappers/bin"
|
|
|
|
"/nix/var/nix/profiles/default/bin"
|
|
|
|
"/run/current-system/sw/bin"
|
|
|
|
"/usr/bin"
|
|
|
|
"/bin"
|
|
|
|
];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"DESTROOT=$(out)"
|
|
|
|
];
|
2007-01-10 15:44:58 +00:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningEnable = [ "pie" ];
|
2016-02-26 17:27:28 +00:00
|
|
|
|
2024-08-23 15:21:44 +00:00
|
|
|
unpackCmd = ''
|
|
|
|
mkdir cron
|
|
|
|
pushd cron
|
|
|
|
sh $curSrc
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
# do not set sticky bit in /nix/store
|
|
|
|
# further, do not strip during install since it breaks on cross-compilation
|
|
|
|
# and we will do this ourselves as needed
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace ' -o root' ' ' \
|
|
|
|
--replace 111 755 \
|
|
|
|
--replace 4755 0755 \
|
|
|
|
--replace ' -s cron' ' cron'
|
2010-10-10 11:07:15 +00:00
|
|
|
'';
|
2007-01-10 15:44:58 +00:00
|
|
|
|
2024-08-23 15:21:44 +00:00
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/{{,s}bin,share/man/man{1,5,8}}
|
|
|
|
'';
|
2015-03-20 15:52:02 +00:00
|
|
|
|
2024-08-23 15:21:44 +00:00
|
|
|
meta = {
|
|
|
|
homepage = "https://ftp.isc.org/isc/cron/";
|
|
|
|
description = "Daemon for running commands at specific times";
|
|
|
|
license = lib.licenses.bsd0;
|
|
|
|
mainProgram = "cron";
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
platforms = lib.platforms.unix;
|
2007-01-10 15:44:58 +00:00
|
|
|
};
|
2024-08-23 15:21:44 +00:00
|
|
|
})
|