1 { stdenv, lib, buildPythonPackage, fetchFromGitHub, fetchpatch, keyring, mock, pytestCheckHook }:
3 buildPythonPackage rec {
7 src = fetchFromGitHub {
11 sha256 = "15z1wpq6s69s76r6akzgg340bpc21l2r1j8270gp7i1rpnffcjwm";
15 # fix naming of the DOCUMENTS dir
17 url = "https://github.com/rski/plyer/commit/99dabb2d62248fc3ea5705c2720abf71c9fc378b.patch";
18 sha256 = "sha256-bbnw0TxH4FGTso5dopzquDCjrjZAy+6CJauqi/nfstA=";
20 # fix handling of the ~/.config/user-dirs.dir file
22 url = "https://github.com/rski/plyer/commit/f803697a1fe4fb5e9c729ee6ef1997b8d64f3ccd.patch";
23 sha256 = "sha256-akuh//P5puz2PwcBRXZQ4KoGk+fxi4jn2H3pTIT5M78=";
29 # remove all the wifi stuff. Depends on a python wifi module that has not been updated since 2016
30 find -iname "wifi*" -exec rm {} \;
31 substituteInPlace plyer/__init__.py \
32 --replace "wifi = Proxy('wifi', facades.Wifi)" "" \
34 substituteInPlace plyer/facades/__init__.py \
35 --replace "from plyer.facades.wifi import Wifi" ""
38 propagatedBuildInputs = [ keyring ];
40 checkInputs = [ mock pytestCheckHook ];
42 pytestFlagsArray = [ "plyer/tests" ];
44 # assumes dbus is not installed, it fails and is not very robust.
45 "test_notification_notifysend"
46 # fails during nix-build, but I am not able to explain why.
47 # The test and the API under test do work outside the nix build.
52 mkdir -p $HOME/.config/ $HOME/Pictures
55 pythonImportsCheck = [ "plyer" ];
58 broken = stdenv.isDarwin;
59 description = "Plyer is a platform-independent api to use features commonly found on various platforms";
60 homepage = "https://github.com/kivy/plyer";
61 license = licenses.mit;
62 maintainers = with maintainers; [ rski ];