summary refs log tree commit diff
path: root/pkgs/tools/admin
diff options
context:
space:
mode:
authorPascal Wittmann <mail@pascal-wittmann.de>2015-05-21 18:51:07 +0200
committerPascal Wittmann <mail@pascal-wittmann.de>2015-05-21 18:53:45 +0200
commit691b98fc28f0383a8e0a2683f5827b2c47fc9f2c (patch)
treeb165ab4784582bcfe4c4e3206ecd3b54784122f5 /pkgs/tools/admin
parent9ce93b6c299ccde6c97099c5f5aa88fde877eaeb (diff)
downloadnixlib-691b98fc28f0383a8e0a2683f5827b2c47fc9f2c.tar
nixlib-691b98fc28f0383a8e0a2683f5827b2c47fc9f2c.tar.gz
nixlib-691b98fc28f0383a8e0a2683f5827b2c47fc9f2c.tar.bz2
nixlib-691b98fc28f0383a8e0a2683f5827b2c47fc9f2c.tar.lz
nixlib-691b98fc28f0383a8e0a2683f5827b2c47fc9f2c.tar.xz
nixlib-691b98fc28f0383a8e0a2683f5827b2c47fc9f2c.tar.zst
nixlib-691b98fc28f0383a8e0a2683f5827b2c47fc9f2c.zip
tightvnc: refactoring
Diffstat (limited to 'pkgs/tools/admin')
-rw-r--r--pkgs/tools/admin/tightvnc/builder.sh45
-rw-r--r--pkgs/tools/admin/tightvnc/default.nix47
2 files changed, 44 insertions, 48 deletions
diff --git a/pkgs/tools/admin/tightvnc/builder.sh b/pkgs/tools/admin/tightvnc/builder.sh
deleted file mode 100644
index 10590bbfcf1e..000000000000
--- a/pkgs/tools/admin/tightvnc/builder.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-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() {
-    mkdir -p $out/bin
-    mkdir -p $out/share/man/man1
-    ./vncinstall $out/bin $out/share/man
-
-    # fix HTTP client:
-    t=$out/share/tightvnc
-    mkdir -p $t
-    sed -i "s@/usr/local/vnc/classes@$out/vnc/classes@g" $out/bin/vncserver
-    cp -r classes $t
-}
-
-genericBuild
diff --git a/pkgs/tools/admin/tightvnc/default.nix b/pkgs/tools/admin/tightvnc/default.nix
index 6feff044f06d..d6b0e80ea624 100644
--- a/pkgs/tools/admin/tightvnc/default.nix
+++ b/pkgs/tools/admin/tightvnc/default.nix
@@ -1,4 +1,5 @@
-{stdenv, fetchurl, x11, zlib, libjpeg, imake, gccmakedep, libXmu, libXaw, libXpm, libXp , perl, xauth, fontDirectories}:
+{ stdenv, fetchurl, x11, zlib, libjpeg, imake, gccmakedep, libXmu
+, libXaw, libXpm, libXp , perl, xauth, fontDirectories }:
 
 stdenv.mkDerivation {
   name = "tightvnc-1.3.10";
@@ -12,8 +13,48 @@ stdenv.mkDerivation {
   inherit xauth fontDirectories perl;
   gcc = stdenv.cc.cc;
 
-  buildInputs = [x11 zlib libjpeg imake gccmakedep libXmu libXaw libXpm libXp xauth];
-  builder = ./builder.sh;
+  buildInputs = [ x11 zlib libjpeg imake gccmakedep libXmu libXaw
+                  libXpm libXp xauth ];
+
+  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 = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/man/man1
+    ./vncinstall $out/bin $out/share/man
+
+    # fix HTTP client:
+    t=$out/share/tightvnc
+    mkdir -p $t
+    sed -i "s@/usr/local/vnc/classes@$out/vnc/classes@g" $out/bin/vncserver
+    cp -r classes $t
+  '';
 
   meta = {
     license = stdenv.lib.licenses.gpl2Plus;