1{ stdenv, fetchurl, xlibsWrapper, zlib, libjpeg, imake, gccmakedep, libXmu
2, libXaw, libXpm, libXp , perl, xauth, fontDirectories, openssh }:
3
4stdenv.mkDerivation {
5 name = "tightvnc-1.3.10";
6
7 src = fetchurl {
8 url = mirror://sourceforge/vnc-tight/tightvnc-1.3.10_unixsrc.tar.bz2;
9 sha256 = "f48c70fea08d03744ae18df6b1499976362f16934eda3275cead87baad585c0d";
10 };
11
12 # for the builder script
13 inherit xauth fontDirectories perl;
14 gcc = stdenv.cc.cc;
15
16 buildInputs = [ xlibsWrapper zlib libjpeg imake gccmakedep libXmu libXaw
17 libXpm libXp xauth openssh ];
18
19 patchPhase = ''
20 fontPath=
21 for i in $fontDirectories; do
22 for j in $(find $i -name fonts.dir); do
23 addToSearchPathWithCustomDelimiter "," fontPath $(dirname $j)
24 done
25 done
26
27 sed -i "s@/usr/bin/ssh@${openssh}/bin/ssh@g" vncviewer/vncviewer.h
28 '';
29
30 buildPhase = ''
31 xmkmf
32 make World
33 sed -e 's@/usr/bin/perl@${perl}/bin/perl@' \
34 -e 's@unix/:7100@'$fontPath'@' \
35 -i vncserver
36
37 cd Xvnc
38 sed -e 's@.* CppCmd .*@#define CppCmd '$gcc'/bin/cpp@' -i config/cf/linux.cf
39 sed -e 's@.* CppCmd .*@#define CppCmd '$gcc'/bin/cpp@' -i config/cf/Imake.tmpl
40 sed -i \
41 -e 's@"uname","xauth","Xvnc","vncpasswd"@"uname","Xvnc","vncpasswd"@g' \
42 -e "s@\<xauth\>@${xauth}/bin/xauth@g" \
43 ../vncserver
44 ./configure
45 make
46 cd ..
47 '';
48
49 installPhase = ''
50 mkdir -p $out/bin
51 mkdir -p $out/share/man/man1
52 ./vncinstall $out/bin $out/share/man
53
54 # fix HTTP client:
55 t=$out/share/tightvnc
56 mkdir -p $t
57 sed -i "s@/usr/local/vnc/classes@$out/vnc/classes@g" $out/bin/vncserver
58 cp -r classes $t
59 '';
60
61 meta = {
62 license = stdenv.lib.licenses.gpl2Plus;
63 homepage = "http://vnc-tight.sourceforge.net/";
64 description = "Improved version of VNC";
65
66 longDescription = ''
67 TightVNC is an improved version of VNC, the great free
68 remote-desktop tool. The improvements include bandwidth-friendly
69 "tight" encoding, file transfers in the Windows version, enhanced
70 GUI, many bugfixes, and more.
71 '';
72
73 maintainers = [];
74 platforms = stdenv.lib.platforms.unix;
75 };
76}