nur-packages

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

package.nix (1339B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchwebarchive,
      5   fetchpatch,
      6   readline,
      7   ncurses,
      8   bison,
      9   flex,
     10   installShellFiles,
     11 }:
     12 
     13 stdenv.mkDerivation (finalAttrs: {
     14   pname = "aamath";
     15   version = "0.3";
     16 
     17   __structuredAttrs = true;
     18 
     19   src = fetchwebarchive {
     20     url = "http://fuse.superglue.se/aamath/aamath-${finalAttrs.version}.tar.gz";
     21     timestamp = "20190303013301";
     22     hash = "sha256-mEP0WIaV4s1Vzl2PWJIdTyVeDmXtlWnh3N3z9o93tjE=";
     23   };
     24 
     25   patches = (
     26     fetchpatch {
     27       url = "https://raw.githubusercontent.com/macports/macports-ports/6c3088afddcf34ca2bcc5c209f85f264dcf0bc69/math/aamath/files/patch-expr.h.diff";
     28       hash = "sha256-JtLcqdBq/88Bemj4NQYnpEVVTUyiCLWX2zE3CuXtRlM=";
     29     }
     30   );
     31 
     32   patchFlags = [ "-p0" ];
     33 
     34   postPatch = ''
     35     substituteInPlace Makefile \
     36       --replace-fail "lex " "flex " \
     37       --replace-fail "-ltermcap" "-lncurses"
     38   '';
     39 
     40   nativeBuildInputs = [
     41     bison
     42     flex
     43     installShellFiles
     44   ];
     45 
     46   buildInputs = [
     47     readline
     48     ncurses
     49   ];
     50 
     51   installPhase = ''
     52     install -Dm755 aamath -t $out/bin
     53     installManPage aamath.1
     54   '';
     55 
     56   meta = {
     57     description = "ASCII art mathematics";
     58     homepage = "http://fuse.superglue.se/aamath/";
     59     license = lib.licenses.gpl2Only;
     60     maintainers = [ lib.maintainers.sikmir ];
     61     platforms = lib.platforms.linux;
     62     skip.ci = stdenv.isDarwin;
     63   };
     64 })