diff options
author | Domen Kožar <domen@dev.si> | 2015-11-20 13:48:30 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2015-11-21 21:44:12 +0100 |
commit | 704c8bab410a077a89e25c8c9fbb76a8da97625e (patch) | |
tree | a1312683d41cfe6569e9442db23ba304d0fb8b32 /pkgs/applications/office | |
parent | 99a64da6001f5e4fec363b6a98afccda61b6d68f (diff) | |
download | nixpkgs-704c8bab410a077a89e25c8c9fbb76a8da97625e.tar nixpkgs-704c8bab410a077a89e25c8c9fbb76a8da97625e.tar.gz nixpkgs-704c8bab410a077a89e25c8c9fbb76a8da97625e.tar.bz2 nixpkgs-704c8bab410a077a89e25c8c9fbb76a8da97625e.tar.lz nixpkgs-704c8bab410a077a89e25c8c9fbb76a8da97625e.tar.xz nixpkgs-704c8bab410a077a89e25c8c9fbb76a8da97625e.tar.zst nixpkgs-704c8bab410a077a89e25c8c9fbb76a8da97625e.zip |
buildPythonPackage: fix standalone applications using it
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r-- | pkgs/applications/office/zim/default.nix | 74 |
1 files changed, 5 insertions, 69 deletions
diff --git a/pkgs/applications/office/zim/default.nix b/pkgs/applications/office/zim/default.nix index 96749c665b6..d5163eef4d8 100644 --- a/pkgs/applications/office/zim/default.nix +++ b/pkgs/applications/office/zim/default.nix @@ -11,89 +11,25 @@ buildPythonPackage rec { name = "zim-${version}"; version = "0.63"; namePrefix = ""; - + src = fetchurl { url = "http://zim-wiki.org/downloads/${name}.tar.gz"; sha256 = "077vf4h0hjmbk8bxj9l0z9rxcb3dw642n32lvfn6vjdna1qm910m"; }; - propagatedBuildInputs = [ pythonPackages.sqlite3 pygtk /*pythonPackages.pyxdg*/ pygobject ]; + propagatedBuildInputs = [ pythonPackages.sqlite3 pygtk pythonPackages.pyxdg pygobject ]; preBuild = '' mkdir -p /tmp/home export HOME="/tmp/home" - ''; - - setupPyBuildFlags = ["--skip-xdg-cmd"]; - - # - # Exactly identical to buildPythonPackage's version but for the - # `--old-and-unmanagable`, which I removed. This was removed because - # this is a setuptools specific flag and as zim is overriding - # the install step, setuptools could not perform its monkey - # patching trick for the command. Alternate solutions were to - # - # - Remove the custom install step (tested as working but - # also remove the possibility of performing the xdg-cmd - # stuff). - # - Explicitly replace distutils import(s) by their setuptools - # equivalent (untested). - # - # Both solutions were judged unsatisfactory as altering the code - # would be required. - # - # Note that a improved solution would be to expose the use of - # the `--old-and-unmanagable` flag as an option of passed to the - # buildPythonPackage function. - # - # Also note that I stripped all comments. - # - installPhase = '' - runHook preInstall - - mkdir -p "$out/lib/${python.libPrefix}/site-packages" - - export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH" - - ${python}/bin/${python.executable} setup.py install \ - --install-lib=$out/lib/${python.libPrefix}/site-packages \ - --prefix="$out" ${lib.concatStringsSep " " setupPyBuildFlags} - eapth="$out/lib/${python.libPrefix}"/site-packages/easy-install.pth - if [ -e "$eapth" ]; then - # move colliding easy_install.pth to specifically named one - mv "$eapth" $(dirname "$eapth")/${name}.pth - fi - - rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py* - - runHook postInstall + sed -i '/zim_install_class,/d' setup.py ''; - # 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 = '' - wrapProgram "$out/bin/zim" \ - --prefix XDG_DATA_DIRS : "$out/share" - - wrapPythonPrograms - - sed -i "s#sys\.argv\[0\] = '.zim-wrapped'#sys.argv[0] = '$out/bin/zim'#g" \ - $out/bin/..zim-wrapped-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 + preFixup = '' + export makeWrapperArgs="--prefix XDG_DATA_DIRS : $out/share --argv0 $out/bin/.zim-wrapped" ''; - # Testing fails. doCheck = false; |