nixpkgs/pkgs/by-name/ud/udig/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

101 lines
2.2 KiB
Nix

{
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";
hash = "sha256-ijuSWq1jSsB8K653bjcUdNwVGZscDaTuegBr01oNEg4=";
};
x86_64-darwin = fetchurl {
url = "http://udig.refractions.net/files/downloads/udig-${version}.macosx.cocoa.x86_64.zip";
hash = "sha256-Ihk3InHB3/tEYRqH2ozhokz2GN8Gfig5DJkO/8P1LJs=";
};
};
src =
srcs.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
meta = with lib; {
description = "User-friendly Desktop Internet GIS";
homepage = "http://udig.refractions.net/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = with licenses; [
epl10
bsd3
];
maintainers = with maintainers; [ sikmir ];
platforms = builtins.attrNames srcs;
mainProgram = "udig";
};
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.hostPlatform.isDarwin then darwin else linux