git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #124194 from SuperSandro2000/safe-rm

safe-rm: 0.12 -> 1.1.0

commitaad98166602041da58dc2c48d78f6953f7252165 authorSandro <sandro.jaeckel@gmail.com> dateTue 25 May 2021, 14:48 (5 years ago) parent5c17c488cc310c
1 file changed+16−17
pkgs/tools/system/safe-rm/default.nix+16−17
pkgs/tools/system/safe-rm/default.nix+16−17
@@ -1,37 +1,36 @@
1−{ lib, stdenv, fetchgit, perl, coreutils }:
1+{ lib, rustPlatform, fetchgit, coreutils, installShellFiles }:
22
3−stdenv.mkDerivation rec {
3+rustPlatform.buildRustPackage rec {
44 pname = "safe-rm";
5− version = "0.12";
5+ version = "1.1.0";
66
77 src = fetchgit {
88 url = "https://git.launchpad.net/safe-rm";
99 rev = "refs/tags/${pname}-${version}";
10− sha256 = "0zkmwxyl1870ar6jr9h537vmqgkckqs9jd1yv6m4qqzdsmg5gdbq";
10+ sha256 = "sha256-7+4XwsjzLBCQmHDYNwhlN4Yg3eL43GUEbq8ROtuP2Kw=";
1111 };
1212
13− # pod2man
14− nativeBuildInputs = [ perl ];
13+ cargoSha256 = "sha256-durb4RTzEun7HPeYfvDJpvO+6L7tNFmAxdIwINbwZrg=";
1514
16− propagatedBuildInputs = [ coreutils perl ];
17−
18− postFixup = ''
19− sed -e 's@/bin/rm@${coreutils}/bin/rm@' -i $out/bin/safe-rm
15+ postPatch = ''
16+ substituteInPlace src/main.rs \
17+ --replace "/bin/rm" "${coreutils}/bin/rm"
2018 '';
2119
22− installPhase = ''
23− mkdir -p $out/bin
24− cp safe-rm $out/bin
20+ nativeBuildInputs = [ installShellFiles ];
21+
22+ # uses lots of absolute paths outside of the sandbox
23+ doCheck = false;
2524
26− mkdir -p $out/share/man/man1
27− pod2man safe-rm > $out/share/man/man1/safe-rm.1
25+ postInstall = ''
26+ installManPage safe-rm.1
2827 '';
2928
3029 meta = with lib; {
3130 description = "Tool intended to prevent the accidental deletion of important files";
3231 homepage = "https://launchpad.net/safe-rm";
33− license = licenses.gpl3;
32+ license = licenses.gpl3Plus;
3433 platforms = platforms.all;
35− maintainers = [ maintainers.koral ];
34+ maintainers = with maintainers; [ SuperSandro2000 ];
3635 };
3736}