opl 26c5111b7c treewide: Correctly force Java font anti-aliasing to gasp mode
Fixes instances of the awt.useSystemAAFontSettings property in _JAVA_OPTIONS being impossible to override due to incorrect separators and due to replacing the value from the shell.

Changes the font anti-aliasing mode to gasp;
led is not suitable for users with subpixel arrangements other than horizontal RGB,
on doesn't respect the hints encoded in fonts.

See https://github.com/NixOS/nixpkgs/issues/422043
2025-07-03 12:33:28 +02:00

75 lines
1.6 KiB
Nix

{
lib,
stdenvNoCC,
fetchurl,
jre8,
makeWrapper,
makeDesktopItem,
copyDesktopItems,
}:
stdenvNoCC.mkDerivation rec {
pname = "jflap";
version = "7.1";
src = fetchurl {
url = "https://www.jflap.org/jflaptmp/july27-18/JFLAP${version}.jar";
sha256 = "oiwJXdxWsYFj6Ovu7xZbOgTLVw8160a5YQUWbgbJlAY=";
};
nativeBuildInputs = [
makeWrapper
copyDesktopItems
];
buildInputs = [
jre8
];
dontUnpack = true;
desktopItems = [
(makeDesktopItem {
name = "jflap";
desktopName = "jflap";
genericName = "Formal language application";
exec = "jflap";
icon = fetchurl {
url = "https://www.jflap.org/jflapLogo2.jpg";
sha256 = "sha256-IiworHI+GT6Fm6B0E+FXnKe+hN8nZYPrxHGZFAcsWDw=";
};
comment = meta.description;
categories = [
"Development"
"Education"
"ComputerScience"
"DataVisualization"
"Engineering"
"Java"
];
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/share/java
cp -s $src $out/share/java/jflap.jar
makeWrapper ${jre8}/bin/java $out/bin/jflap \
--prefix _JAVA_OPTIONS " " "-Dawt.useSystemAAFontSettings=gasp" \
--add-flags "-jar $out/share/java/jflap.jar"
runHook postInstall
'';
meta = with lib; {
description = "GUI tool for experimenting with formal languages topics";
homepage = "https://www.jflap.org/";
license = licenses.unfree;
sourceProvenance = with sourceTypes; [ binaryBytecode ];
maintainers = with maintainers; [
grnnja
yuu
];
platforms = jre8.meta.platforms;
};
}