From c99a01aa7a82f10535678bf22ff348939a1bbb7a Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 12 May 2019 11:15:39 +0200 Subject: [PATCH] calcurse: fix python3 wrapper The current Python wrapper for `httplib2` breaks when running e.g. `./result/bin/calcurse-caldav` with the following error: ``` Traceback (most recent call last): File "./result/bin/calcurse-caldav", line 6, in import httplib2 ModuleNotFoundError: No module named 'httplib2' ``` The easiest workaround is to use the `wrapPython` tool to properly patch library path inside the script. --- pkgs/applications/misc/calcurse/default.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/misc/calcurse/default.nix b/pkgs/applications/misc/calcurse/default.nix index e6dafe4d08af..dc0460c2a233 100644 --- a/pkgs/applications/misc/calcurse/default.nix +++ b/pkgs/applications/misc/calcurse/default.nix @@ -9,17 +9,13 @@ stdenv.mkDerivation rec { sha256 = "0vw2xi6a2lrhrb8n55zq9lv4mzxhby4xdf3hmi1vlfpyrpdwkjzd"; }; - buildInputs = [ ncurses gettext python3 ]; + buildInputs = [ ncurses gettext python3 python3Packages.wrapPython ]; nativeBuildInputs = [ makeWrapper ]; - # Build Python environment with httplib2 for calcurse-caldav - pythonEnv = python3Packages.python.buildEnv.override { - extraLibs = [ python3Packages.httplib2 ]; - }; - propagatedBuildInputs = [ pythonEnv ]; - postInstall = '' - substituteInPlace $out/bin/calcurse-caldav --replace /usr/bin/python3 ${pythonEnv}/bin/python3 + patchShebangs . + buildPythonPath ${python3Packages.httplib2} + patchPythonScript $out/bin/calcurse-caldav ''; meta = with stdenv.lib; {