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};
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;
27 linux = stdenv.mkDerivation {
28 inherit pname version src meta;
30 nativeBuildInputs = [ unzip makeWrapper ];
33 install -dm755 $out/bin $out/opt/udig
35 makeWrapper $out/opt/udig/udig.sh $out/bin/udig \
36 --prefix PATH : ${jre8}/bin \
37 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ libXtst gdal ])}
42 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
43 $out/opt/udig/udig_internal
47 darwin = stdenv.mkDerivation {
48 inherit pname version src meta;
50 nativeBuildInputs = [ unzip makeWrapper ];
53 substituteInPlace configuration/config.ini \
54 --replace "\$LOCALAPPDATA\$" "@user.home"
58 mkdir -p $out/Applications/udig
59 cp -R . $out/Applications/udig
60 wrapProgram $out/Applications/udig/udig.app/Contents/MacOS/udig_internal \
61 --prefix DYLD_LIBRARY_PATH : ${lib.makeLibraryPath ([ gdal ])}