2021-09-27 08:55:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2023-02-12 18:35:18 +00:00
|
|
|
, fetchpatch
|
2021-09-27 08:55:59 +00:00
|
|
|
, libmnl
|
|
|
|
, pkg-config
|
2022-04-05 21:48:31 +00:00
|
|
|
, writeScript
|
2021-09-27 08:55:59 +00:00
|
|
|
}:
|
2009-09-22 08:37:41 +00:00
|
|
|
|
2013-07-11 20:03:49 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "ethtool";
|
2024-04-30 05:14:09 +00:00
|
|
|
version = "6.7";
|
2009-09-22 08:37:41 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-01-11 06:16:39 +00:00
|
|
|
url = "mirror://kernel/software/network/${pname}/${pname}-${version}.tar.xz";
|
2024-04-30 05:14:09 +00:00
|
|
|
sha256 = "sha256-w65SawHOTY32x5SrFw3kpBBNER6o2Ns/H9fCX8uQVhk=";
|
2009-09-22 08:37:41 +00:00
|
|
|
};
|
|
|
|
|
2021-09-27 08:55:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libmnl
|
|
|
|
];
|
2021-08-18 22:47:33 +00:00
|
|
|
|
2022-04-05 21:48:31 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = writeScript "update-ethtool" ''
|
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -i bash -p curl pcre common-updater-scripts
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
# Expect the text in format of '<a href="ethtool-VER.tar.xz">...</a>'
|
|
|
|
# The page always lists versions newest to oldest. Pick the first one.
|
|
|
|
new_version="$(curl -s https://mirrors.edge.kernel.org/pub/software/network/ethtool/ |
|
|
|
|
pcregrep -o1 '<a href="ethtool-([0-9.]+)[.]tar[.]xz">' |
|
|
|
|
head -n1)"
|
|
|
|
update-source-version ${pname} "$new_version"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2013-07-11 20:03:49 +00:00
|
|
|
description = "Utility for controlling network drivers and hardware";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.kernel.org/pub/software/network/ethtool/";
|
2021-09-27 08:55:59 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2013-07-11 20:03:49 +00:00
|
|
|
platforms = platforms.linux;
|
2021-09-27 08:55:59 +00:00
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "ethtool";
|
2013-07-11 20:03:49 +00:00
|
|
|
};
|
2009-09-22 08:37:41 +00:00
|
|
|
}
|