about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/libarchive-c/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/libarchive-c/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/libarchive-c/default.nix42
1 files changed, 28 insertions, 14 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/libarchive-c/default.nix b/nixpkgs/pkgs/development/python-modules/libarchive-c/default.nix
index 73d99afda674..48262398fcbf 100644
--- a/nixpkgs/pkgs/development/python-modules/libarchive-c/default.nix
+++ b/nixpkgs/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";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "9919344cec203f5db6596a29b5bc26b07ba9662925a05e24980b84709232ef60";
+  version = "3.1";
+  format = "setuptools";
+
+  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";