diff --git a/pkgs/applications/office/zim/default.nix b/pkgs/applications/office/zim/default.nix index cca52be1a17f..658f460793f1 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;