From 42960fb742d939c37be1fdd14d69ad51d0a852e3 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Mon, 29 Oct 2018 14:59:01 -0400 Subject: [PATCH] pythonPackages.mps-youtube: refactor move to python-modules --- .../python-modules/mps-youtube/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 33 +--------------- 2 files changed, 40 insertions(+), 32 deletions(-) create mode 100644 pkgs/development/python-modules/mps-youtube/default.nix diff --git a/pkgs/development/python-modules/mps-youtube/default.nix b/pkgs/development/python-modules/mps-youtube/default.nix new file mode 100644 index 000000000000..4a3ff00f8352 --- /dev/null +++ b/pkgs/development/python-modules/mps-youtube/default.nix @@ -0,0 +1,39 @@ +{ stdenv +, buildPythonPackage +, fetchFromGitHub +, isPy3k +, pafy +}: + +buildPythonPackage rec { + name = "mps-youtube-${version}"; + version = "0.2.7.1"; + disabled = (!isPy3k); + + src = fetchFromGitHub { + owner = "mps-youtube"; + repo = "mps-youtube"; + rev = "v${version}"; + sha256 = "16zn5gwb3568w95lr21b88zkqlay61p1541sa9c3x69zpi8v0pys"; + }; + + propagatedBuildInputs = [ pafy ]; + + # disabled due to error in loading unittest + # don't know how to make test from: + doCheck = false; + + # before check create a directory and redirect XDG_CONFIG_HOME to it + preCheck = '' + mkdir -p check-phase + export XDG_CONFIG_HOME=$(pwd)/check-phase + ''; + + meta = with stdenv.lib; { + description = "Terminal based YouTube player and downloader"; + homepage = https://github.com/np1/mps-youtube; + license = licenses.gpl3; + maintainers = with maintainers; [ odi ]; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e8f3c5eb910c..cd1c39992051 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4471,38 +4471,7 @@ in { maildir-deduplicate = callPackage ../development/python-modules/maildir-deduplicate { }; - mps-youtube = buildPythonPackage rec { - name = "mps-youtube-${version}"; - version = "0.2.7.1"; - - disabled = (!isPy3k); - - # disabled due to error in loading unittest - # don't know how to make test from: - doCheck = false; - - # before check create a directory and redirect XDG_CONFIG_HOME to it - preCheck = '' - mkdir -p check-phase - export XDG_CONFIG_HOME=$(pwd)/check-phase - ''; - - src = pkgs.fetchFromGitHub { - owner = "mps-youtube"; - repo = "mps-youtube"; - rev = "v${version}"; - sha256 = "16zn5gwb3568w95lr21b88zkqlay61p1541sa9c3x69zpi8v0pys"; - }; - - propagatedBuildInputs = with self; [ pafy ]; - - meta = with stdenv.lib; { - description = "Terminal based YouTube player and downloader"; - homepage = https://github.com/np1/mps-youtube; - license = licenses.gpl3; - maintainers = with maintainers; [ odi ]; - }; - }; + mps-youtube = callPackage ../development/python-modules/mps-youtube { }; d2to1 = callPackage ../development/python-modules/d2to1 { };