nixpkgs/pkgs/applications/editors/netbeans/default.nix

52 lines
1.6 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, makeWrapper, makeDesktopItem
, gawk, jdk, perl, python, unzip, which
}:
2012-10-09 09:40:06 +00:00
let
desktopItem = makeDesktopItem {
name = "netbeans";
exec = "netbeans";
comment = "Integrated Development Environment";
desktopName = "Netbeans IDE";
genericName = "Integrated Development Environment";
categories = "Application;Development;";
};
in
stdenv.mkDerivation {
2016-05-12 13:03:00 +00:00
name = "netbeans-8.1";
2012-10-09 09:40:06 +00:00
src = fetchurl {
2016-05-12 13:03:00 +00:00
url = http://download.netbeans.org/netbeans/8.1/final/zip/netbeans-8.1-201510222201.zip;
sha256 = "1aaf132mndpgfbd5v8izqzp37hjs5gwqwd6zrb519fx0viz9aq5r";
2012-10-09 09:40:06 +00:00
};
2012-10-09 09:40:06 +00:00
buildCommand = ''
# Unpack and perform some path patching.
2012-10-09 09:40:06 +00:00
unzip $src
patch -p1 <${./path.patch}
substituteInPlace netbeans/platform/lib/nbexec \
--subst-var-by AWK ${gawk}/bin/awk
patchShebangs .
# Copy to installation directory and create a wrapper capable of starting
# it.
2012-10-09 09:40:06 +00:00
mkdir -p $out/bin
cp -a netbeans $out
2012-10-09 09:40:06 +00:00
makeWrapper $out/netbeans/bin/netbeans $out/bin/netbeans \
2016-08-22 22:06:51 +00:00
--prefix PATH : ${stdenv.lib.makeBinPath [ jdk which ]} \
--prefix JAVA_HOME : ${jdk.home} \
--add-flags "--jdkhome ${jdk.home}"
2012-10-09 09:40:06 +00:00
# Create desktop item, so we can pick it from the KDE/GNOME menu
mkdir -p $out/share/applications
cp ${desktopItem}/share/applications/* $out/share/applications
'';
buildInputs = [ makeWrapper perl python unzip ];
2012-10-09 09:40:06 +00:00
meta = {
description = "An integrated development environment for Java, C, C++ and PHP";
maintainers = [ stdenv.lib.maintainers.sander ];
platforms = stdenv.lib.platforms.unix;
2012-10-09 09:40:06 +00:00
};
}