depot/third_party/nixpkgs/pkgs/applications/editors/greenfoot/default.nix
Default email 2c76a4cb41 Project import generated by Copybara.
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
2023-11-16 04:20:00 +00:00

50 lines
1.7 KiB
Nix

{ lib, stdenv, fetchurl, openjdk, glib, dpkg, wrapGAppsHook }:
stdenv.mkDerivation rec {
pname = "greenfoot";
version = "3.8.1";
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";
sha256 = "sha256-utGSAbP74O1t1iEoN0CwiZVc8HxdCxhozPPMwQCtkEE=";
};
nativeBuildInputs = [ dpkg wrapGAppsHook ];
buildInputs = [ glib ];
dontWrapGApps = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r usr/* $out
rm -r $out/share/greenfoot/jdk
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"
runHook postInstall
'';
meta = with lib; {
description = "A simple integrated development environment for Java";
homepage = "https://www.greenfoot.org/";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.gpl2ClasspathPlus;
mainProgram = pname;
maintainers = [ maintainers.chvp ];
platforms = platforms.linux;
};
}