nixpkgs/pkgs/applications/editors/greenfoot/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

39 lines
1.4 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper, jdk }:
stdenv.mkDerivation rec {
pname = "greenfoot";
version = "3.6.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 = "112h6plpclj8kbv093m4pcczljhpd8d47d7a2am1yfgbyckx6hf0";
};
nativeBuildInputs = [ makeWrapper ];
unpackPhase = ''
ar xf $src
tar xf data.tar.xz
'';
installPhase = ''
mkdir -p $out
cp -r usr/* $out
rm -r $out/share/greenfoot/jdk
rm -r $out/share/greenfoot/javafx
makeWrapper ${jdk}/bin/java $out/bin/greenfoot \
--add-flags "-Djavafx.embed.singleThread=true -Dawt.useSystemAAFontSettings=on -Xmx512M -cp \"$out/share/greenfoot/bluej.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"
'';
meta = with lib; {
description = "A simple integrated development environment for Java";
homepage = "https://www.greenfoot.org/";
license = licenses.gpl2ClasspathPlus;
maintainers = [ maintainers.charvp ];
platforms = platforms.unix;
};
}