diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/openrazer')
3 files changed, 106 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/openrazer/common.nix b/nixpkgs/pkgs/development/python-modules/openrazer/common.nix new file mode 100644 index 000000000000..3e801b582797 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/openrazer/common.nix @@ -0,0 +1,20 @@ +{ lib +, fetchFromGitHub +}: rec { + version = "3.7.0"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "openrazer"; + repo = "openrazer"; + rev = "v${version}"; + hash = "sha256-tjVWvJxcZ2maR99VRwMGCa+IK+1CjCc7jxAj4XkDUEw="; + }; + + meta = with lib; { + homepage = "https://openrazer.github.io/"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ evanjs ] ++ teams.lumiguide.members; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/development/python-modules/openrazer/daemon.nix b/nixpkgs/pkgs/development/python-modules/openrazer/daemon.nix new file mode 100644 index 000000000000..bf2005d06e5d --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/openrazer/daemon.nix @@ -0,0 +1,57 @@ +{ lib +, buildPythonPackage +, isPy3k +, daemonize +, dbus-python +, fetchFromGitHub +, gobject-introspection +, gtk3 +, makeWrapper +, pygobject3 +, pyudev +, setproctitle +, wrapGAppsHook +, notify2 +}: + +let + common = import ./common.nix { inherit lib fetchFromGitHub; }; +in +buildPythonPackage (common // { + pname = "openrazer-daemon"; + + disabled = !isPy3k; + + outputs = [ "out" "man" ]; + + sourceRoot = "${common.src.name}/daemon"; + + postPatch = '' + substituteInPlace openrazer_daemon/daemon.py --replace "plugdev" "openrazer" + ''; + + nativeBuildInputs = [ makeWrapper wrapGAppsHook ]; + + propagatedBuildInputs = [ + daemonize + dbus-python + gobject-introspection + gtk3 + pygobject3 + pyudev + setproctitle + notify2 + ]; + + postInstall = '' + DESTDIR="$out" PREFIX="" make manpages install-resources install-systemd + ''; + + # no tests run + doCheck = false; + + meta = common.meta // { + description = "An entirely open source user-space daemon that allows you to manage your Razer peripherals on GNU/Linux"; + mainProgram = "openrazer-daemon"; + }; +}) diff --git a/nixpkgs/pkgs/development/python-modules/openrazer/pylib.nix b/nixpkgs/pkgs/development/python-modules/openrazer/pylib.nix new file mode 100644 index 000000000000..13e7a870b00c --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/openrazer/pylib.nix @@ -0,0 +1,29 @@ +{ lib +, buildPythonPackage +, dbus-python +, fetchFromGitHub +, numpy +, openrazer-daemon +}: + +let + common = import ./common.nix { inherit lib fetchFromGitHub; }; +in +buildPythonPackage (common // { + pname = "openrazer"; + + sourceRoot = "${common.src.name}/pylib"; + + propagatedBuildInputs = [ + dbus-python + numpy + openrazer-daemon + ]; + + # no tests run + doCheck = false; + + meta = common.meta // { + description = "An entirely open source Python library that allows you to manage your Razer peripherals on GNU/Linux"; + }; +}) |