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

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

56 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, openjdk, glib, wrapGAppsHook }:
2020-09-18 09:28:53 +00:00
stdenv.mkDerivation rec {
pname = "bluej";
version = "5.1.0";
2021-08-17 19:31:00 +00:00
2020-09-18 09:28:53 +00:00
src = fetchurl {
# We use the deb here. First instinct might be to go for the "generic" JAR
# download, but that is actually a graphical installer that is much harder
# to unpack than the deb.
url = "https://www.bluej.org/download/files/BlueJ-linux-${builtins.replaceStrings ["."] [""] version}.deb";
sha256 = "sha256-tOb15wU9OjUt0D8l/JkaGYj84L7HV4FUnQQB5cRAxG0=";
2020-09-18 09:28:53 +00:00
};
2021-08-17 19:31:00 +00:00
nativeBuildInputs = [ wrapGAppsHook ];
buildInputs = [ glib ];
2020-09-18 09:28:53 +00:00
2021-08-17 19:31:00 +00:00
sourceRoot = ".";
2021-08-17 19:31:00 +00:00
preUnpack = ''
unpackCmdHooks+=(_tryDebData)
_tryDebData() {
if ! [[ "$1" =~ \.deb$ ]]; then return 1; fi
ar xf "$1"
if ! [[ -e data.tar.xz ]]; then return 1; fi
unpackFile data.tar.xz
}
2020-09-18 09:28:53 +00:00
'';
dontWrapGApps = true;
2020-09-18 09:28:53 +00:00
installPhase = ''
2021-08-17 19:31:00 +00:00
runHook preInstall
mkdir -p $out
cp -r usr/* $out
2021-08-17 19:31:00 +00:00
makeWrapper ${openjdk}/bin/java $out/bin/bluej \
"''${gappsWrapperArgs[@]}" \
--add-flags "-Dawt.useSystemAAFontSettings=on -Xmx512M \
--add-opens javafx.graphics/com.sun.glass.ui=ALL-UNNAMED \
-jar $out/share/bluej/bluej.jar"
2021-08-17 19:31:00 +00:00
runHook postInstall
'';
meta = with lib; {
2020-09-18 09:28:53 +00:00
description = "A simple integrated development environment for Java";
homepage = "https://www.bluej.org/";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
2020-09-18 09:28:53 +00:00
license = licenses.gpl2ClasspathPlus;
2021-08-17 19:31:00 +00:00
maintainers = with maintainers; [ chvp ];
platforms = platforms.linux;
2020-09-18 09:28:53 +00:00
};
}