summary refs log tree commit diff
path: root/pkgs/tools/system/acpica-tools/default.nix
blob: 98ac2254fb6eabf7915ee18fbd31cae9db10e2db (plain) (blame)
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
{ lib
, stdenv
, fetchurl
, bison
, flex
}:

stdenv.mkDerivation rec {
  pname = "acpica-tools";
  version = "20221020";

  src = fetchurl {
    # 20221020 has a weird filename published: https://acpica.org/node/201
    name = "acpica-unix-${version}.tar.gz";
    url = "https://acpica.org/sites/acpica/files/acpica-unix-${version}.tar_0.gz";
    hash = "sha256-M6LjlKygylfUAYr+PaNA361etFsbkwDoHdWV/aB88cU=";
  };

  nativeBuildInputs = [ bison flex ];

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

  NIX_CFLAGS_COMPILE = [
    "-O3"
    # Needed with GCC 12
    "-Wno-dangling-pointer"
  ];

  enableParallelBuilding = 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.isDarwin) "-m 555";

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

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