about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorPeder Bergebakken Sundt <pbsds@hotmail.com>2024-01-18 01:00:08 +0100
committerGitHub <noreply@github.com>2024-01-18 01:00:08 +0100
commit6d20002d9630a63e5ff2b11bd6617f0daf98e256 (patch)
tree5cae8a05cc548fd64c6b43bbf447a0ada2aef09b /pkgs
parent9575c3e3712212b37cd57f7cd88871ba674fa862 (diff)
parent4fb8db4b03e4999dd8aa1b99f107b32caf6b1d8b (diff)
Merge pull request #272535 from atorres1985-contrib/advcpmv
advcpmv: new package
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/by-name/ad/advcpmv/package.nix62
1 files changed, 62 insertions, 0 deletions
diff --git a/pkgs/by-name/ad/advcpmv/package.nix b/pkgs/by-name/ad/advcpmv/package.nix
new file mode 100644
index 0000000000000..ba4caea99cd3b
--- /dev/null
+++ b/pkgs/by-name/ad/advcpmv/package.nix
@@ -0,0 +1,62 @@
+{ coreutils
+, fetchFromGitHub
+}:
+
+let
+  advcpmv-data = {
+    pname = "advcpmv";
+    patch-version = "0.9";
+    coreutils-version = "9.4";
+    version = "${advcpmv-data.patch-version}-${advcpmv-data.coreutils-version}";
+    src = fetchFromGitHub {
+      owner = "jarun";
+      repo = "advcpmv";
+      rev = "a1f8b505e691737db2f7f2b96275802c45f65c59";
+      hash = "sha256-IHfMu6PyGRPc87J/hbxMUdosmLq13K0oWa5fPLWKOvo=";
+    };
+    patch-file = advcpmv-data.src + "/advcpmv-${advcpmv-data.version}.patch";
+  };
+  coreutilsNoSingleBinary = coreutils.override { singleBinary = false; };
+in
+assert (advcpmv-data.coreutils-version == coreutils.version);
+coreutilsNoSingleBinary.overrideAttrs (old: {
+  inherit (advcpmv-data) pname version;
+
+  patches = (old.patches or [ ]) ++ [
+    advcpmv-data.patch-file
+  ];
+
+  outputs = [ "out" ]; # Since we don't need info files
+
+  configureFlags = (old.configureFlags or [ ]) ++ [
+    # To not conflict with regular coreutils
+    "--program-prefix=adv"
+  ];
+
+  # Only cpg and mvg are desired, the others are not touched and therefore can
+  # be removed. Equally, the info directory is removed.
+  postFixup = (old.postFixup or "") + ''
+    rm -rf $out/share/info
+    pushd $out/bin
+    mv advcp cpg
+    mv advmv mvg
+    rm adv*
+    mv cpg advcp
+    mv mvg advmv
+    ln -s advcp cpg
+    ln -s advcp acp
+    ln -s advmv mvg
+    ln -s advmv amv
+    popd
+  '';
+
+  meta = old.meta // {
+    homepage = "https://github.com/jarun/advcpmv";
+    description = "Patched cp and mv from Coreutils that provides progress bars";
+    longDescription = ''
+      Advanced Copy is a mod for the GNU cp and GNU mv tools which adds a
+      progress bar and provides some info on what's going on. It was written by
+      Florian Zwicke and released under the GPL.
+    '';
+  };
+})