From e43c239ea694fbfd3c9b12424f73f614099aa426 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 26 Aug 2021 21:38:08 +0200 Subject: [PATCH] python3Packages.libarchive-c: 2.9 -> 3.1 --- .../python-modules/libarchive-c/default.nix | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/libarchive-c/default.nix b/pkgs/development/python-modules/libarchive-c/default.nix index 73d99afda674..48262398fcbf 100644 --- a/pkgs/development/python-modules/libarchive-c/default.nix +++ b/pkgs/development/python-modules/libarchive-c/default.nix @@ -1,23 +1,26 @@ -{ lib, stdenv +{ lib +, stdenv , buildPythonPackage -, fetchPypi -, pytest -, glibcLocales +, pythonAtLeast +, fetchFromGitHub , libarchive +, glibcLocales , mock +, pytestCheckHook }: buildPythonPackage rec { pname = "libarchive-c"; - version = "2.9"; + version = "3.1"; + format = "setuptools"; - src = fetchPypi { - inherit pname version; - sha256 = "9919344cec203f5db6596a29b5bc26b07ba9662925a05e24980b84709232ef60"; + src = fetchFromGitHub { + owner = "Changaco"; + repo = "python-${pname}"; + rev = version; + sha256 = "1z4lqy9zlzymshzrcldsc9ipys2l7grqg4yff6ndl6dgbfb0g4jb"; }; - checkInputs = [ mock pytest glibcLocales ]; - LC_ALL="en_US.UTF-8"; postPatch = '' @@ -25,9 +28,20 @@ buildPythonPackage rec { "find_library('archive')" "'${libarchive.lib}/lib/libarchive${stdenv.hostPlatform.extensions.sharedLibrary}'" ''; - checkPhase = '' - py.test tests -k 'not test_check_archiveentry_with_unicode_entries_and_name_zip and not test_check_archiveentry_using_python_testtar' - ''; + pythonImportsCheck = [ + "libarchive" + ]; + + checkInputs = [ + glibcLocales + mock + pytestCheckHook + ]; + + disabledTests = lib.optionals (pythonAtLeast "3.9") [ + # causes python3.9 to segfault + "test_custom_writer_and_stream_reader" + ]; meta = with lib; { homepage = "https://github.com/Changaco/python-libarchive-c";