Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.09 1.4 kB view raw
1{ stdenv, buildPythonApplication, fetchPypi, isPy36, dataclasses, libX11, libXinerama, libXrandr }: 2 3buildPythonApplication rec { 4 pname = "screeninfo"; 5 version = "0.6.5"; 6 7 src = fetchPypi { 8 inherit pname version; 9 sha256 = "0vcw54crdgmbzwlrfg80kd1a8p9i10yks8k0szzi0k5q80zhp8xz"; 10 }; 11 12 # dataclasses is a compatibility shim for python 3.6 ONLY 13 patchPhase = if isPy36 then "" else '' 14 substituteInPlace setup.py \ 15 --replace "\"dataclasses\"," "" 16 '' + '' 17 substituteInPlace screeninfo/enumerators/xinerama.py \ 18 --replace "load_library(\"X11\")" "ctypes.cdll.LoadLibrary(\"${libX11}/lib/libX11.so\")" \ 19 --replace "load_library(\"Xinerama\")" "ctypes.cdll.LoadLibrary(\"${libXinerama}/lib/libXinerama.so\")" 20 substituteInPlace screeninfo/enumerators/xrandr.py \ 21 --replace "load_library(\"X11\")" "ctypes.cdll.LoadLibrary(\"${libX11}/lib/libX11.so\")" \ 22 --replace "load_library(\"Xrandr\")" "ctypes.cdll.LoadLibrary(\"${libXrandr}/lib/libXrandr.so\")" 23 ''; 24 25 propagatedBuildInputs = stdenv.lib.optional isPy36 dataclasses; 26 27 buildInputs = [ libX11 libXinerama libXrandr]; 28 29 meta = with stdenv.lib; { 30 description = "Fetch location and size of physical screens"; 31 homepage = "https://github.com/rr-/screeninfo"; 32 license = licenses.mit; 33 maintainers = [ maintainers.nickhu ]; 34 }; 35}