2021-01-15 09:19:50 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, bison, flex, pam, perl
|
2017-10-14 21:35:53 +01:00
|
|
|
, sendmailPath ? "/run/wrappers/bin/sendmail"
|
|
|
|
, atWrapperPath ? "/run/wrappers/bin/at"
|
|
|
|
}:
|
2008-04-01 10:08:17 +01:00
|
|
|
|
2017-09-05 12:27:20 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "at";
|
2018-08-31 08:45:14 +01:00
|
|
|
version = "3.1.23";
|
2008-04-01 10:08:17 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
# Debian is apparently the last location where it can be found.
|
2017-09-05 12:27:20 +01:00
|
|
|
url = "mirror://debian/pool/main/a/at/at_${version}.orig.tar.gz";
|
2018-08-31 08:45:14 +01:00
|
|
|
sha256 = "040pr2ivfbrhvrhzis97cpwfkzpr7nin33nc301aga5aajlhlicp";
|
2008-04-01 10:08:17 +01:00
|
|
|
};
|
|
|
|
|
2018-01-04 19:25:13 +00:00
|
|
|
patches = [
|
|
|
|
./install.patch
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://raw.githubusercontent.com/riscv/riscv-poky/master/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch";
|
|
|
|
sha256 = "1rk4hskp0c1jqkanzdxf873i6jgki3xhrm609fsam8an8sl1njnm";
|
|
|
|
})
|
|
|
|
];
|
2008-04-01 10:08:17 +01:00
|
|
|
|
2018-11-16 15:45:08 +00:00
|
|
|
nativeBuildInputs = [ bison flex perl /* for `prove` (tests) */ ];
|
2018-01-04 19:25:13 +00:00
|
|
|
|
|
|
|
buildInputs = [ pam ];
|
2008-04-01 10:08:17 +01:00
|
|
|
|
2009-08-21 00:57:33 +01:00
|
|
|
preConfigure =
|
|
|
|
''
|
2014-09-06 19:10:19 +01:00
|
|
|
export SENDMAIL=${sendmailPath}
|
2009-08-21 00:57:33 +01:00
|
|
|
# Purity: force atd.pid to be placed in /var/run regardless of
|
|
|
|
# whether it exists now.
|
|
|
|
substituteInPlace ./configure --replace "test -d /var/run" "true"
|
|
|
|
'';
|
|
|
|
|
2018-04-25 04:20:18 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-etcdir=/etc/at"
|
|
|
|
"--with-jobdir=/var/spool/atjobs"
|
|
|
|
"--with-atspool=/var/spool/atspool"
|
|
|
|
"--with-daemon_username=atd"
|
|
|
|
"--with-daemon_groupname=atd"
|
|
|
|
];
|
|
|
|
|
2018-11-16 15:45:08 +00:00
|
|
|
doCheck = true;
|
2008-04-01 10:08:17 +01:00
|
|
|
|
2017-10-14 21:35:53 +01:00
|
|
|
# Ensure that "batch" can invoke the setuid "at" wrapper, if it exists, or
|
|
|
|
# else we get permission errors (on NixOS). "batch" is a shell script, so
|
|
|
|
# when the kernel executes it it drops setuid perms.
|
|
|
|
postInstall = ''
|
|
|
|
sed -i "6i test -x ${atWrapperPath} && exec ${atWrapperPath} -qb now # exec doesn't return" "$out/bin/batch"
|
|
|
|
'';
|
|
|
|
|
2008-04-01 10:08:17 +01:00
|
|
|
meta = {
|
2021-01-24 09:19:10 +00:00
|
|
|
description = "The classical Unix `at' job scheduling command";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://packages.qa.debian.org/at";
|
2021-01-15 09:19:50 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2008-04-01 10:08:17 +01:00
|
|
|
};
|
2009-02-13 18:06:25 +00:00
|
|
|
}
|