about summary refs log tree commit diff
path: root/pkgs/by-name/ls
diff options
context:
space:
mode:
authorThiago Kenji Okada <thiagokokada@gmail.com>2024-01-08 12:13:52 +0000
committerThiago Kenji Okada <thiagokokada@gmail.com>2024-01-08 14:53:43 +0000
commit61c34fe142fda3b69fac1ad5ce823548ca9ffe3c (patch)
tree01fba2255b8d98ede9c552cdd656f1aa109ad7fa /pkgs/by-name/ls
parent211f1d86a9b7f3e3543118e1d1668ca02a531d4a (diff)
lshw: migrate to by-name
Diffstat (limited to 'pkgs/by-name/ls')
-rw-r--r--pkgs/by-name/ls/lshw/package.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/by-name/ls/lshw/package.nix b/pkgs/by-name/ls/lshw/package.nix
new file mode 100644
index 0000000000000..5a6318ea4c21a
--- /dev/null
+++ b/pkgs/by-name/ls/lshw/package.nix
@@ -0,0 +1,54 @@
+{ 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";
+
+  hardeningDisable = lib.optionals stdenv.hostPlatform.isStatic [ "fortify" ];
+
+  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;
+    mainProgram = "lshw";
+  };
+}