nur-packages

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

package.nix (1241B)


      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   __structuredAttrs = true;
     18 
     19   src = fetchFromGitHub {
     20     owner = "legionus";
     21     repo = "libshell";
     22     tag = "v${finalAttrs.version}";
     23     hash = "sha256-jolr55qNG3224IWRE9PueeRbO5RIhFmFiPe0g0wO9c4=";
     24   };
     25 
     26   nativeBuildInputs = [ help2man ];
     27 
     28   postPatch = ''
     29     substituteInPlace Makefile --replace-fail "/usr" ""
     30     substituteInPlace utils/Makefile --replace-fail "/usr" ""
     31     substituteInPlace utils/cgrep.in --replace-fail "/bin/ash" "${dash}/bin/dash"
     32     substituteInPlace shell-terminfo --replace-fail "tput" "${ncurses}/bin/tput"
     33     for f in shell-* ; do
     34       substituteInPlace $f --replace-warn "/bin/sh" "${bash}/bin/sh"
     35     done
     36   '';
     37 
     38   makeFlags = with lib; [
     39     "DESTDIR=$(out)"
     40     (optional withDoc "SCDOC=${scdoc}/bin/scdoc")
     41     (optional (!withDoc) "SCDOC=")
     42   ];
     43 
     44   doCheck = false;
     45 
     46   meta = {
     47     description = "A library of shell functions";
     48     homepage = "https://github.com/legionus/libshell";
     49     license = lib.licenses.gpl2;
     50     maintainers = [ lib.maintainers.sikmir ];
     51     platforms = lib.platforms.all;
     52   };
     53 })