From 387e803f3071c0ef35d919a85f8574dd11eb3d09 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Thu, 29 Dec 2022 11:21:17 +0100 Subject: [PATCH 1/3] yewtube: init at 2.9.0 --- pkgs/applications/misc/yewtube/default.nix | 48 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 50 insertions(+) create mode 100644 pkgs/applications/misc/yewtube/default.nix diff --git a/pkgs/applications/misc/yewtube/default.nix b/pkgs/applications/misc/yewtube/default.nix new file mode 100644 index 000000000000..f217c7b0e9a5 --- /dev/null +++ b/pkgs/applications/misc/yewtube/default.nix @@ -0,0 +1,48 @@ +{ lib, python3Packages, fetchFromGitHub }: + +python3Packages.buildPythonApplication rec { + pname = "yewtube"; + version = "2.9.0"; + + src = fetchFromGitHub { + owner = "iamtalhaasghar"; + repo = "yewtube"; + rev = "v${version}"; + hash = "sha256-8GL2ZvRHtnnLZ07nQk3irJUj+XLL+pyUUA+JJPICPRA="; + }; + + postPatch = '' + # Don't try to detect the version at runtime with pip + substituteInPlace mps_youtube/__init__.py \ + --replace "from pip._vendor import pkg_resources" "" \ + --replace "__version__ =" "__version__ = '${version}' #" + # https://github.com/iamtalhaasghar/yewtube/pull/105 + sed -ie '/pyreadline/d' requirements.txt + ''; + + propagatedBuildInputs = with python3Packages; [ + pyperclip + requests + youtube-search-python + yt-dlp + ]; + + checkInputs = with python3Packages; [ + pytestCheckHook + dbus-python + pygobject3 + ]; + + preCheck = '' + export XDG_CONFIG_HOME=$(mktemp -d) + ''; + + pythonImportsCheck = [ "mps_youtube" ]; + + meta = with lib; { + description = "Terminal based YouTube player and downloader, forked from mps-youtube"; + homepage = "https://github.com/iamtalhaasghar/yewtube"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ fgaz koral ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 61a8fa4bc024..90ebe7d81cd5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33880,6 +33880,8 @@ with pkgs; yelp-tools = callPackage ../development/misc/yelp-tools { }; + yewtube = callPackage ../applications/misc/yewtube { }; + yokadi = python3Packages.callPackage ../applications/misc/yokadi {}; yoshimi = callPackage ../applications/audio/yoshimi { }; From e6f7cba33a64a89c76416041d2a614da40b33d93 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Thu, 29 Dec 2022 11:27:18 +0100 Subject: [PATCH 2/3] mps-youtube: remove in favor of yewtube --- .../applications/misc/mps-youtube/default.nix | 34 ------------------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 pkgs/applications/misc/mps-youtube/default.nix diff --git a/pkgs/applications/misc/mps-youtube/default.nix b/pkgs/applications/misc/mps-youtube/default.nix deleted file mode 100644 index b1118cfc5977..000000000000 --- a/pkgs/applications/misc/mps-youtube/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ lib, python3Packages, fetchFromGitHub }: - -with python3Packages; - -buildPythonApplication rec { - pname = "mps-youtube"; - version = "unstable-2020-01-28"; - - src = fetchFromGitHub { - owner = "mps-youtube"; - repo = "mps-youtube"; - rev = "b808697133ec2ad7654953232d1e841b20aa7cc3"; - sha256 = "0lqprlpc0v092xqkjc0cc395ag45lijwgd34dpg2jy6i0f2szywv"; - }; - - 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 lib; { - description = "Terminal based YouTube player and downloader"; - homepage = "https://github.com/mps-youtube/mps-youtube"; - license = licenses.gpl3; - maintainers = with maintainers; [ koral odi ]; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index ef36289e05c1..a9974b93964b 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -976,6 +976,7 @@ mapAliases ({ mpc_cli = mpc-cli; # moved from top-level 2022-01-24 mpd_clientlib = libmpdclient; # Added 2021-02-11 mpich2 = throw "'mpich2' has been renamed to/replaced by 'mpich'"; # Converted to throw 2022-02-22 + mps-youtube = throw "'mps-youtube' has been removed as it's unmaintained and stopped working. Use 'yewtube', a maintained fork"; # Added 2022-12-29 mqtt-bench = throw "mqtt-bench has been dropped due to the lack of maintenance from upstream since 2017"; # Added 2022-06-02 msf = throw "'msf' has been renamed to/replaced by 'metasploit'"; # Converted to throw 2022-02-22 multimc = throw "multimc was removed from nixpkgs; use prismlauncher instead (see https://github.com/NixOS/nixpkgs/pull/154051 for more information)"; # Added 2022-01-08 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 90ebe7d81cd5..e8e487d98fed 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31089,8 +31089,6 @@ with pkgs; mpc-qt = libsForQt5.callPackage ../applications/video/mpc-qt { }; - mps-youtube = callPackage ../applications/misc/mps-youtube { }; - mplayer = callPackage ../applications/video/mplayer ({ libdvdnav = libdvdnav_4_2_1; } // (config.mplayer or {})); From 703b1c17a5f5777a93e4230d2b41fd66b6a57ad7 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Thu, 29 Dec 2022 11:36:39 +0100 Subject: [PATCH 3/3] python3Packages.pafy: remove All its reverse dependencies were removed --- .../python-modules/pafy/default.nix | 23 ------------------- pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 -- 3 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 pkgs/development/python-modules/pafy/default.nix diff --git a/pkgs/development/python-modules/pafy/default.nix b/pkgs/development/python-modules/pafy/default.nix deleted file mode 100644 index c657a2fa1b12..000000000000 --- a/pkgs/development/python-modules/pafy/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ lib, buildPythonPackage, youtube-dl, fetchPypi }: -buildPythonPackage rec { - pname = "pafy"; - version = "0.5.5"; - - src = fetchPypi { - inherit pname version; - sha256 = "364f1d1312c89582d97dc7225cf6858cde27cb11dfd64a9c2bab1a2f32133b1e"; - }; - - # No tests included in archive - doCheck = false; - - propagatedBuildInputs = [ youtube-dl ]; - - meta = with lib; { - description = "A library to download YouTube content and retrieve metadata"; - homepage = "https://github.com/mps-youtube/pafy"; - license = licenses.lgpl3Plus; - maintainers = with maintainers; [ odi ]; - }; -} - diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 84b81abbd981..930a73733ccd 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -129,6 +129,7 @@ mapAliases ({ nose-cover3 = throw "nose-cover3 has been removed, it was using setuptools 2to3 translation feature, which has been removed in setuptools 58"; # added 2022-02-16 notifymuch = throw "notifymuch has been promoted to a top-level attribute"; # added 2022-10-02 ordereddict = throw "ordereddict has been removed because it is only useful on unsupported python versions."; # added 2022-05-28 + pafy = throw "pafy has been removed because it is unmaintained and only a dependency of mps-youtube, itself superseded by yewtube"; # Added 2023-01-19 pam = python-pam; # added 2020-09-07. PasteDeploy = pastedeploy; # added 2021-10-07 pathpy = path; # added 2022-04-12 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b4b340a42ba5..5e163e6bcd46 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6738,8 +6738,6 @@ self: super: with self; { packvers = callPackage ../development/python-modules/packvers { }; - pafy = callPackage ../development/python-modules/pafy { }; - pagelabels = callPackage ../development/python-modules/pagelabels { }; paho-mqtt = callPackage ../development/python-modules/paho-mqtt { };