summary refs log tree commit diff
path: root/pkgs/applications/networking/sync/unison/default.nix
diff options
context:
space:
mode:
authorAndres Löh <mail@andres-loeh.de>2007-08-10 08:21:31 +0000
committerAndres Löh <mail@andres-loeh.de>2007-08-10 08:21:31 +0000
commit3d519c2bed4a2ad630bd88fb330188f390bb379f (patch)
tree0c2af5ca7275ded77736100a7bb2261ef0afc45f /pkgs/applications/networking/sync/unison/default.nix
parenteb6d79c87225d265d791bd22f8dc365645b65262 (diff)
downloadnixpkgs-3d519c2bed4a2ad630bd88fb330188f390bb379f.tar
nixpkgs-3d519c2bed4a2ad630bd88fb330188f390bb379f.tar.gz
nixpkgs-3d519c2bed4a2ad630bd88fb330188f390bb379f.tar.bz2
nixpkgs-3d519c2bed4a2ad630bd88fb330188f390bb379f.tar.lz
nixpkgs-3d519c2bed4a2ad630bd88fb330188f390bb379f.tar.xz
nixpkgs-3d519c2bed4a2ad630bd88fb330188f390bb379f.tar.zst
nixpkgs-3d519c2bed4a2ad630bd88fb330188f390bb379f.zip
* add unison
  - unison uses a wrapper script to add font-schumacher-misc to the local X font path
    if the font isn't already present; this is necessary for it to work, but not terribly
    nice ...
* lablgtk is a dependency of unison
  - handling of library dirs with ocaml is a hack so far; in principle, ocaml needs
    a general setup for library dirs like ghc

svn path=/nixpkgs/trunk/; revision=9094
Diffstat (limited to 'pkgs/applications/networking/sync/unison/default.nix')
-rw-r--r--pkgs/applications/networking/sync/unison/default.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/pkgs/applications/networking/sync/unison/default.nix b/pkgs/applications/networking/sync/unison/default.nix
new file mode 100644
index 00000000000..de9d7aabc6d
--- /dev/null
+++ b/pkgs/applications/networking/sync/unison/default.nix
@@ -0,0 +1,27 @@
+{stdenv, fetchurl, ocaml, lablgtk, fontschumachermisc, xset, makeWrapper}:
+
+stdenv.mkDerivation {
+  name = "unison-2.13.16";
+  src = fetchurl {
+    url = http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.13.16.tar.gz;
+    sha256 = "808400a933aeb67654edc770822cd186d1b2adc92e7cb5836996c71c69ffe656";
+  };
+
+  buildInputs = [ocaml];
+
+  addInputsHook = "source $makeWrapper";
+  preBuild = "sed -i \"s|\\(OCAMLOPT=.*\\)$|\\1 -I $lablgtk/lib/ocaml/lablgtk2|\" Makefile.OCaml";
+  makeFlags = "UISTYLE=gtk2 INSTALLDIR=$(out)/bin/";
+  preInstall = "ensureDir $out/bin";
+  postInstall = [
+    "for i in $(cd $out/bin && ls); do"
+    "   mv $out/bin/$i $out/bin/.orig-$i;"
+    "   echo \"#! $SHELL -e\" > $out/bin/$i;"
+    "   echo \"$xset/bin/xset q | grep -q \\\"$fontschumachermisc\\\" || $xset/bin/xset +fp \\\"$fontschumachermisc/lib/X11/fonts/misc\\\"\" >> $out/bin/$i;"
+    "   echo \"exec \\\"$out/bin/.orig-$i\\\" \\\"\\\$@\\\"\" >> $out/bin/$i;"
+    "   chmod +x $out/bin/$i;"
+    "done"
+  ];
+
+  inherit lablgtk fontschumachermisc xset makeWrapper;
+}