2024-05-15 15:35:15 +00:00
|
|
|
{ lib, stdenv, fetchurl, openjdk, glib, dpkg, wrapGAppsHook3 }:
|
2020-12-07 07:45:13 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "greenfoot";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "3.8.2";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2020-12-07 07:45:13 +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.greenfoot.org/download/files/Greenfoot-linux-${builtins.replaceStrings ["."] [""] version}.deb";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-wpmgWtx2jTDjt+7p6HcjU/uy1PRmnAHpJ1rOYb+hV+U=";
|
2020-12-07 07:45:13 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [ dpkg wrapGAppsHook3 ];
|
2023-10-09 19:29:22 +00:00
|
|
|
buildInputs = [ glib ];
|
2020-12-07 07:45:13 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
dontWrapGApps = true;
|
2020-12-07 07:45:13 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
mkdir -p $out
|
|
|
|
cp -r usr/* $out
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
rm -r $out/share/greenfoot/jdk
|
2023-10-09 19:29:22 +00:00
|
|
|
rm -r $out/share/greenfoot/javafx-*.jar
|
|
|
|
|
|
|
|
makeWrapper ${openjdk}/bin/java $out/bin/greenfoot \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--add-flags "-Dawt.useSystemAAFontSettings=on -Xmx512M \
|
|
|
|
--add-opens javafx.graphics/com.sun.glass.ui=ALL-UNNAMED \
|
|
|
|
-cp $out/share/greenfoot/boot.jar bluej.Boot \
|
|
|
|
-greenfoot=true -bluej.compiler.showunchecked=false \
|
|
|
|
-greenfoot.scenarios=$out/share/doc/Greenfoot/scenarios \
|
|
|
|
-greenfoot.url.javadoc=file://$out/share/doc/Greenfoot/API"
|
2020-12-07 07:45:13 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
runHook postInstall
|
2020-12-07 07:45:13 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Simple integrated development environment for Java";
|
2020-12-07 07:45:13 +00:00
|
|
|
homepage = "https://www.greenfoot.org/";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-12-07 07:45:13 +00:00
|
|
|
license = licenses.gpl2ClasspathPlus;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "greenfoot";
|
2021-02-22 21:28:39 +00:00
|
|
|
maintainers = [ maintainers.chvp ];
|
2023-10-09 19:29:22 +00:00
|
|
|
platforms = platforms.linux;
|
2020-12-07 07:45:13 +00:00
|
|
|
};
|
|
|
|
}
|