2021-09-20 18:17:33 +08:00
|
|
|
{ stdenv, buildEnv, lib, fetchFromGitHub, autoreconfHook269, openocd }:
|
2021-07-26 17:06:05 +08:00
|
|
|
let
|
2021-07-27 10:22:07 +08:00
|
|
|
bscan_spi_bitstreams-pkg = stdenv.mkDerivation {
|
|
|
|
name = "bscan_spi_bitstreams";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "quartiq";
|
|
|
|
repo = "bscan_spi_bitstreams";
|
|
|
|
rev = "01d8f819f15baf9a8cc5d96945a51e4d267ff564";
|
|
|
|
sha256 = "1zqv47kzgvbn4c8cr019a6wcja7gn5h1z4kvw5bhpc72fyhagal9";
|
|
|
|
};
|
|
|
|
phases = ["installPhase"];
|
|
|
|
installPhase =
|
|
|
|
''
|
|
|
|
mkdir -p $out/share/bscan-spi-bitstreams
|
|
|
|
cp $src/*.bit $out/share/bscan-spi-bitstreams
|
2019-02-14 15:29:42 +08:00
|
|
|
'';
|
|
|
|
};
|
2021-07-27 18:25:35 +08:00
|
|
|
openocd-fixed = openocd.overrideAttrs(oa: {
|
2021-09-20 18:17:33 +08:00
|
|
|
version = "unstable-2021-09-15";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openocd-org";
|
|
|
|
repo = "openocd";
|
|
|
|
rev = "a0bd3c9924870c3b8f428648410181040dabc33c";
|
|
|
|
sha256 = "sha256-YgUsl4/FohfsOncM4uiz/3c6g2ZN4oZ0y5vV/2Skwqg=";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
# https://review.openocd.org/c/openocd/+/4876
|
2021-07-29 15:30:09 +08:00
|
|
|
patches = oa.patches or [] ++ [ ./openocd-jtagspi.diff ];
|
2021-09-20 18:17:33 +08:00
|
|
|
nativeBuildInputs = oa.nativeBuildInputs or [] ++ [ autoreconfHook269 ];
|
2021-07-27 18:25:35 +08:00
|
|
|
});
|
2021-07-26 17:06:05 +08:00
|
|
|
in
|
2021-07-27 10:22:07 +08:00
|
|
|
buildEnv {
|
|
|
|
name = "openocd-bscanspi";
|
2021-07-27 18:25:35 +08:00
|
|
|
paths = [ openocd-fixed bscan_spi_bitstreams-pkg ];
|
2021-07-27 10:22:07 +08:00
|
|
|
}
|