summaryrefslogtreecommitdiff
path: root/isabelle-nix-fhsenv/default.nix
blob: dd4c7f8010210760481ecb4983fd6147a6ecbcc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ pkgs ? import <nixpkgs> { } }:

with pkgs;
let
  isabelle2021_1 = stdenv.mkDerivation {
    pname = "isabelle-unpatched";
    version = "2021";

    src = fetchzip {
      url = "https://isabelle.in.tum.de/dist/Isabelle2021-1_linux.tar.gz";
      sha256 = "sha256-kJsFPcdlcV8SMWYoqUVJ0sPm7bTAhRDFJ8nddz0Pyik=";
    };

    phases = [ "buildPhase" ];
    buildPhase = ''
      mkdir -p $out
      cp -r $src/* $out
    '';
  };
  isabelle2022 = stdenv.mkDerivation {
    pname = "isabelle-unpatched";
    version = "2021";

    src = fetchzip {
      url = "https://isabelle.in.tum.de/dist/Isabelle2022_linux.tar.gz";
      sha256 = "sha256-qwcCRAa8fuGMXbI8og+kbZ0HCel1YKb34EJsc7GUz3s=";
    };

    phases = [ "buildPhase" ];
    buildPhase = ''
      mkdir -p $out
      cp -r $src/* $out
    '';
  };
  mkEnv = isabelle: buildFHSUserEnv {
    name = "isabelle";
    targetPkgs = pkgs: with pkgs; [
      dbus expat file fontconfig freetype gdb glib 
      gmp
      nspr nss udev xorg.libX11
      xorg.libXScrnSaver xorg.libXcomposite xorg.libXcursor xorg.libXdamage
      xorg.libXext xorg.libXfixes xorg.libXi xorg.libXrandr xorg.libXrender
      xorg.libXtst xorg.libxcb xorg.xcbutilkeysyms zlib
    ];
    runScript = "${isabelle.outPath}/bin/isabelle";
  };
in {
  isabelle2021_1 = mkEnv isabelle2021_1;
  isabelle2022 = mkEnv isabelle2022;
}