nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1212B)


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