summaryrefslogtreecommitdiffstats
path: root/pkgs/servers/computing/slurm-spank-x11/default.nix
blob: 8e64185e71c673f2d6c1497b58b9d7c6c1cbc970 (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
{ lib, stdenv, fetchFromGitHub, slurm } :
let
  version = "0.2.5";
in
stdenv.mkDerivation {
  name = "slurm-spank-x11-${version}";
  version = version;

  src = fetchFromGitHub {
    owner = "hautreux";
    repo = "slurm-spank-x11";
    rev = version;
    sha256 = "1dmsr7whxcxwnlvl1x4s3bqr5cr6q5ssb28vqi67w5hj4sshisry";
  };

  buildPhase = ''
      gcc -DX11_LIBEXEC_PROG="\"$out/bin/slurm-spank-x11\"" \
          -g -o slurm-spank-x11 slurm-spank-x11.c
      gcc -I${slurm.dev}/include -DX11_LIBEXEC_PROG="\"$out/bin/slurm-spank-x11\"" -shared -fPIC \
          -g -o x11.so slurm-spank-x11-plug.c
    '';

  installPhase = ''
      mkdir -p $out/bin $out/lib
      install -m 755 slurm-spank-x11 $out/bin
      install -m 755 x11.so $out/lib
    '';

  meta = with lib; {
    homepage = "https://github.com/hautreux/slurm-spank-x11";
    description = "Plugin for SLURM to allow for interactive X11 sessions";
    platforms = platforms.linux;
    license = licenses.gpl3;
    maintainers = with maintainers; [ markuskowa ];
  };
}