From 808125fff694e4eb4c73952d501e975778ffdacd Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Thu, 19 Aug 2021 03:18:18 -0400 Subject: [PATCH] deluge-1_x: Remove older version of Deluge (#134448) Deluge 1.x requires Python 2 which upstream has end-of-lifed. Deluge depends on pythonPackages.twisted, Python 2 support for which upstream has nowdropped. If pythonPackages.twisted is upgraded then Deluge 1.x breaks. So, remove it instead of leaving it broken. Deluge 2.x (deluge-2_x) is available and continues to work. --- nixos/modules/services/torrent/deluge.nix | 9 +++- nixos/tests/deluge.nix | 35 ---------------- pkgs/applications/networking/p2p/deluge/1.nix | 42 ------------------- pkgs/top-level/aliases.nix | 8 ++++ pkgs/top-level/all-packages.nix | 4 -- 5 files changed, 16 insertions(+), 82 deletions(-) delete mode 100644 pkgs/applications/networking/p2p/deluge/1.nix diff --git a/nixos/modules/services/torrent/deluge.nix b/nixos/modules/services/torrent/deluge.nix index 7ca4fdcf64d4..151a1dd638d1 100644 --- a/nixos/modules/services/torrent/deluge.nix +++ b/nixos/modules/services/torrent/deluge.nix @@ -149,7 +149,7 @@ in { package = mkOption { type = types.package; - example = literalExample "pkgs.deluge-1_x"; + example = literalExample "pkgs.deluge-2_x"; description = '' Deluge package to use. ''; @@ -184,6 +184,13 @@ in { if versionAtLeast config.system.stateVersion "20.09" then pkgs.deluge-2_x else + # deluge-1_x is no longer packaged and this will resolve to an error + # thanks to the alias for this name. This is left here so that anyone + # using NixOS older than 20.09 receives that error when they upgrade + # and is forced to make an intentional choice to switch to deluge-2_x. + # That might be slightly inconvenient but there is no path to + # downgrade from 2.x to 1.x so NixOS should not automatically perform + # this state migration. pkgs.deluge-1_x ); diff --git a/nixos/tests/deluge.nix b/nixos/tests/deluge.nix index 300bc0a1157b..f673ec2db5a7 100644 --- a/nixos/tests/deluge.nix +++ b/nixos/tests/deluge.nix @@ -5,41 +5,6 @@ import ./make-test-python.nix ({ pkgs, ...} : { }; nodes = { - simple1 = { - services.deluge = { - enable = true; - package = pkgs.deluge-1_x; - web = { - enable = true; - openFirewall = true; - }; - }; - }; - - declarative1 = { - services.deluge = { - enable = true; - package = pkgs.deluge-1_x; - openFirewall = true; - declarative = true; - config = { - allow_remote = true; - download_location = "/var/lib/deluge/my-download"; - daemon_port = 58846; - listen_ports = [ 6881 6889 ]; - }; - web = { - enable = true; - port = 3142; - }; - authFile = pkgs.writeText "deluge-auth" '' - localclient:a7bef72a890:10 - andrew:password:10 - user3:anotherpass:5 - ''; - }; - }; - simple2 = { services.deluge = { enable = true; diff --git a/pkgs/applications/networking/p2p/deluge/1.nix b/pkgs/applications/networking/p2p/deluge/1.nix deleted file mode 100644 index 4171efb7ce29..000000000000 --- a/pkgs/applications/networking/p2p/deluge/1.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ lib, stdenv, fetchurl, fetchpatch, intltool, libtorrent-rasterbar, pythonPackages }: - -pythonPackages.buildPythonPackage rec { - pname = "deluge"; - version = "1.3.15"; - - src = fetchurl { - url = "http://download.deluge-torrent.org/source/${pname}-${version}.tar.bz2"; - sha256 = "1467b9hmgw59gf398mhbf40ggaka948yz3afh6022v753c9j7y6w"; - }; - - patches = [ - # Fix preferences when built against libtorrent >=0.16 - (fetchpatch { - url = "https://git.deluge-torrent.org/deluge/patch/?id=38d7b7cdfde3c50d6263602ffb03af92fcbfa52e"; - sha256 = "0la3i0lkj6yv4725h4kbd07mhfwcb34w7prjl9gxg12q7px6c31d"; - }) - ]; - - propagatedBuildInputs = with pythonPackages; [ - pyGtkGlade twisted Mako chardet pyxdg pyopenssl service-identity - libtorrent-rasterbar.dev libtorrent-rasterbar.python setuptools - ]; - - nativeBuildInputs = [ intltool ]; - - postInstall = '' - mkdir -p $out/share/applications - cp -R deluge/data/pixmaps $out/share/ - cp -R deluge/data/icons $out/share/ - cp deluge/data/share/applications/deluge.desktop $out/share/applications - ''; - - meta = with lib; { - homepage = "https://deluge-torrent.org"; - description = "Torrent client"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ domenkozar ebzzry ]; - broken = stdenv.isDarwin; - platforms = platforms.all; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 2790610e5126..3a2c62af78ff 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -183,6 +183,14 @@ mapAliases ({ deepin = throw "deepin was a work in progress and it has been canceled and removed https://github.com/NixOS/nixpkgs/issues/94870"; # added 2020-08-31 deepspeech = throw "deepspeech was removed in favor of stt. https://github.com/NixOS/nixpkgs/issues/119496"; # added 2021-05-05 deltachat-electron = deltachat-desktop; # added 2021-07-18 + deluge-1_x = throw '' + Deluge 1.x (deluge-1_x) is no longer supported. + Please use Deluge 2.x (deluge-2_x) instead, for example: + + services.deluge.package = pkgs.deluge-2_x; + + Note that it is NOT possible to switch back to Deluge 1.x after this change. + ''; # added 2021-08-18 desktop_file_utils = desktop-file-utils; # added 2018-02-25 devicemapper = lvm2; # added 2018-04-25 digikam5 = digikam; # added 2017-02-18 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5389225a2f3f..585235b9afd6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4197,10 +4197,6 @@ with pkgs; pythonPackages = python3Packages; libtorrent-rasterbar = libtorrent-rasterbar-1_2_x.override { python = python3; }; }; - deluge-1_x = callPackage ../applications/networking/p2p/deluge/1.nix { - pythonPackages = python2Packages; - libtorrent-rasterbar = libtorrent-rasterbar-1_1_x; - }; deluge = deluge-2_x; desktop-file-utils = callPackage ../tools/misc/desktop-file-utils { };