Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at domenkozar-patch-1 55 lines 1.5 kB view raw
1{ lib 2, stdenv 3, fetchFromGitHub 4, buildPythonPackage 5, six 6, lxml 7, pytestCheckHook 8}: 9 10let 11 # unclear relationship between test-files version and jpylyzer version. 12 # upstream appears to just always test against the latest version, so 13 # probably worth updating this when package is bumped. 14 testFiles = fetchFromGitHub { 15 owner = "openpreserve"; 16 repo = "jpylyzer-test-files"; 17 rev = "146cb0029b5ea9d8ef22dc6683cec8afae1cc63a"; 18 sha256 = "sha256-uKUau7mYXqGs4dSnXGPnPsH9k81ZCK0aPj5F9HWBMZ8="; 19 }; 20 21in buildPythonPackage rec { 22 pname = "jpylyzer"; 23 version = "2.1.0"; 24 25 src = fetchFromGitHub { 26 owner = "openpreserve"; 27 repo = pname; 28 rev = version; 29 sha256 = "sha256-LBVOwjWC/HEvGgoi8WxEdl33M4JrfdHEj1Dk7f1NAiA="; 30 }; 31 32 propagatedBuildInputs = [ six ]; 33 34 checkInputs = [ pytestCheckHook lxml ]; 35 36 # don't depend on testFiles on darwin as it may not be extractable due to 37 # weird filenames 38 preCheck = lib.optionalString (!stdenv.isDarwin) '' 39 sed -i '/^testFilesDir = /ctestFilesDir = "${testFiles}"' tests/unit/test_testfiles.py 40 ''; 41 disabledTestPaths = lib.optionals stdenv.isDarwin [ 42 "tests/unit/test_testfiles.py" 43 ]; 44 45 pythonImportsCheck = [ "jpylyzer" ]; 46 47 disallowedReferences = [ testFiles ]; 48 49 meta = with lib; { 50 description = "JP2 (JPEG 2000 Part 1) image validator and properties extractor"; 51 homepage = "https://jpylyzer.openpreservation.org/"; 52 license = licenses.lgpl3; 53 maintainers = with maintainers; [ ris ]; 54 }; 55}