about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/system/lshw/default.nix
blob: f5b4486365c33f2a2f600fb2abad8ca9f1cfe921 (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
{ stdenv
, lib
, fetchFromGitHub
, hwdata
, gtk2
, pkg-config
, gettext
, sqlite # compile GUI
, withGUI ? false
}:

stdenv.mkDerivation rec {
  pname = "lshw";
  # FIXME: when switching to a stable release:
  # Fix repology.org by not including the prefixed B, otherwise the `pname` attr
  # gets filled as `lshw-B.XX.XX` in `nix-env --query --available --attr nixpkgs.lshw --meta`
  # See https://github.com/NixOS/nix/pull/4463 for a definitive fix
  version = "unstable-2023-03-20";

  src = fetchFromGitHub {
    owner = "lyonel";
    repo = pname;
    rev = "b4e067307906ec6f277cce5c8a882f5edd03cbbc";
    #rev = "B.${version}";
    sha256 = "sha256-ahdaQeYZEFCVxwAMJPMB9bfo3ndIiqFyM6OghXwtm1A=";
  };

  nativeBuildInputs = [ pkg-config gettext ];

  buildInputs = [ hwdata ]
    ++ lib.optionals withGUI [ gtk2 sqlite ];

  makeFlags = [
    "PREFIX=$(out)"
    "VERSION=${src.rev}"
  ];

  buildFlags = [ "all" ] ++ lib.optional withGUI "gui";

  installTargets = [ "install" ] ++ lib.optional withGUI "install-gui";

  enableParallelBuilding = true;

  meta = with lib; {
    homepage = "https://ezix.org/project/wiki/HardwareLiSter";
    description = "Provide detailed information on the hardware configuration of the machine";
    license = licenses.gpl2;
    maintainers = with maintainers; [ thiagokokada ];
    platforms = platforms.linux;
  };
}