summary refs log tree commit diff
path: root/pkgs/applications/office/zim
diff options
context:
space:
mode:
authorPascal Wittmann <mail@pascal-wittmann.de>2014-09-04 23:53:54 +0200
committerPascal Wittmann <mail@pascal-wittmann.de>2014-09-04 23:54:14 +0200
commit701cd705024d81b137f2ce0f3abf4730ec760b9a (patch)
tree20579c416ad393d8b4be28b04bb0ba51fdbfeabe /pkgs/applications/office/zim
parent42bb59a8a650a90ed04facc90af05e2179c1dfe3 (diff)
downloadnixpkgs-701cd705024d81b137f2ce0f3abf4730ec760b9a.tar
nixpkgs-701cd705024d81b137f2ce0f3abf4730ec760b9a.tar.gz
nixpkgs-701cd705024d81b137f2ce0f3abf4730ec760b9a.tar.bz2
nixpkgs-701cd705024d81b137f2ce0f3abf4730ec760b9a.tar.lz
nixpkgs-701cd705024d81b137f2ce0f3abf4730ec760b9a.tar.xz
nixpkgs-701cd705024d81b137f2ce0f3abf4730ec760b9a.tar.zst
nixpkgs-701cd705024d81b137f2ce0f3abf4730ec760b9a.zip
zim: fixed build; it also runs find now but the solution is hacky
Diffstat (limited to 'pkgs/applications/office/zim')
-rw-r--r--pkgs/applications/office/zim/default.nix25
1 files changed, 23 insertions, 2 deletions
diff --git a/pkgs/applications/office/zim/default.nix b/pkgs/applications/office/zim/default.nix
index cca52be1a17..658f460793f 100644
--- a/pkgs/applications/office/zim/default.nix
+++ b/pkgs/applications/office/zim/default.nix
@@ -20,8 +20,8 @@ buildPythonPackage rec {
   propagatedBuildInputs = [ pythonPackages.sqlite3 pygtk /*pythonPackages.pyxdg*/ pygobject ];
 
   preBuild = ''
-    mkdir -p $tmp/home
-    export HOME="$tmp/home"
+    mkdir -p /tmp/home
+    export HOME="/tmp/home"
   '';
   
   setupPyInstallFlags = ["--skip-xdg-cmd"];
@@ -69,6 +69,27 @@ buildPythonPackage rec {
 
     runHook postInstall
   '';
+
+  # FIXME: this is quick and dirty hack, because zim expects the
+  # path to the executable in argv[0] therefore the wrapper is
+  # modified accordingly.
+  postFixup = ''
+    wrapPythonPrograms
+
+    sed -i "s#sys\.argv\[0\] = 'zim'#sys.argv[0] = '$out/bin/zim'#g" \
+      $out/bin/.zim-wrapped
+
+    if test -e $out/nix-support/propagated-build-inputs; then
+        ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
+    fi
+
+    createBuildInputsPth build-inputs "$buildInputStrings"
+    for inputsfile in propagated-build-inputs propagated-native-build-inputs; do
+      if test -e $out/nix-support/$inputsfile; then
+          createBuildInputsPth $inputsfile "$(cat $out/nix-support/$inputsfile)"
+      fi
+    done
+  '';
   
   # Testing fails.
   doCheck = false;