summaryrefslogtreecommitdiffstats
path: root/makefu/5pkgs/novnc/default.nix
blob: 7da8e9be1b74a545a7a415fab26cb56ba12d59f4 (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
{ stdenv, fetchurl, pkgs }:
# source: https://github.com/hyphon81/Nixtack/blob/master/noVNC/noVNC.nix
let
in

stdenv.mkDerivation rec {
  name = "novnc-${version}";
  version = "0.6.2";

  src = fetchurl {
    url = "https://github.com/novnc/noVNC/archive/v${version}.tar.gz";
    sha256 = "16ygbdzdmnfg9a26d9il4a6fr16qmq0ix9imfbpzl0drfbj7z8kh";
  };
  p = stdenv.lib.makeBinPath [ pkgs.nettools pkgs.python27Packages.websockify
                               pkgs.coreutils pkgs.which pkgs.procps ];
  patchPhase = ''
    sed -i '1aset -efu\nexport PATH=${p}\n' utils/launch.sh
  '';
  installPhase = ''
    mkdir -p $out/bin
    cp utils/launch.sh $out/bin/launch-novnc.sh
    chmod +x $out/bin/launch-novnc.sh
    mkdir -p $out/images
    cp -r images/* $out/images/
    mkdir -p $out/include
    cp -r include/* $out/include/
    cp favicon.ico $out
    cp vnc.html $out
    cp vnc_auto.html $out
  '';

  meta = with stdenv.lib; {
    homepage = http://novnc.com/info.html;
    repositories.git = git://github.com/novnc/noVNC.git;
    description = ''
      A HTML5 VNC Client
    '';
    license = licenses.mpl20;
  };
}