summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/gis
diff options
context:
space:
mode:
authorNikolay Korotkiy <sikmir@gmail.com>2020-10-23 22:35:33 +0300
committerNikolay Korotkiy <sikmir@gmail.com>2021-01-19 02:05:32 +0300
commitcade5d7fa5496c2ffc9598e233ccc92fbcbbb00e (patch)
treed3c3f1cdcbaea13d865be5c17c67020c3b96f3c4 /pkgs/applications/gis
parent7d9979ec1bed86e97038a2de58ae253e9fc9469f (diff)
udig: init at 2.0.0
Diffstat (limited to 'pkgs/applications/gis')
-rw-r--r--pkgs/applications/gis/udig/default.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/applications/gis/udig/default.nix b/pkgs/applications/gis/udig/default.nix
new file mode 100644
index 000000000000..e4abddbcde00
--- /dev/null
+++ b/pkgs/applications/gis/udig/default.nix
@@ -0,0 +1,66 @@
+{ stdenv, lib, fetchurl, unzip, makeWrapper, jre8, libXtst, gdal }:
+let
+ pname = "udig";
+ version = "2.0.0";
+
+ srcs = {
+ x86_64-linux = fetchurl {
+ url = "http://udig.refractions.net/files/downloads/udig-${version}.linux.gtk.x86_64.zip";
+ sha256 = "03hj1mdd6sq0gbpa838wkccibp3l2hvnwxxf5dyc0jk3mmd94fwa";
+ };
+ x86_64-darwin = fetchurl {
+ url = "http://udig.refractions.net/files/downloads/udig-${version}.macosx.cocoa.x86_64.zip";
+ sha256 = "16rcyp1zy3lr1hwjhzh6vwcgck52w66dm1qsc52gppy1f4i3f692";
+ };
+ };
+ src = srcs.${stdenv.hostPlatform.system};
+
+ meta = with lib; {
+ description = "User-friendly Desktop Internet GIS";
+ homepage = "http://udig.refractions.net/";
+ license = with licenses; [ epl10 bsd3 ];
+ maintainers = with maintainers; [ sikmir ];
+ platforms = builtins.attrNames srcs;
+ };
+
+ linux = stdenv.mkDerivation {
+ inherit pname version src meta;
+
+ nativeBuildInputs = [ unzip makeWrapper ];
+
+ installPhase = ''
+ install -dm755 $out/bin $out/opt/udig
+ cp -r . $out/opt/udig
+ makeWrapper $out/opt/udig/udig.sh $out/bin/udig \
+ --prefix PATH : ${jre8}/bin \
+ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ libXtst gdal ])}
+ '';
+
+ postFixup = ''
+ patchelf \
+ --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
+ $out/opt/udig/udig_internal
+ '';
+ };
+
+ darwin = stdenv.mkDerivation {
+ inherit pname version src meta;
+
+ nativeBuildInputs = [ unzip makeWrapper ];
+
+ postPatch = ''
+ substituteInPlace configuration/config.ini \
+ --replace "\$LOCALAPPDATA\$" "@user.home"
+ '';
+
+ installPhase = ''
+ mkdir -p $out/Applications/udig
+ cp -R . $out/Applications/udig
+ wrapProgram $out/Applications/udig/udig.app/Contents/MacOS/udig_internal \
+ --prefix DYLD_LIBRARY_PATH : ${lib.makeLibraryPath ([ gdal ])}
+ '';
+ };
+in
+if stdenv.isDarwin
+then darwin
+else linux