nur-packages

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

default.nix (1751B)


      1 {
      2   lib,
      3   stdenv,
      4   buildPerlPackage,
      5   shortenPerlShebang,
      6   fetchFromGitHub,
      7   ConfigStd,
      8   EncodeLocale,
      9   FileSlurp,
     10   GeoOpenstreetmapParser,
     11   JSON,
     12   ListMoreUtils,
     13   LWPProtocolHttps,
     14   MatchSimple,
     15   MathPolygon,
     16   MathPolygonTree,
     17   TemplateToolkit,
     18   TextUnidecode,
     19   TreeR,
     20   YAML,
     21 }:
     22 
     23 buildPerlPackage {
     24   pname = "osm2mp";
     25   version = "0-unstable-2018-08-31";
     26 
     27   src = fetchFromGitHub {
     28     owner = "liosha";
     29     repo = "osm2mp";
     30     rev = "748f93792ead174ad0e94a183a173ef3fcacf200";
     31     hash = "sha256-YxtEOuoLeglpdpmStrcEkXwRGHRE+N1hKDB2Rr8rokw=";
     32   };
     33 
     34   outputs = [ "out" ];
     35 
     36   nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang;
     37 
     38   propagatedBuildInputs = [
     39     ConfigStd
     40     EncodeLocale
     41     FileSlurp
     42     GeoOpenstreetmapParser
     43     JSON
     44     ListMoreUtils
     45     LWPProtocolHttps
     46     MatchSimple
     47     MathPolygon
     48     MathPolygonTree
     49     TemplateToolkit
     50     TextUnidecode
     51     TreeR
     52     YAML
     53   ];
     54 
     55   postPatch = ''
     56     substituteInPlace osm2mp.pl \
     57       --replace-fail "\$Bin/cfg" "$out/share/osm2mp/cfg"
     58   '';
     59 
     60   preConfigure = "touch Makefile.PL";
     61 
     62   installPhase =
     63     ''
     64       install -Dm755 osm2mp.pl $out/bin/osm2mp
     65       install -dm755 $out/share/osm2mp/cfg
     66       cp -r cfg/* $out/share/osm2mp/cfg
     67       install -dm755 $out/lib/perl5/site_perl
     68       cp -r lib/* $out/lib/perl5/site_perl
     69     ''
     70     + lib.optionalString stdenv.isLinux ''
     71       patchShebangs $out/bin/osm2mp
     72     ''
     73     + lib.optionalString stdenv.isDarwin ''
     74       shortenPerlShebang $out/bin/osm2mp
     75     '';
     76 
     77   meta = {
     78     description = "Convert Openstreetmap data to MP format";
     79     homepage = "https://github.com/liosha/osm2mp";
     80     license = lib.licenses.gpl2;
     81     maintainers = [ lib.maintainers.sikmir ];
     82     mainProgram = "osm2mp";
     83   };
     84 }