forked from mirrors/nixpkgs
adding postgis + script enabling postgis features
Exporting builder.pl because it will be used in NixOS postgresql module svn path=/nixpkgs/trunk/; revision=21691
This commit is contained in:
parent
6a9f333cea
commit
27ef15a6bd
51
pkgs/development/libraries/postgis/default.nix
Normal file
51
pkgs/development/libraries/postgis/default.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{stdenv, fetchurl, libxml2, postgresql, geos, proj, perl}:
|
||||
|
||||
# TODO: the bin commands to have gtk gui
|
||||
# compile this optionally ?
|
||||
|
||||
# NixOS - usage: services.posgresql.extraPlugins = [ pkgs.postgis ];
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "postgis";
|
||||
|
||||
src = fetchurl {
|
||||
url = http://postgis.refractions.net/download/postgis-1.5.1.tar.gz;
|
||||
sha256 = "0nymvqqi6pp4nh4dcshzqm76x4sraf119jp7l27c2q1lygm6p6jr";
|
||||
};
|
||||
|
||||
makeFlags = "PERL=${perl}/bin/perl";
|
||||
|
||||
# default both defaul to postgis location !?
|
||||
preConfigure = ''
|
||||
configureFlags="--datadir=$out/share --datarootdir=$out/share --bindir=$out/bin"
|
||||
makeFlags="PERL=${perl}/bin/perl datadir=$out/share pkglibdir=$out/lib bindir=$out/bin"
|
||||
|
||||
# makeFlags="DESTDIR=$out "
|
||||
'';
|
||||
|
||||
# create a script enabling postgis features
|
||||
postInstall = ''
|
||||
cat >> $out/bin/enable_postgis_for_db << EOF
|
||||
#!/bin/sh
|
||||
set -x
|
||||
t=$out/share/contrib/postgis-1.5
|
||||
for db in "\$@"; do
|
||||
createlang plpgsql \$db
|
||||
for f in postgis spatial_ref_sys; do
|
||||
psql -d \$db -f \$t/\$f.sql
|
||||
done
|
||||
done
|
||||
EOF
|
||||
chmod +x $out/bin/enable_postgis_for_db
|
||||
'';
|
||||
|
||||
buildInputs = [libxml2 postgresql geos proj perl];
|
||||
|
||||
meta = {
|
||||
description = "Geographic Objects for PostgreSQL";
|
||||
homepage = "http://postgis.refractions.net";
|
||||
license = "GPLv2";
|
||||
maintainers = [stdenv.lib.maintainers.marcweber];
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
};
|
||||
}
|
|
@ -218,6 +218,7 @@ let
|
|||
theAttrSet = arg;
|
||||
};
|
||||
|
||||
buildEnvScript = ../build-support/buildenv/builder.pl;
|
||||
buildEnv = import ../build-support/buildenv {
|
||||
inherit stdenv perl;
|
||||
};
|
||||
|
@ -5012,6 +5013,10 @@ let
|
|||
inherit fetchurl stdenv;
|
||||
};
|
||||
|
||||
postgis = import ../development/libraries/postgis {
|
||||
inherit stdenv fetchurl libxml2 postgresql geos proj perl;
|
||||
};
|
||||
|
||||
pth = import ../development/libraries/pth {
|
||||
inherit fetchurl stdenv;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue