nixpkgs/pkgs/applications/misc/calcurse/default.nix
Maximilian Bosch c99a01aa7a 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 <module>
    import httplib2
ModuleNotFoundError: No module named 'httplib2'
```

The easiest workaround is to use the `wrapPython` tool to properly patch
library path inside the script.
2019-05-12 16:54:30 +02:00

35 lines
1.2 KiB
Nix

{ stdenv, fetchurl, ncurses, gettext, python3, python3Packages, makeWrapper }:
stdenv.mkDerivation rec {
name = "calcurse-${version}";
version = "4.4.0";
src = fetchurl {
url = "https://calcurse.org/files/${name}.tar.gz";
sha256 = "0vw2xi6a2lrhrb8n55zq9lv4mzxhby4xdf3hmi1vlfpyrpdwkjzd";
};
buildInputs = [ ncurses gettext python3 python3Packages.wrapPython ];
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
patchShebangs .
buildPythonPath ${python3Packages.httplib2}
patchPythonScript $out/bin/calcurse-caldav
'';
meta = with stdenv.lib; {
description = "A calendar and scheduling application for the command line";
longDescription = ''
calcurse is a calendar and scheduling application for the command line. It helps
keep track of events, appointments and everyday tasks. A configurable notification
system reminds users of upcoming deadlines, the curses based interface can be
customized to suit user needs and a very powerful set of command line options can
be used to filter and format appointments, making it suitable for use in scripts.
'';
homepage = http://calcurse.org/;
license = licenses.bsd2;
platforms = platforms.linux;
};
}