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

openocd.nix

parent d6eb113a
No related branches found
No related tags found
No related merge requests found
Pipeline #277 passed
...@@ -4,8 +4,22 @@ with pkgs; ...@@ -4,8 +4,22 @@ with pkgs;
let let
firmware = subdir: firmware = subdir:
callPackage ./nix/firmware.nix { inherit subdir; }; callPackage ./nix/firmware.nix { inherit subdir; };
openocd = callPackage ./nix/openocd.nix { };
in 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"; ble = firmware "ble";
bmatest = firmware "bmatest"; bmatest = firmware "bmatest";
bmetest = firmware "bmetest"; 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