depot/third_party/nixpkgs/pkgs/by-name/is/isc-cron/package.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

71 lines
1.5 KiB
Nix

{
lib,
fetchurl,
stdenv,
substituteAll,
vim,
sendmailPath ? "/usr/sbin/sendmail",
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cron";
version = "4.1";
src = fetchurl {
url = "ftp://ftp.isc.org/isc/cron/cron_${finalAttrs.version}.shar";
hash = "sha256-xEWDd1b7mI8slduNxV15N9FLygzfopLegTIsolVuw5o=";
};
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)"
];
hardeningEnable = [ "pie" ];
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'
'';
preInstall = ''
mkdir -p $out/{{,s}bin,share/man/man{1,5,8}}
'';
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;
};
})