2018-04-08 01:28:36 +01:00
|
|
|
{ lib, fetchzip, makeWrapper, makeDesktopItem, stdenv
|
2021-03-11 10:35:25 +00:00
|
|
|
, gtk3, libXtst, glib, zlib
|
2018-04-08 01:28:36 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
desktopItem = makeDesktopItem rec {
|
|
|
|
name = "TLA+Toolbox";
|
|
|
|
exec = "tla-toolbox";
|
|
|
|
icon = "tla-toolbox";
|
|
|
|
comment = "IDE for TLA+";
|
|
|
|
desktopName = name;
|
|
|
|
genericName = comment;
|
2020-06-25 03:18:37 +01:00
|
|
|
categories = "Development";
|
2018-04-08 01:28:36 +01:00
|
|
|
extraEntries = ''
|
|
|
|
StartupWMClass=TLA+ Toolbox
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2021-03-11 10:35:25 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "tla-toolbox";
|
2021-03-11 10:35:25 +00:00
|
|
|
version = "1.7.1";
|
2018-04-08 01:28:36 +01:00
|
|
|
src = fetchzip {
|
2021-03-11 10:35:25 +00:00
|
|
|
url = "https://tla.msr-inria.inria.fr/tlatoolbox/products/TLAToolbox-${version}-linux.gtk.x86_64.zip";
|
|
|
|
sha256 = "02a2y2mkfab5cczw8g604m61h4xr0apir49zbd1aq6mmgcgngw80";
|
2018-04-08 01:28:36 +01:00
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2018-04-08 01:28:36 +01:00
|
|
|
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-03-11 10:35:25 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2018-04-08 01:28:36 +01:00
|
|
|
mkdir -p "$out/bin"
|
|
|
|
cp -r "$src" "$out/toolbox"
|
2019-08-04 15:27:13 +01:00
|
|
|
chmod -R +w "$out/toolbox"
|
2018-04-08 01:28:36 +01:00
|
|
|
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
|
|
|
"$out/toolbox/toolbox"
|
|
|
|
|
2019-08-04 15:27:13 +01:00
|
|
|
patchelf \
|
|
|
|
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
2021-03-11 10:35:25 +00:00
|
|
|
--set-rpath "${lib.makeLibraryPath [ zlib ]}:$(patchelf --print-rpath $(find "$out/toolbox" -name java))" \
|
2019-08-04 15:27:13 +01:00
|
|
|
"$(find "$out/toolbox" -name java)"
|
|
|
|
|
2021-03-11 10:35:25 +00:00
|
|
|
patchelf \
|
|
|
|
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
|
|
|
|
"$(find "$out/toolbox" -name jspawnhelper)"
|
|
|
|
|
2018-04-08 01:28:36 +01:00
|
|
|
makeWrapper $out/toolbox/toolbox $out/bin/tla-toolbox \
|
|
|
|
--run "set -x; cd $out/toolbox" \
|
|
|
|
--add-flags "-data ~/.tla-toolbox" \
|
2021-03-11 10:35:25 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ gtk3 libXtst glib zlib ]}"
|
2018-04-08 01:28:36 +01:00
|
|
|
|
|
|
|
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"
|
2021-03-11 10:35:25 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2018-04-08 01:28:36 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://research.microsoft.com/en-us/um/people/lamport/tla/toolbox.html";
|
2018-04-08 01:28:36 +01:00
|
|
|
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 ];
|
2021-03-11 10:35:25 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2020-09-09 16:40:46 +01:00
|
|
|
maintainers = [ ];
|
2018-04-08 01:28:36 +01:00
|
|
|
};
|
|
|
|
}
|