summary refs log tree commit diff
path: root/pkgs/tools/system/at/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/system/at/default.nix')
-rw-r--r--pkgs/tools/system/at/default.nix36
1 files changed, 27 insertions, 9 deletions
diff --git a/pkgs/tools/system/at/default.nix b/pkgs/tools/system/at/default.nix
index 11a45fbe391..e5eebb727b5 100644
--- a/pkgs/tools/system/at/default.nix
+++ b/pkgs/tools/system/at/default.nix
@@ -5,22 +5,38 @@
 
 stdenv.mkDerivation rec {
   pname = "at";
-  version = "3.1.23";
+  version = "3.2.5";
 
   src = fetchurl {
     # Debian is apparently the last location where it can be found.
     url = "mirror://debian/pool/main/a/at/at_${version}.orig.tar.gz";
-    sha256 = "040pr2ivfbrhvrhzis97cpwfkzpr7nin33nc301aga5aajlhlicp";
+    hash = "sha256-uwZrOJ18m7nYSjVzgDK4XDDLp9lJ91gZKtxyyUd/07g=";
   };
 
   patches = [
-    ./install.patch
+    # Remove glibc assumption
     (fetchpatch {
       url = "https://raw.githubusercontent.com/riscv/riscv-poky/master/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch";
-      sha256 = "1rk4hskp0c1jqkanzdxf873i6jgki3xhrm609fsam8an8sl1njnm";
+      hash = "sha256-1UobqEZWoaq0S8DUDPuI80kTx0Gut2/VxDIwcKeGZOY=";
     })
   ];
 
+  postPatch = ''
+    # Remove chown commands and setuid bit
+    substituteInPlace Makefile.in \
+      --replace ' -o root ' ' ' \
+      --replace ' -g root ' ' ' \
+      --replace ' -o $(DAEMON_USERNAME) ' ' ' \
+      --replace ' -o $(DAEMON_GROUPNAME) ' ' ' \
+      --replace ' -g $(DAEMON_GROUPNAME) ' ' ' \
+      --replace '$(DESTDIR)$(etcdir)' "$out/etc" \
+      --replace '$(DESTDIR)$(ATJOB_DIR)' "$out/var/spool/atjobs" \
+      --replace '$(DESTDIR)$(ATSPOOL_DIR)' "$out/var/spool/atspool" \
+      --replace '$(DESTDIR)$(LFILE)' "$out/var/spool/atjobs/.SEQ" \
+      --replace 'chown' '# skip chown' \
+      --replace '6755' '0755'
+  '';
+
   nativeBuildInputs = [ bison flex perl /* for `prove` (tests) */ ];
 
   buildInputs = [ pam ];
@@ -45,15 +61,17 @@ stdenv.mkDerivation rec {
 
   # 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.
+  # when the kernel executes it drops setuid perms.
   postInstall = ''
     sed -i "6i test -x ${atWrapperPath} && exec ${atWrapperPath} -qb now  # exec doesn't return" "$out/bin/batch"
   '';
 
-  meta = {
+  meta = with lib; {
     description = "The classical Unix `at' job scheduling command";
-    license = lib.licenses.gpl2Plus;
-    homepage = "https://packages.qa.debian.org/at";
-    platforms = lib.platforms.linux;
+    license = licenses.gpl2Plus;
+    homepage = "https://tracker.debian.org/pkg/at";
+    changelog = "https://salsa.debian.org/debian/at/-/raw/master/ChangeLog";
+    platforms = platforms.linux;
+    mainProgram = "at";
   };
 }