default.nix (1163B)
1 { lib 2 , stdenv 3 , fetchFromGitHub 4 , bash 5 , dash 6 , help2man 7 , ncurses 8 , withDoc ? false 9 , scdoc 10 }: 11 12 stdenv.mkDerivation (finalAttrs: { 13 pname = "libshell"; 14 version = "0.4.11"; 15 16 src = fetchFromGitHub { 17 owner = "legionus"; 18 repo = "libshell"; 19 rev = "v${finalAttrs.version}"; 20 hash = "sha256-ZUsCuian4FaSg4wa2fHbNiGnjvy5BpPveXX/5GihsQY="; 21 }; 22 23 nativeBuildInputs = [ help2man ]; 24 25 postPatch = '' 26 substituteInPlace Makefile --replace "/usr" "" 27 substituteInPlace utils/Makefile --replace "/usr" "" 28 substituteInPlace utils/cgrep.in --replace "/bin/ash" "${dash}/bin/dash" 29 substituteInPlace shell-terminfo --replace "tput" "${ncurses}/bin/tput" 30 for f in shell-* ; do 31 substituteInPlace $f --replace "/bin/sh" "${bash}/bin/sh" 32 done 33 ''; 34 35 makeFlags = with lib; [ 36 "DESTDIR=$(out)" 37 (optional withDoc "SCDOC=${scdoc}/bin/scdoc") 38 (optional (!withDoc) "SCDOC=") 39 ]; 40 41 doCheck = false; 42 43 meta = with lib; { 44 description = "A library of shell functions"; 45 inherit (finalAttrs.src.meta) homepage; 46 license = licenses.gpl2; 47 maintainers = [ maintainers.sikmir ]; 48 platforms = platforms.all; 49 }; 50 })