lshw: rename version to fix repology listing

`lshw` is not showing in the nixpkgs-unstable listings in repology, but
it is showing in the previous stable release (release-21.11). The reason
for this was a change in 8d0267dc8f, that
fixed the `lshw` version to include its letter prefix.

However, the way the version is computed for repology is to parse the
`name` attr instead, separating it in `pname` and `version`. The
function that does this (`builtins.parseDrvName`) considers anything
that is a `name` everything up to the first dash followed by a digit.
Because the `version` includes the letter `B` as prefix, it them ends up
splitting it wrong.

See https://github.com/NixOS/nix/pull/4463 for a proper fix, but for now
let's just "fix" this by not including the prefix in the `version`.
main
Thiago Kenji Okada 2 years ago
parent a02643d6a5
commit 5b17034ddc
  1. 9
      pkgs/tools/system/lshw/default.nix

@ -10,12 +10,15 @@
stdenv.mkDerivation rec {
pname = "lshw";
version = "B.02.19";
# 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 = "02.19";
src = fetchFromGitHub {
owner = "lyonel";
repo = pname;
rev = version;
rev = "B.${version}";
sha256 = "sha256-PzbNGc1pPiPLWWgTeWoNfAo+SsXgi1HcjnXfYXA9S0I=";
};
@ -26,7 +29,7 @@ stdenv.mkDerivation rec {
makeFlags = [
"PREFIX=$(out)"
"VERSION=${version}"
"VERSION=${src.rev}"
];
buildFlags = [ "all" ] ++ lib.optional withGUI "gui";

Loading…
Cancel
Save