1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 setuptools, 6 rstr, 7 python, 8}: 9 10buildPythonPackage rec { 11 pname = "raspyrfm-client"; 12 version = "1.2.8"; 13 pyproject = true; 14 15 src = fetchFromGitHub { 16 owner = "markusressel"; 17 repo = "raspyrfm-client"; 18 tag = "v${version}"; 19 hash = "sha256-WiL69bb4h8xVdMYxAVU0NHEfTWyW2NVR86zigsr5dmk="; 20 }; 21 22 # while we may not actually be on master, the script needs a git branch to function 23 # and master here is better than beta or pre-alpha 24 postPatch = '' 25 substituteInPlace ./setup.py \ 26 --replace-fail 'subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"])' '"master"' \ 27 --replace-fail 'GIT_BRANCH.decode()' '"master"' \ 28 --replace-fail 'GIT_BRANCH.rstrip()' '"master"' 29 ''; 30 31 build-system = [ setuptools ]; 32 33 pythonImportsCheck = [ "raspyrfm_client" ]; 34 35 nativeCheckInputs = [ rstr ]; 36 37 # pytestCheckHook does not auto detect the only test, run manually 38 checkPhase = '' 39 runHook preCheck 40 41 ${python.interpreter} tests/automatic_tests.py 42 43 runHook postCheck 44 ''; 45 46 meta = { 47 description = "Send rc signals with the RaspyRFM module"; 48 homepage = "https://github.com/markusressel/raspyrfm-client"; 49 changelog = "https://github.com/markusressel/raspyrfm-client/releases/tag/v${version}"; 50 maintainers = with lib.maintainers; [ ethancedwards8 ]; 51 }; 52}