commit dd5a8efa7c46cabe78801129ca56a1017bd1987a
parent 8aaccda98ff8594ec963d7756b1aa320b03c6b4d
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Wed, 15 Jan 2020 14:44:12 +0300
Add libshell
Diffstat:
3 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/default.nix b/default.nix
@@ -77,6 +77,9 @@ in rec {
inherit (sources) imgp;
};
ish = callPackage ./pkgs/ish { };
+ libshell = callPackage ./pkgs/libshell {
+ inherit (sources) libshell;
+ };
mapsoft = callPackage ./pkgs/mapsoft {
inherit (sources) mapsoft;
};
diff --git a/nix/sources.json b/nix/sources.json
@@ -191,6 +191,18 @@
"url": "https://github.com/jarun/imgp/archive/9a50724cbc97a282ed79476398ab6ff3f6f7339e.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
+ "libshell": {
+ "branch": "master",
+ "description": "A library of shell functions",
+ "homepage": "https://github.com/legionus/libshell",
+ "owner": "legionus",
+ "repo": "libshell",
+ "rev": "b05a238290160d67c4253208b9c9523643c7471a",
+ "sha256": "0xdg1xnkwi70c0q5aw288zr51b1iwvbnjxm0ld1j0smaza7xndad",
+ "type": "tarball",
+ "url": "https://github.com/legionus/libshell/archive/b05a238290160d67c4253208b9c9523643c7471a.tar.gz",
+ "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
+ },
"lsd2dsl": {
"branch": "master",
"description": "Lingvo dictionaries decompiler",
diff --git a/pkgs/libshell/default.nix b/pkgs/libshell/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, dash, help2man, ncurses, scdoc, libshell }:
+
+stdenv.mkDerivation rec {
+ pname = "libshell";
+ version = stdenv.lib.substring 0 7 src.rev;
+ src = libshell;
+
+ nativeBuildInputs = [ help2man scdoc ];
+ buildInputs = [ dash ncurses ];
+
+ postPatch = ''
+ substituteInPlace Makefile \
+ --replace "/usr" ""
+ substituteInPlace utils/Makefile \
+ --replace "/usr" ""
+ substituteInPlace utils/cgrep.in \
+ --replace "/bin/ash" "${dash}/bin/dash"
+ '';
+
+ makeFlags = [ "DESTDIR=$(out)" ];
+
+ doCheck = false;
+
+ meta = with stdenv.lib; {
+ description = libshell.description;
+ homepage = libshell.homepage;
+ license = licenses.gpl2;
+ maintainers = with maintainers; [ sikmir ];
+ platforms = platforms.all;
+ };
+}