beets{,-unstable}: use a patch for pillow10 compatibility fix

This patch will fail to apply when a new version comes out, and thus
will force us to remove it, where the `sed` command in `postPatch` may
become abandoned, and not fail the build due to it not doing anything.

+24 -6
-6
pkgs/tools/audio/beets/common.nix
··· 52 52 53 53 patches = extraPatches; 54 54 55 - postPatch = '' 56 - # https://github.com/beetbox/beets/pull/4868 57 - substituteInPlace beets/util/artresizer.py \ 58 - --replace "Image.ANTIALIAS" "Image.Resampling.LANCZOS" 59 - ''; 60 - 61 55 propagatedBuildInputs = with python3Packages; [ 62 56 confuse 63 57 gst-python
+11
pkgs/tools/audio/beets/default.nix
··· 41 41 # https://github.com/beetbox/beets/pull/4839 42 42 # The upstream patch does not apply on 1.6.0, as the related code has been refactored since 43 43 ./patches/fix-embedart-imagick-7.1.1-12.patch 44 + # Pillow 10 compatibility fix, a backport of 45 + # https://github.com/beetbox/beets/pull/4868, which doesn't apply now 46 + ./patches/fix-pillow10-compat.patch 44 47 ]; 45 48 }; 46 49 ··· 57 60 extraPatches = [ 58 61 # Bash completion fix for Nix 59 62 ./patches/unstable-bash-completion-always-print.patch 63 + # Pillow 10 compatibility fix, see: 64 + # https://github.com/beetbox/beets/pull/4868 65 + (fetchpatch { 66 + url = "https://github.com/beetbox/beets/commit/c2118a8b9cd8c9c91135c6e178830b89b40867be.patch"; 67 + hash = "sha256-HWf940WrF10Jnu9iyoHovFDcvj9LY8p7zIlJg1TfKxQ="; 68 + # Doesn't apply on this file, and it we don't care. 69 + excludes = [ "docs/changelog.rst" ]; 70 + }) 60 71 ]; 61 72 pluginOverrides = { 62 73 # unstable has a new plugin, so we register it here.
+13
pkgs/tools/audio/beets/patches/fix-pillow10-compat.patch
··· 1 + diff --git i/beets/util/artresizer.py w/beets/util/artresizer.py 2 + index 8683e228..6f99c79e 100644 3 + --- i/beets/util/artresizer.py 4 + +++ w/beets/util/artresizer.py 5 + @@ -72,7 +72,7 @@ def pil_resize(maxwidth, path_in, path_out=None, quality=0, max_filesize=0): 6 + try: 7 + im = Image.open(util.syspath(path_in)) 8 + size = maxwidth, maxwidth 9 + - im.thumbnail(size, Image.ANTIALIAS) 10 + + im.thumbnail(size, Image.Resampling.LANCZOS) 11 + 12 + if quality == 0: 13 + # Use PIL's default quality.