From 76054e38cd7431fe3a119f3a7c833ab3791a35ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 19 Jan 2021 11:05:35 +0100 Subject: [PATCH] pythonPackages.piexif: fix tests apply https://github.com/hMatoba/Piexif/pull/109 --- .../python-modules/piexif/default.nix | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/piexif/default.nix b/pkgs/development/python-modules/piexif/default.nix index c08ee8338b0..440df36384c 100644 --- a/pkgs/development/python-modules/piexif/default.nix +++ b/pkgs/development/python-modules/piexif/default.nix @@ -1,18 +1,28 @@ -{ lib, stdenv, buildPythonPackage, fetchPypi, pillow }: +{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch, pillow }: buildPythonPackage rec { pname = "piexif"; version = "1.1.3"; + # patch does not apply to PyPI sdist due to different line endings + src = fetchFromGitHub { + owner = "hMatoba"; + repo = "Piexif"; + rev = version; + sha256 = "1akmaxq1cjr8wghwaaql1bd3sajl8psshl58lprgfsigrvnklp8b"; + }; + + patches = [ + # Fix tests with Pillow >= 7.2.0: https://github.com/hMatoba/Piexif/pull/109 + (fetchpatch { + url = "https://github.com/hMatoba/Piexif/commit/5209b53e9689ce28dcd045f384633378d619718f.patch"; + sha256 = "0ak571jf76r1vszp2g3cd5c16fz2zkbi43scayy933m5qdrhd8g1"; + }) + ]; + # Pillow needed for unit tests checkInputs = [ pillow ]; - src = fetchPypi { - inherit pname version; - extension = "zip"; - sha256 = "06sz58q4mrw472p8fbnq7wsj8zpi5js5r8phm2hiwfmz0v33bjw3"; - }; - meta = with lib; { description = "Simplify Exif manipulations with Python"; homepage = "https://github.com/hMatoba/Piexif";