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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
2.4 KiB
Nix
Raw Normal View History

2021-01-15 13:21:58 +00:00
{ lib, stdenv, fetchurl, makeWrapper, makeDesktopItem, which, unzip, libicns, imagemagick
2022-01-16 18:18:52 +00:00
, jdk, perl
}:
2012-10-09 09:40:06 +00:00
let
2022-12-11 14:10:52 +00:00
version = "16";
2012-10-09 09:40:06 +00:00
desktopItem = makeDesktopItem {
name = "netbeans";
exec = "netbeans";
comment = "Integrated Development Environment";
desktopName = "Apache NetBeans IDE";
2012-10-09 09:40:06 +00:00
genericName = "Integrated Development Environment";
categories = [ "Development" ];
icon = "netbeans";
2012-10-09 09:40:06 +00:00
};
in
stdenv.mkDerivation {
2019-08-13 21:52:01 +00:00
pname = "netbeans";
inherit version;
2012-10-09 09:40:06 +00:00
src = fetchurl {
2019-09-19 22:57:20 +00:00
url = "mirror://apache/netbeans/netbeans/${version}/netbeans-${version}-bin.zip";
2022-12-11 14:10:52 +00:00
hash = "sha512-k+Zj6TKW0tOSYvM6V1okF4Qz62gZMETC6XG98W23Vtz3+vdiaddd8BC2DBg7p9Z1CofRq8sbwtpeTJM3FaXv0g==";
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
patchShebangs .
rm netbeans/bin/*.exe
# Copy to installation directory and create a wrapper capable of starting
# it.
mkdir -pv $out/bin
cp -a netbeans $out
2012-10-09 09:40:06 +00:00
makeWrapper $out/netbeans/bin/netbeans $out/bin/netbeans \
2021-01-15 13:21:58 +00:00
--prefix PATH : ${lib.makeBinPath [ jdk which ]} \
--prefix JAVA_HOME : ${jdk.home} \
--add-flags "--jdkhome ${jdk.home} \
-J-Dawt.useSystemAAFontSettings=on -J-Dswing.aatext=true"
2016-10-15 01:56:26 +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;
2019-09-19 22:57:20 +00:00
2012-10-09 09:40:06 +00:00
# Create desktop item, so we can pick it from the KDE/GNOME menu
mkdir -pv $out/share/applications
ln -s ${desktopItem}/share/applications/* $out/share/applications
2012-10-09 09:40:06 +00:00
'';
2016-10-15 01:56:26 +00:00
nativeBuildInputs = [ makeWrapper unzip ];
2022-01-16 18:18:52 +00:00
buildInputs = [ perl libicns imagemagick ];
2016-10-15 01:56:26 +00:00
2012-10-09 09:40:06 +00:00
meta = {
description = "An integrated development environment for Java, C, C++ and PHP";
homepage = "https://netbeans.apache.org/";
2021-01-15 13:21:58 +00:00
license = lib.licenses.asl20;
sourceProvenance = with lib.sourceTypes; [
binaryBytecode
binaryNativeCode
];
2021-01-15 13:21:58 +00:00
maintainers = with lib.maintainers; [ sander rszibele asbachb ];
platforms = lib.platforms.unix;
2012-10-09 09:40:06 +00:00
};
}