summaryrefslogtreecommitdiff
path: root/pkgs/by-name/ac/acpica-tools/package.nix
blob: 96a8a0d0a78a02e6c7bc7437426e3d094a28616d (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
  lib,
  stdenv,
  fetchFromGitHub,
  bison,
  flex,
  nix-update-script,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "acpica-tools";
  version = "R2025_04_04";

  src = fetchFromGitHub {
    owner = "acpica";
    repo = "acpica";
    tag = finalAttrs.version;
    hash = "sha256-+dMuyp3tT0eSLPyzLseuHMY+nNfl6roBFrsnXiZSHkY=";
  };

  nativeBuildInputs = [
    bison
    flex
  ];

  buildFlags = [
    "acpibin"
    "acpidump"
    "acpiexamples"
    "acpiexec"
    "acpihelp"
    "acpisrc"
    "acpixtract"
    "iasl"
  ];

  env.NIX_CFLAGS_COMPILE = toString ([
    "-O3"
  ]);

  enableParallelBuilding = true;

  # i686 builds fail with hardening enabled (due to -Wformat-overflow). Disable
  # -Werror altogether to make this derivation less fragile to toolchain
  # updates.
  NOWERROR = "TRUE";

  # We can handle stripping ourselves.
  # Unless we are on Darwin. Upstream makefiles degrade coreutils install to cp if _APPLE is detected.
  INSTALLFLAGS = lib.optionals (!stdenv.hostPlatform.isDarwin) "-m 555";

  installFlags = [ "PREFIX=${placeholder "out"}" ];

  passthru.updateScript = nix-update-script { };

  meta = {
    homepage = "https://www.acpica.org/";
    description = "ACPICA Tools";
    license = with lib.licenses; [
      iasl
      gpl2Only
      bsd3
    ];
    maintainers = with lib.maintainers; [
      tadfisher
      felixsinger
    ];
    platforms = lib.platforms.linux ++ lib.platforms.darwin;
  };
})