nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenvNoCC,
4 fetchzip,
5 makeWrapper,
6 jdk17,
7 makeDesktopItem,
8 copyDesktopItems,
9 wrapGAppsHook3,
10 shared-mime-info,
11 gdk-pixbuf,
12}:
13
14stdenvNoCC.mkDerivation rec {
15 pname = "uppaal";
16 version = "5.0";
17 subversion = "0";
18 platform = "linux64";
19
20 src = fetchzip {
21 url = "https://download.uppaal.org/uppaal-${version}/uppaal-${version}.${subversion}/uppaal-${version}.${subversion}-${platform}.zip";
22 hash = "sha256-o71mP2/sDNRpmA1Qx59cvx6t4pk5pP0lrn1CogN3PuM=";
23 };
24
25 desktopItems = [
26 (makeDesktopItem {
27 name = "uppaal";
28 exec = "uppaal %U";
29 icon = "uppaal";
30 comment = "real-time modelling and verification tool";
31 desktopName = "Uppaal";
32 genericName = "Uppaal";
33 categories = [ "Development" ];
34 })
35 ];
36
37 nativeBuildInputs = [
38 makeWrapper
39 wrapGAppsHook3
40 copyDesktopItems
41 ];
42
43 buildInputs = [
44 jdk17
45 gdk-pixbuf
46 shared-mime-info
47 ];
48
49 dontBuild = true;
50
51 installPhase = ''
52 runHook preInstall
53
54 mkdir -p $out/bin
55 mkdir -p $out/lib/uppaal
56 for size in 16 32 48 64 96 128; do
57 install -Dm444 res/icon-"$size"x"$size".png "$out"/share/icons/hicolor/"$size"x"$size"/apps/uppaal.png
58 done
59
60 cp -r * $out/lib/uppaal
61
62 chmod +x $out/lib/uppaal/uppaal
63
64 makeWrapper $out/lib/uppaal/uppaal $out/bin/uppaal \
65 --set JAVA_HOME ${jdk17} \
66 --set PATH $out/lib/uppaal:$PATH \
67 --prefix _JAVA_OPTIONS " " "-Dawt.useSystemAAFontSettings=gasp"
68
69 runHook postInstall
70 '';
71
72 meta = {
73 description = "Integrated tool environment for modeling, validation and verification of real-time systems";
74 homepage = "https://uppaal.org/";
75 license = lib.licenses.unfreeRedistributable;
76 platforms = with lib.platforms; linux ++ darwin ++ windows;
77 broken = !(stdenvNoCC.hostPlatform.isLinux && stdenvNoCC.hostPlatform.isx86_64);
78 maintainers = with lib.maintainers; [ mortenmunk ];
79 mainProgram = "uppaal";
80 };
81}