nur-packages

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

commit 874019af83fd1eb6aa85db2881c741983a8f3a89
parent bec2f47a0f76edd2f25730e5aa1f9d37c8b576d9
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date:   Wed, 31 Aug 2022 22:27:34 +0300

Add tirex

Diffstat:
Mpkgs/default.nix | 1+
Apkgs/osm/tirex/default.nix | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpkgs/perl-packages.nix | 15+++++++++++++++
3 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -400,6 +400,7 @@ lib.makeScope newScope ( inherit (darwin.apple_sdk.frameworks) Foundation; }; taginfo-tools = callPackage ./osm/taginfo-tools { }; + tirex = callPackage ./osm/tirex { }; vectiler = callPackage ./osm/vectiler { }; ### RADIO diff --git a/pkgs/osm/tirex/default.nix b/pkgs/osm/tirex/default.nix @@ -0,0 +1,58 @@ +{ lib, stdenv, fetchFromGitHub, makeWrapper, cairo, mapnik, perl, perlPackages }: + +stdenv.mkDerivation rec { + pname = "tirex"; + version = "0.7.0"; + + src = fetchFromGitHub { + owner = "openstreetmap"; + repo = "tirex"; + rev = "v${version}"; + hash = "sha256-0QbPfCPBdNBbUiZ8Ppg2zao98+Ddl3l+yX6y1/J50rg="; + }; + + postPatch = '' + substituteInPlace Makefile --replace "/usr" "" --replace ": Makefile.perl" ":" + substituteInPlace backend-mapnik/Makefile --replace "/usr" "" + substituteInPlace lib/Tirex.pm --replace "/etc" "$out/etc" + ''; + + preConfigure = '' + perl Makefile.PL PREFIX=$out DESTDIR= FIRST_MAKEFILE=Makefile.perl + ''; + + nativeBuildInputs = [ makeWrapper ]; + + buildInputs = [ cairo mapnik perl ]; + + installFlags = [ "DESTDIR=$(out)" "INSTALLOPTS:=" ]; + + installTargets = [ "install-all" ]; + + preInstall = '' + # https://github.com/openstreetmap/tirex/pull/42 + install -m 755 -d $out/libexec + ''; + + postInstall = '' + mv $out$out/lib/* $out/lib + mv $out$out/man/* $out/man + rm -r $out/nix + ''; + + postFixup = '' + for cmd in `ls $out/bin`; do + wrapProgram $out/bin/$cmd \ + --prefix PERL5LIB : "${with perlPackages; makeFullPerlPath [ JSON IpcShareLite ]}:"$out/lib/perl5 + done + ''; + + meta = with lib; { + description = "Tirex tile queue manager"; + homepage = "http://wiki.openstreetmap.org/wiki/Tirex"; + license = licenses.gpl2; + maintainers = [ maintainers.sikmir ]; + platforms = platforms.unix; + }; +} + diff --git a/pkgs/perl-packages.nix b/pkgs/perl-packages.nix @@ -133,4 +133,19 @@ rec { license = licenses.free; }; }; + + IpcShareLite = buildPerlPackage rec { + pname = "IPC-ShareLite"; + version = "0.17"; + src = fetchurl { + url = "mirror://cpan/authors/id/A/AN/ANDYA/${pname}-${version}.tar.gz"; + hash = "sha256-FNQGuR2pbWUh0NGoLSKjBidHZSJrhrClbn/93Plq578="; + }; + propagatedBuildInputs = [ ]; + meta = with lib; { + homepage = "https://metacpan.org/pod/IPC::ShareLite"; + description = "IPC::ShareLite - Lightweight interface to shared memory"; + license = licenses.free; + }; + }; }