From 483b98331b4ec5556bc1fc1014788e9458a12aa1 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 24 Oct 2021 12:11:23 +0100 Subject: python3Packages.python_magic: pull upstream fix for file-5.41 Fixes build failure of form: $ nix build -f. python3Packages.python_magic ... python3.9-python-magic> FAIL: test_mime_types (__main__.MagicTest) ... python3.9-python-magic> AssertionError: 'application/x-bytecode.python' not found in ('application/octet-stream', 'text/x-bytecode.python') --- pkgs/development/python-modules/python-magic/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pkgs/development/python-modules/python-magic') diff --git a/pkgs/development/python-modules/python-magic/default.nix b/pkgs/development/python-modules/python-magic/default.nix index 02f1cc691522..d8a0f638d968 100644 --- a/pkgs/development/python-modules/python-magic/default.nix +++ b/pkgs/development/python-modules/python-magic/default.nix @@ -3,6 +3,7 @@ , python , buildPythonPackage , fetchFromGitHub +, fetchpatch , substituteAll , file , glibcLocales @@ -20,6 +21,13 @@ buildPythonPackage rec { }; patches = [ + # pull upstream patch to support file-5.41 + (fetchpatch { + name = "file-5.41-compat.patch"; + url = "https://github.com/ahupp/python-magic/commit/0ae7e7ceac0e80e03adc75c858bb378c0427331a.patch"; + sha256 = "0vclaamb56nza1mcy88wjbkh81hnish2gzvl8visa2cknhgdmk50"; + }) + (substituteAll { src = ./libmagic-path.patch; libmagic = "${file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}"; -- cgit v1.2.3