diff --git a/mkbootimage.nix b/mkbootimage.nix new file mode 100644 index 00000000..59d0ca0c --- /dev/null +++ b/mkbootimage.nix @@ -0,0 +1,24 @@ +{ pkgs }: + +pkgs.stdenv.mkDerivation { + pname = "mkbootimage"; + version = "2.2"; + + src = pkgs.fetchFromGitHub { + owner = "antmicro"; + repo = "zynq-mkbootimage"; + rev = "4ee42d782a9ba65725ed165a4916853224a8edf7"; + sha256 = "1k1mbsngqadqihzjgvwvsrkvryxy5ladpxd9yh9iqn2s7fxqwqa9"; + }; + + propagatedBuildInputs = [ pkgs.libelf pkgs.pcre ]; + patchPhase = + '' + substituteInPlace Makefile --replace "git rev-parse --short HEAD" "echo nix" + ''; + installPhase = + '' + mkdir -p $out/bin + cp mkbootimage $out/bin + ''; +} diff --git a/shell.nix b/shell.nix index 3d584e7a..7c37820a 100644 --- a/shell.nix +++ b/shell.nix @@ -22,6 +22,8 @@ in vivado pkgs.llvm_9 pkgs.lld_9 + + (import ./mkbootimage.nix { inherit pkgs; }) ]; XARGO_RUST_SRC = "${rustPlatform.rust.rustc.src}/src";