1 { stdenv, lib, fetchurl, unzip, makeWrapper, jre8, libXtst, gdal }:
7 x86_64-linux = fetchurl {
8 url = "http://udig.refractions.net/files/downloads/udig-${version}.linux.gtk.x86_64.zip";
9 hash = "sha256-ijuSWq1jSsB8K653bjcUdNwVGZscDaTuegBr01oNEg4=";
11 x86_64-darwin = fetchurl {
12 url = "http://udig.refractions.net/files/downloads/udig-${version}.macosx.cocoa.x86_64.zip";
13 hash = "sha256-Ihk3InHB3/tEYRqH2ozhokz2GN8Gfig5DJkO/8P1LJs=";
16 src = srcs.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
19 description = "User-friendly Desktop Internet GIS";
20 homepage = "http://udig.refractions.net/";
21 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
22 license = with licenses; [ epl10 bsd3 ];
23 maintainers = with maintainers; [ sikmir ];
24 platforms = builtins.attrNames srcs;
28 linux = stdenv.mkDerivation {
29 inherit pname version src meta;
31 nativeBuildInputs = [ unzip makeWrapper ];
34 install -dm755 $out/bin $out/opt/udig
36 makeWrapper $out/opt/udig/udig.sh $out/bin/udig \
37 --prefix PATH : ${jre8}/bin \
38 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ libXtst gdal ])}
43 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
44 $out/opt/udig/udig_internal
48 darwin = stdenv.mkDerivation {
49 inherit pname version src meta;
51 nativeBuildInputs = [ unzip makeWrapper ];
54 substituteInPlace configuration/config.ini \
55 --replace "\$LOCALAPPDATA\$" "@user.home"
59 mkdir -p $out/Applications/udig
60 cp -R . $out/Applications/udig
61 wrapProgram $out/Applications/udig/udig.app/Contents/MacOS/udig_internal \
62 --prefix DYLD_LIBRARY_PATH : ${lib.makeLibraryPath ([ gdal ])}
66 if stdenv.hostPlatform.isDarwin