2019-03-15 13:03:13 +00:00
|
|
|
{ stdenv, fetchurl, makeWrapper, makeDesktopItem, which, unzip, libicns, imagemagick
|
|
|
|
, jdk, perl, python
|
2015-09-30 06:03:02 +01:00
|
|
|
}:
|
2012-10-09 10:40:06 +01:00
|
|
|
|
|
|
|
let
|
2019-03-15 13:03:13 +00:00
|
|
|
version = "10.0";
|
2012-10-09 10:40:06 +01:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "netbeans";
|
|
|
|
exec = "netbeans";
|
|
|
|
comment = "Integrated Development Environment";
|
|
|
|
desktopName = "Netbeans IDE";
|
|
|
|
genericName = "Integrated Development Environment";
|
|
|
|
categories = "Application;Development;";
|
2019-03-15 13:03:13 +00:00
|
|
|
icon = "netbeans";
|
2012-10-09 10:40:06 +01:00
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2019-03-15 13:03:13 +00:00
|
|
|
name = "netbeans-${version}";
|
2012-10-09 10:40:06 +01:00
|
|
|
src = fetchurl {
|
2019-03-15 13:03:13 +00:00
|
|
|
url = "mirror://apache/incubator/netbeans/incubating-netbeans/incubating-${version}/incubating-netbeans-${version}-bin.zip";
|
|
|
|
sha512 = "ba83575f42c1d5515e2a5336a621bc2b4087b2e0bcacb6edb76f376f8272555609bdd4eefde8beae8ffc6c1a7db2fb721b844638ce27933c3dd78f71cbb41ad8";
|
2012-10-09 10:40:06 +01:00
|
|
|
};
|
2015-09-30 06:03:02 +01:00
|
|
|
|
2012-10-09 10:40:06 +01:00
|
|
|
buildCommand = ''
|
2015-09-30 06:03:02 +01:00
|
|
|
# Unpack and perform some path patching.
|
2012-10-09 10:40:06 +01:00
|
|
|
unzip $src
|
2015-09-30 06:03:02 +01:00
|
|
|
patchShebangs .
|
|
|
|
|
|
|
|
# Copy to installation directory and create a wrapper capable of starting
|
|
|
|
# it.
|
2019-03-15 13:03:13 +00:00
|
|
|
mkdir -pv $out/bin
|
2015-09-30 06:03:02 +01:00
|
|
|
cp -a netbeans $out
|
2012-10-09 10:40:06 +01:00
|
|
|
makeWrapper $out/netbeans/bin/netbeans $out/bin/netbeans \
|
2016-08-22 23:06:51 +01:00
|
|
|
--prefix PATH : ${stdenv.lib.makeBinPath [ jdk which ]} \
|
2015-01-01 23:49:20 +00:00
|
|
|
--prefix JAVA_HOME : ${jdk.home} \
|
|
|
|
--add-flags "--jdkhome ${jdk.home}"
|
2016-10-15 02:56:26 +01:00
|
|
|
|
2019-03-15 13:03:13 +00:00
|
|
|
# Extract pngs from the Apple icon image and create
|
|
|
|
# the missing ones from the 1024x1024 image.
|
|
|
|
icns2png --extract $out/netbeans/nb/netbeans.icns
|
|
|
|
for size in 16 24 32 48 64 128 256 512 1024; do
|
|
|
|
mkdir -pv $out/share/icons/hicolor/"$size"x"$size"/apps
|
|
|
|
if [ -e netbeans_"$size"x"$size"x32.png ]
|
|
|
|
then
|
|
|
|
mv netbeans_"$size"x"$size"x32.png $out/share/icons/hicolor/"$size"x"$size"/apps/netbeans.png
|
|
|
|
else
|
|
|
|
convert -resize "$size"x"$size" netbeans_1024x1024x32.png $out/share/icons/hicolor/"$size"x"$size"/apps/netbeans.png
|
|
|
|
fi
|
|
|
|
done;
|
|
|
|
|
2012-10-09 10:40:06 +01:00
|
|
|
# Create desktop item, so we can pick it from the KDE/GNOME menu
|
2019-03-15 13:03:13 +00:00
|
|
|
mkdir -pv $out/share/applications
|
|
|
|
ln -s ${desktopItem}/share/applications/* $out/share/applications
|
2012-10-09 10:40:06 +01:00
|
|
|
'';
|
2016-10-15 02:56:26 +01:00
|
|
|
|
2019-03-15 13:03:13 +00:00
|
|
|
buildInputs = [ makeWrapper perl python unzip libicns imagemagick ];
|
2016-10-15 02:56:26 +01:00
|
|
|
|
2012-10-09 10:40:06 +01:00
|
|
|
meta = {
|
|
|
|
description = "An integrated development environment for Java, C, C++ and PHP";
|
2019-03-15 13:03:13 +00:00
|
|
|
homepage = "https://netbeans.org/";
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ sander rszibele ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2012-10-09 10:40:06 +01:00
|
|
|
};
|
|
|
|
}
|