From f6a29fbb69654df4e94468b94587240b4edb812b Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Mon, 15 Oct 2018 15:01:43 -0400 Subject: [PATCH] pythonPackages.deskcon: refactor move to python-modules --- .../python-modules/deskcon/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 34 +-------------- 2 files changed, 42 insertions(+), 33 deletions(-) create mode 100644 pkgs/development/python-modules/deskcon/default.nix diff --git a/pkgs/development/python-modules/deskcon/default.nix b/pkgs/development/python-modules/deskcon/default.nix new file mode 100644 index 000000000000..05fa3aa835a3 --- /dev/null +++ b/pkgs/development/python-modules/deskcon/default.nix @@ -0,0 +1,41 @@ +{ stdenv +, buildPythonPackage +, pyopenssl +, pkgs +, isPy3k +, python +}: + +buildPythonPackage rec { + name = "deskcon-0.3"; + disabled = isPy3k; + + src = pkgs.fetchFromGitHub { + owner= "screenfreeze"; + repo = "deskcon-desktop"; + rev = "267804122188fa79c37f2b21f54fe05c898610e6"; + sha256 ="0i1dd85ls6n14m9q7lkympms1w3x0pqyaxvalq82s4xnjdv585j3"; + }; + + phases = [ "unpackPhase" "installPhase" ]; + + pythonPath = [ pyopenssl pkgs.gtk3 ]; + + installPhase = '' + substituteInPlace server/deskcon-server --replace "python2" "python" + + mkdir -p $out/bin + mkdir -p $out/lib/${python.libPrefix}/site-packages + cp -r "server/"* $out/lib/${python.libPrefix}/site-packages + mv $out/lib/${python.libPrefix}/site-packages/deskcon-server $out/bin/deskcon-server + + wrapPythonProgramsIn $out/bin "$out $pythonPath" + ''; + + meta = with stdenv.lib; { + description = "Integrates an Android device into a desktop"; + homepage = https://github.com/screenfreeze/deskcon-desktop; + license = licenses.gpl3; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e98589422fc8..fb155334939d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1664,39 +1664,7 @@ in { derpconf = callPackage ../development/python-modules/derpconf { }; - deskcon = self.buildPythonPackage rec { - name = "deskcon-0.3"; - disabled = !isPy27; - - src = pkgs.fetchFromGitHub { - owner= "screenfreeze"; - repo = "deskcon-desktop"; - rev = "267804122188fa79c37f2b21f54fe05c898610e6"; - sha256 ="0i1dd85ls6n14m9q7lkympms1w3x0pqyaxvalq82s4xnjdv585j3"; - }; - - phases = [ "unpackPhase" "installPhase" ]; - - pythonPath = [ self.pyopenssl pkgs.gtk3 ]; - - installPhase = '' - substituteInPlace server/deskcon-server --replace "python2" "python" - - mkdir -p $out/bin - mkdir -p $out/lib/${python.libPrefix}/site-packages - cp -r "server/"* $out/lib/${python.libPrefix}/site-packages - mv $out/lib/${python.libPrefix}/site-packages/deskcon-server $out/bin/deskcon-server - - wrapPythonProgramsIn $out/bin "$out $pythonPath" - ''; - - meta = { - description = "Integrates an Android device into a desktop"; - homepage = https://github.com/screenfreeze/deskcon-desktop; - license = licenses.gpl3; - }; - }; - + deskcon = callPackage ../development/python-modules/deskcon { }; dill = callPackage ../development/python-modules/dill { };