nur-packages

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

default.nix (1686B)


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