2019-03-15 14:03:13 +01:00
|
|
|
{ stdenv, fetchurl, makeWrapper, makeDesktopItem, which, unzip, libicns, imagemagick
|
|
|
|
, jdk, perl, python
|
2015-09-30 07:03:02 +02:00
|
|
|
}:
|
2012-10-09 11:40:06 +02:00
|
|
|
|
|
|
|
let
|
2020-06-04 19:23:02 +02:00
|
|
|
version = "12.0";
|
2012-10-09 11:40:06 +02:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "netbeans";
|
|
|
|
exec = "netbeans";
|
|
|
|
comment = "Integrated Development Environment";
|
2019-09-20 01:05:19 +02:00
|
|
|
desktopName = "Apache NetBeans IDE";
|
2012-10-09 11:40:06 +02:00
|
|
|
genericName = "Integrated Development Environment";
|
2020-06-25 04:18:37 +02:00
|
|
|
categories = "Development;";
|
2019-03-15 14:03:13 +01:00
|
|
|
icon = "netbeans";
|
2012-10-09 11:40:06 +02:00
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2019-08-13 23:52:01 +02:00
|
|
|
pname = "netbeans";
|
|
|
|
inherit version;
|
2012-10-09 11:40:06 +02:00
|
|
|
src = fetchurl {
|
2019-09-20 00:57:20 +02:00
|
|
|
url = "mirror://apache/netbeans/netbeans/${version}/netbeans-${version}-bin.zip";
|
2020-06-04 19:23:02 +02:00
|
|
|
sha512 = "91030c9628a08acd85f1a58a7f71eec2e57dc85841c1c475cc6311335b5d8cdc10c1198274b9668b7f61a28d04b07661247dc1c3e36b8e29214aec3748e499e4";
|
2012-10-09 11:40:06 +02:00
|
|
|
};
|
2015-09-30 07:03:02 +02:00
|
|
|
|
2012-10-09 11:40:06 +02:00
|
|
|
buildCommand = ''
|
2015-09-30 07:03:02 +02:00
|
|
|
# Unpack and perform some path patching.
|
2012-10-09 11:40:06 +02:00
|
|
|
unzip $src
|
2015-09-30 07:03:02 +02:00
|
|
|
patchShebangs .
|
|
|
|
|
|
|
|
# Copy to installation directory and create a wrapper capable of starting
|
|
|
|
# it.
|
2019-03-15 14:03:13 +01:00
|
|
|
mkdir -pv $out/bin
|
2015-09-30 07:03:02 +02:00
|
|
|
cp -a netbeans $out
|
2012-10-09 11:40:06 +02:00
|
|
|
makeWrapper $out/netbeans/bin/netbeans $out/bin/netbeans \
|
2016-08-23 00:06:51 +02:00
|
|
|
--prefix PATH : ${stdenv.lib.makeBinPath [ jdk which ]} \
|
2015-01-02 00:49:20 +01:00
|
|
|
--prefix JAVA_HOME : ${jdk.home} \
|
|
|
|
--add-flags "--jdkhome ${jdk.home}"
|
2016-10-15 03:56:26 +02:00
|
|
|
|
2019-03-15 14:03:13 +01: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;
|
2019-09-20 00:57:20 +02:00
|
|
|
|
2012-10-09 11:40:06 +02:00
|
|
|
# Create desktop item, so we can pick it from the KDE/GNOME menu
|
2019-03-15 14:03:13 +01:00
|
|
|
mkdir -pv $out/share/applications
|
|
|
|
ln -s ${desktopItem}/share/applications/* $out/share/applications
|
2012-10-09 11:40:06 +02:00
|
|
|
'';
|
2016-10-15 03:56:26 +02:00
|
|
|
|
2019-03-15 14:03:13 +01:00
|
|
|
buildInputs = [ makeWrapper perl python unzip libicns imagemagick ];
|
2016-10-15 03:56:26 +02:00
|
|
|
|
2012-10-09 11:40:06 +02:00
|
|
|
meta = {
|
|
|
|
description = "An integrated development environment for Java, C, C++ and PHP";
|
2019-09-20 01:15:28 +02:00
|
|
|
homepage = "https://netbeans.apache.org/";
|
2019-03-15 14:03:13 +01:00
|
|
|
license = stdenv.lib.licenses.asl20;
|
2020-03-28 14:00:43 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ sander rszibele asbachb ];
|
2016-08-02 19:50:55 +02:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2012-10-09 11:40:06 +02:00
|
|
|
};
|
|
|
|
}
|