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

82 lines
1.9 KiB
Nix

{
lib,
stdenvNoCC,
fetchzip,
makeWrapper,
jdk17,
makeDesktopItem,
copyDesktopItems,
wrapGAppsHook3,
shared-mime-info,
gdk-pixbuf,
}:
stdenvNoCC.mkDerivation rec {
pname = "uppaal";
version = "5.0";
subversion = "0";
platform = "linux64";
src = fetchzip {
url = "https://download.uppaal.org/uppaal-${version}/uppaal-${version}.${subversion}/uppaal-${version}.${subversion}-${platform}.zip";
hash = "sha256-o71mP2/sDNRpmA1Qx59cvx6t4pk5pP0lrn1CogN3PuM=";
};
desktopItems = [
(makeDesktopItem {
name = "uppaal";
exec = "uppaal %U";
icon = "uppaal";
comment = "real-time modelling and verification tool";
desktopName = "Uppaal";
genericName = "Uppaal";
categories = [ "Development" ];
})
];
nativeBuildInputs = [
makeWrapper
wrapGAppsHook3
copyDesktopItems
];
buildInputs = [
jdk17
gdk-pixbuf
shared-mime-info
];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/lib/uppaal
for size in 16 32 48 64 96 128; do
install -Dm444 res/icon-"$size"x"$size".png "$out"/share/icons/hicolor/"$size"x"$size"/apps/uppaal.png
done
cp -r * $out/lib/uppaal
chmod +x $out/lib/uppaal/uppaal
makeWrapper $out/lib/uppaal/uppaal $out/bin/uppaal \
--set JAVA_HOME ${jdk17} \
--set PATH $out/lib/uppaal:$PATH \
--prefix _JAVA_OPTIONS " " "-Dawt.useSystemAAFontSettings=gasp"
runHook postInstall
'';
meta = with lib; {
description = "Integrated tool environment for modeling, validation and verification of real-time systems";
homepage = "https://uppaal.org/";
license = licenses.unfreeRedistributable;
platforms = with platforms; linux ++ darwin ++ windows;
broken = !(stdenvNoCC.hostPlatform.isLinux && stdenvNoCC.hostPlatform.isx86_64);
maintainers = with maintainers; [ mortenmunk ];
mainProgram = "uppaal";
};
}