2021-08-17 21:31:00 +02:00
|
|
|
{ lib, stdenv, fetchurl, jdk, glib, wrapGAppsHook }:
|
2020-09-18 11:28:53 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "bluej";
|
2022-03-29 14:05:35 +02:00
|
|
|
version = "5.0.3";
|
2021-08-17 21:31:00 +02:00
|
|
|
|
2020-09-18 11:28:53 +02: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";
|
2022-03-29 14:05:35 +02:00
|
|
|
sha256 = "sha256-OarqmptxZc7xEEYeoCVqHXkAvfzfSYx5nUp/iWPyoqw=";
|
2020-09-18 11:28:53 +02:00
|
|
|
};
|
|
|
|
|
2021-08-17 21:31:00 +02:00
|
|
|
nativeBuildInputs = [ wrapGAppsHook ];
|
|
|
|
buildInputs = [ glib ];
|
2020-09-18 11:28:53 +02:00
|
|
|
|
2021-08-17 21:31:00 +02:00
|
|
|
sourceRoot = ".";
|
|
|
|
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 11:28:53 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-08-17 21:31:00 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
if [ -n "$prefix" ]; then
|
|
|
|
mkdir -p "$prefix"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$out"
|
|
|
|
|
|
|
|
if shopt -q dotglob; then dotglobOpt=$?; else dotglobOpt=$?; fi
|
|
|
|
shopt -s dotglob
|
|
|
|
for file in usr/*; do
|
|
|
|
cp -R "$file" "$out"
|
|
|
|
done
|
|
|
|
if (( !dotglobOpt )); then shopt -u dotglob; fi
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontWrapGApps = true;
|
2020-09-18 11:28:53 +02:00
|
|
|
|
2021-08-17 21:31:00 +02:00
|
|
|
preFixup = ''
|
2020-09-18 11:28:53 +02:00
|
|
|
makeWrapper ${jdk}/bin/java $out/bin/bluej \
|
2021-08-17 21:31:00 +02:00
|
|
|
"''${gappsWrapperArgs[@]}" \
|
2022-05-10 14:27:58 +02:00
|
|
|
--add-flags "-Djavafx.embed.singleThread=true -Dawt.useSystemAAFontSettings=on -Xmx512M -cp $out/share/bluej/bluej.jar bluej.Boot"
|
2020-09-18 11:28:53 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-09-18 11:28:53 +02:00
|
|
|
description = "A simple integrated development environment for Java";
|
|
|
|
homepage = "https://www.bluej.org/";
|
2022-06-02 15:38:41 +02:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-09-18 11:28:53 +02:00
|
|
|
license = licenses.gpl2ClasspathPlus;
|
2021-08-17 21:31:00 +02:00
|
|
|
maintainers = with maintainers; [ chvp ];
|
2020-09-18 11:28:53 +02:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|