snac2: 2.68 -> 2.70 (#379043)
[NixPkgs.git] / pkgs / by-name / mk / mkbootimage / package.nix
blob91a70173ae050dcac8f56347114f1191c6f86653
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   elfutils,
6   pcre,
7 }:
9 stdenv.mkDerivation (finalAttrs: {
10   pname = "mkbootimage";
11   version = "2.3-unstable-2022-05-26";
13   src = fetchFromGitHub {
14     owner = "antmicro";
15     repo = "zynq-mkbootimage";
16     rev = "872363ce32c249f8278cf107bc6d3bdeb38d849f";
17     hash = "sha256-5FPyAhUWZDwHbqmp9J2ZXTmjaXPz+dzrJMolaNwADHs=";
18   };
20   # Using elfutils because libelf is being discontinued
21   # See https://github.com/NixOS/nixpkgs/pull/271568
22   buildInputs = [
23     elfutils
24     pcre
25   ];
27   postPatch = ''
28     substituteInPlace Makefile --replace "git rev-parse --short HEAD" "echo ${finalAttrs.src.rev}"
29   '';
31   installPhase = ''
32     runHook preInstall
34     install -Dm755 mkbootimage -t $out/bin
36     runHook postInstall
37   '';
39   hardeningDisable = [ "fortify" ];
41   meta = with lib; {
42     description = "Open source replacement of the Xilinx bootgen application";
43     homepage = "https://github.com/antmicro/zynq-mkbootimage";
44     license = licenses.bsd2;
45     platforms = platforms.linux;
46     maintainers = [ maintainers.fsagbuya ];
47     mainProgram = "mkbootimage";
48   };