nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 87 lines 2.4 kB view raw
1{ 2 lib, 3 python3Packages, 4 fetchFromGitHub, 5 tinyprog, 6 scons, 7}: 8 9python3Packages.buildPythonApplication rec { 10 pname = "apio"; 11 version = "0.9.5"; 12 13 pyproject = true; 14 15 src = fetchFromGitHub { 16 owner = "FPGAwars"; 17 repo = "apio"; 18 tag = "v${version}"; 19 hash = "sha256-VU4tOszGkw20DWW2SerFsnjFiSkrSwqBcwosGnHJfU8="; 20 }; 21 22 postPatch = '' 23 substituteInPlace pyproject.toml \ 24 --replace-fail 'scons==4.2.0' 'scons' \ 25 --replace-fail '==' '>=' 26 27 substituteInPlace apio/managers/scons.py --replace-fail \ 28 'return "tinyprog --libusb --program"' \ 29 'return "${tinyprog}/bin/tinyprog --libusb --program"' 30 substituteInPlace apio/util.py --replace-fail \ 31 '_command = apio_bin_dir / "tinyprog"' \ 32 '_command = "${tinyprog}/bin/tinyprog"' 33 34 # semantic-version seems to not support version numbers like the one of tinyprog in Nixpkgs (1.0.24.dev114+gxxxxxxx). 35 # See https://github.com/rbarrois/python-semanticversion/issues/47. 36 # This leads to an error like "Error: Invalid version string: '1.0.24.dev114+g97f6353'" 37 # when executing "apio upload" for a TinyFPGA. 38 # Replace the dot with a dash to work around this problem. 39 substituteInPlace apio/managers/scons.py --replace-fail \ 40 'version = semantic_version.Version(pkg_version)' \ 41 'version = semantic_version.Version(pkg_version.replace(".dev", "-dev"))' 42 ''; 43 44 nativeBuildInputs = with python3Packages; [ 45 flit-core 46 ]; 47 48 dependencies = 49 with python3Packages; 50 [ 51 click 52 semantic-version 53 requests 54 colorama 55 pyserial 56 wheel 57 ] 58 ++ [ 59 scons 60 tinyprog # needed for upload to TinyFPGA 61 ]; 62 63 build-system = with python3Packages; [ 64 setuptools # needs pkg_resources at runtime (technically not needed when tinyprog is also in this list because of the propagatedBuildInputs of tinyprog) 65 ]; 66 67 nativeCheckInputs = with python3Packages; [ 68 pytestCheckHook 69 ]; 70 71 disabledTestPaths = [ 72 # This test fails and is also not executed in upstream's CI 73 "test2" 74 ]; 75 76 pytestFlags = [ "--offline" ]; 77 78 strictDeps = true; 79 80 meta = { 81 description = "Open source ecosystem for open FPGA boards"; 82 mainProgram = "apio"; 83 homepage = "https://github.com/FPGAwars/apio"; 84 license = lib.licenses.gpl2Only; 85 maintainers = with lib.maintainers; [ Luflosi ]; 86 }; 87}