summary refs log tree commit diff
path: root/pkgs/applications/science/logic/tlaplus/toolbox.nix
diff options
context:
space:
mode:
authorBadi Abdul-Wahid <abdulwahidc@gmail.com>2018-04-07 20:28:36 -0400
committerBadi Abdul-Wahid <abdulwahidc@gmail.com>2018-04-16 22:18:47 -0400
commitc4ef846c924ce35567386f7de6753511948118d9 (patch)
treedfef3b82f9fc364192a95f98554e9ed786b45541 /pkgs/applications/science/logic/tlaplus/toolbox.nix
parentd14a4760541d59f37ea6397e7616a2e6f9697779 (diff)
downloadnixpkgs-c4ef846c924ce35567386f7de6753511948118d9.tar
nixpkgs-c4ef846c924ce35567386f7de6753511948118d9.tar.gz
nixpkgs-c4ef846c924ce35567386f7de6753511948118d9.tar.bz2
nixpkgs-c4ef846c924ce35567386f7de6753511948118d9.tar.lz
nixpkgs-c4ef846c924ce35567386f7de6753511948118d9.tar.xz
nixpkgs-c4ef846c924ce35567386f7de6753511948118d9.tar.zst
nixpkgs-c4ef846c924ce35567386f7de6753511948118d9.zip
tlaplusToolbox: init at 1.5.6
Diffstat (limited to 'pkgs/applications/science/logic/tlaplus/toolbox.nix')
-rw-r--r--pkgs/applications/science/logic/tlaplus/toolbox.nix77
1 files changed, 77 insertions, 0 deletions
diff --git a/pkgs/applications/science/logic/tlaplus/toolbox.nix b/pkgs/applications/science/logic/tlaplus/toolbox.nix
new file mode 100644
index 00000000000..5ce359dea0e
--- /dev/null
+++ b/pkgs/applications/science/logic/tlaplus/toolbox.nix
@@ -0,0 +1,77 @@
+{ lib, fetchzip, makeWrapper, makeDesktopItem, stdenv
+, jre, swt, gtk, libXtst, glib
+}:
+
+let
+  version = "1.5.6";
+  arch = "x86_64";
+
+  desktopItem = makeDesktopItem rec {
+    name = "TLA+Toolbox";
+    exec = "tla-toolbox";
+    icon = "tla-toolbox";
+    comment = "IDE for TLA+";
+    desktopName = name;
+    genericName = comment;
+    categories = "Application;Development";
+    extraEntries = ''
+      StartupWMClass=TLA+ Toolbox
+    '';
+  };
+
+
+in stdenv.mkDerivation {
+  name = "tla-toolbox-${version}";
+  src = fetchzip {
+    url = "https://tla.msr-inria.inria.fr/tlatoolbox/products/TLAToolbox-${version}-linux.gtk.${arch}.zip";
+    sha256 = "1h63mcbrkf4jcg6qncpqffdi0x665z0wlfdq43d67p411xcqmbw9";
+  };
+
+  buildInputs = [ makeWrapper  ];
+
+  phases = [ "installPhase" ];
+
+  installPhase = ''
+    mkdir -p "$out/bin"
+    cp -r "$src" "$out/toolbox"
+    chmod +w "$out/toolbox" "$out/toolbox/toolbox"
+
+    patchelf \
+      --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
+      "$out/toolbox/toolbox"
+
+    makeWrapper $out/toolbox/toolbox $out/bin/tla-toolbox \
+      --run "set -x; cd $out/toolbox" \
+      --add-flags "-data ~/.tla-toolbox" \
+      --prefix PATH : "${jre}/bin" \
+      --prefix LD_LIBRARY_PATH : "${swt}/lib:${gtk}/lib:${libXtst}/lib:${glib}/lib"
+
+    echo -e "\nCreating TLA Toolbox icons..."
+    pushd "$src"
+    for icon_in in $(find . -path "./plugins/*/icons/full/etool16/tla_launch_check_wiz_*.png")
+    do
+      icon_size=$(echo $icon_in | grep -Po "wiz_\K[0-9]+")
+      icon_out="$out/share/icons/hicolor/$icon_size""x$icon_size/apps/tla-toolbox.png"
+      mkdir -p "$(dirname $icon_out)"
+      cp "$icon_in" "$icon_out"
+    done
+    popd
+
+    echo -e "\nCreating TLA Toolbox desktop entry..."
+    cp -r "${desktopItem}/share/applications"* "$out/share/applications"
+  '';
+
+  meta = {
+    homepage = http://research.microsoft.com/en-us/um/people/lamport/tla/toolbox.html;
+    description = "IDE for the TLA+ tools";
+    longDescription = ''
+      Integrated development environment for the TLA+ tools, based on Eclipse. You can use it
+      to create and edit your specs, run the PlusCal translator, view the pretty-printed
+      versions of your modules, run the TLC model checker, and run TLAPS, the TLA+ proof system.
+    '';
+    # http://lamport.azurewebsites.net/tla/license.html
+    license = with lib.licenses; [ mit ];
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.badi ];
+  };
+}