Skip to content
Snippets Groups Projects
Commit 080ee94e authored by Astro's avatar Astro :gear:
Browse files

openocd.nix

parent 5d0744d0
Branches
No related tags found
No related merge requests found
......@@ -4,8 +4,22 @@ with pkgs;
let
firmware = subdir:
callPackage ./nix/firmware.nix { inherit subdir; };
openocd = callPackage ./nix/openocd.nix { };
in
{
openocd = stdenv.mkDerivation {
name = "openocd-card10";
src = ./openocd;
phases = [ "unpackPhase" "installPhase" ];
buildInputs = [ openocd makeWrapper ];
installPhase = ''
mkdir -p $out/bin $out/share
cp -ar . $out/share/openocd
makeWrapper ${openocd}/bin/openocd $out/bin/openocd-card10 \
--add-flags "-f $out/share/openocd/scripts/interface/cmsis-dap.cfg" \
--add-flags "-f $out/share/openocd/scripts/target/max32665.cfg"
'';
};
ble = firmware "ble";
bmatest = firmware "bmatest";
bmetest = firmware "bmetest";
......
{ openocd, fetchFromGitHub, autoreconfHook, git, which }:
openocd.overrideAttrs (oa: {
src = fetchFromGitHub {
owner = "maximmbed";
repo = "openocd";
rev = "e71ac88c9dbfa4ee1405d7a86376119dcc887ed1";
sha256 = "18yc1wyclmjxqg6jilfcm60hi01pgqc4dilsmksqbhg23m6x4ycw";
fetchSubmodules = true;
};
nativeBuildInputs = oa.nativeBuildInputs ++ [
autoreconfHook
git
which
];
enableParallelBuilding = true;
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment