about summary refs log tree commit diff
path: root/pkgs/tools/admin/tightvnc/builder.sh
blob: 72fced3772862c5546339eb3c84d4109d0d43fbd (plain) (blame)
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
source $stdenv/setup

patchPhase() {
  fontPath=
  for i in $fontDirectories; do
    for j in $(find $i -name fonts.dir); do
      addToSearchPathWithCustomDelimiter "," fontPath $(dirname $j)
    done
  done
}

buildPhase() {

  xmkmf
  make World

	sed -e 's@/usr/bin/perl@'$perl'/bin/perl@' \
    -e 's@unix/:7100@'$fontPath'@' \
    -i vncserver

	cd Xvnc
	sed -e 's@.* CppCmd .*@#define CppCmd		'$gcc'/bin/cpp@' -i config/cf/linux.cf
	sed -e 's@.* CppCmd .*@#define CppCmd		'$gcc'/bin/cpp@' -i config/cf/Imake.tmpl
        sed -i \
               -e 's@"uname","xauth","Xvnc","vncpasswd"@"uname","Xvnc","vncpasswd"@g' \
               -e "s@\<xauth\>@$xauth/bin/xauth@g" \
               ../vncserver
	./configure
	make
	cd ..
}

installPhase() {
    ensureDir $out/bin
    ensureDir $out/share/man/man1
    ./vncinstall $out/bin $out/share/man

    # fix HTTP client:
    t=$out/share/tightvnc
    ensureDir $t
    sed -i "s@/usr/local/vnc/classes@$out/vnc/classes@g" $out/bin/vncserver
    cp -r classes $t
}

genericBuild