1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 unittestCheckHook, 6 pythonOlder, 7 setuptools, 8}: 9 10buildPythonPackage rec { 11 pname = "cpufeature"; 12 version = "0.2.1"; 13 pyproject = true; 14 15 disabled = pythonOlder "3.7"; 16 17 src = fetchFromGitHub { 18 owner = "robbmcleod"; 19 repo = "cpufeature"; 20 tag = "v${version}"; 21 hash = "sha256-dp569Tp8E5/avQpYvhPNPgS/A+q2e/ie+7BR7h2Ip+I="; 22 }; 23 24 nativeBuildInputs = [ setuptools ]; 25 26 propagatedBuildInputs = [ setuptools ]; 27 28 nativeCheckInputs = [ unittestCheckHook ]; 29 30 pythonImportsCheck = [ "cpufeature" ]; 31 32 preCheck = '' 33 # Change into the test directory due to a relative resource path 34 cd cpufeature 35 ''; 36 37 meta = with lib; { 38 description = "Python module for detection of CPU features"; 39 homepage = "https://github.com/robbmcleod/cpufeature"; 40 license = licenses.cc0; 41 maintainers = with maintainers; [ fab ]; 42 platforms = [ 43 "x86_64-linux" 44 "x86_64-windows" 45 ]; 46 }; 47}