Files
nixpkgs/pkgs/by-name/ap/apio/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

88 lines
2.3 KiB
Nix

{
lib,
python3Packages,
fetchFromGitHub,
tinyprog,
scons,
}:
python3Packages.buildPythonApplication rec {
pname = "apio";
version = "0.9.5";
pyproject = true;
src = fetchFromGitHub {
owner = "FPGAwars";
repo = "apio";
tag = "v${version}";
hash = "sha256-VU4tOszGkw20DWW2SerFsnjFiSkrSwqBcwosGnHJfU8=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'scons==4.2.0' 'scons' \
--replace-fail '==' '>='
substituteInPlace apio/managers/scons.py --replace-fail \
'return "tinyprog --libusb --program"' \
'return "${tinyprog}/bin/tinyprog --libusb --program"'
substituteInPlace apio/util.py --replace-fail \
'_command = apio_bin_dir / "tinyprog"' \
'_command = "${tinyprog}/bin/tinyprog"'
# semantic-version seems to not support version numbers like the one of tinyprog in Nixpkgs (1.0.24.dev114+gxxxxxxx).
# See https://github.com/rbarrois/python-semanticversion/issues/47.
# This leads to an error like "Error: Invalid version string: '1.0.24.dev114+g97f6353'"
# when executing "apio upload" for a TinyFPGA.
# Replace the dot with a dash to work around this problem.
substituteInPlace apio/managers/scons.py --replace-fail \
'version = semantic_version.Version(pkg_version)' \
'version = semantic_version.Version(pkg_version.replace(".dev", "-dev"))'
'';
nativeBuildInputs = with python3Packages; [
flit-core
];
dependencies =
with python3Packages;
[
click
semantic-version
requests
colorama
pyserial
wheel
]
++ [
scons
tinyprog # needed for upload to TinyFPGA
];
build-system = with python3Packages; [
setuptools # needs pkg_resources at runtime (technically not needed when tinyprog is also in this list because of the propagatedBuildInputs of tinyprog)
];
nativeCheckInputs = with python3Packages; [
pytestCheckHook
];
disabledTestPaths = [
# This test fails and is also not executed in upstream's CI
"test2"
];
pytestFlags = [ "--offline" ];
strictDeps = true;
meta = {
description = "Open source ecosystem for open FPGA boards";
mainProgram = "apio";
homepage = "https://github.com/FPGAwars/apio";
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [ Luflosi ];
};
}