.github/labeler-no-sync: fix backport labelling (#378567)
[NixPkgs.git] / pkgs / by-name / ed / edk2-uefi-shell / package.nix
blobb1d1beb266efc204dfa9b536232d9536d3d38c66
2   lib,
3   stdenv,
4   edk2,
5   llvmPackages,
6   util-linux,
7   nasm,
8   python3,
9   pkgsBuildHost,
11 edk2.mkDerivation "ShellPkg/ShellPkg.dsc" (finalAttrs: {
12   pname = "edk2-uefi-shell";
13   inherit (edk2) version;
15   nativeBuildInputs =
16     [
17       util-linux
18       nasm
19       python3
20     ]
21     ++ lib.optionals stdenv.cc.isClang [
22       llvmPackages.bintools
23       llvmPackages.llvm
24     ];
25   strictDeps = true;
27   env.NIX_CFLAGS_COMPILE = toString (
28     lib.optionals stdenv.cc.isClang [
29       "-fno-pic"
30       "-Qunused-arguments"
31     ]
32   );
34   # Set explicitly to use Python 3 from nixpkgs. Otherwise, the build system will detect and try to
35   # use `/usr/bin/python3` on Darwin when sandboxing is disabled.
36   PYTHON_COMMAND = "${lib.getBin pkgsBuildHost.python3}/bin/python3";
38   # We only have a .efi file in $out which shouldn't be patched or stripped
39   dontPatchELF = true;
40   dontStrip = true;
42   # GUID hardcoded to match ShellPkg.dsc
43   installPhase = ''
44     runHook preInstall
45     install -D -m0644 Build/Shell/RELEASE*/*/Shell_EA4BB293-2D7F-4456-A681-1F22F42CD0BC.efi $out/shell.efi
46     runHook postInstall
47   '';
49   passthru.efi = "${finalAttrs.finalPackage}/shell.efi";
51   meta = {
52     inherit (edk2.meta) license platforms;
53     description = "UEFI Shell from Tianocore EFI development kit";
54     homepage = "https://github.com/tianocore/tianocore.github.io/wiki/ShellPkg";
55     maintainers = with lib.maintainers; [
56       LunNova
57       mjoerg
58     ];
59     broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;
60   };