2024-07-27 06:49:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
pkg-config,
|
|
|
|
stdenv,
|
|
|
|
gtest,
|
|
|
|
nix-update-script,
|
|
|
|
testers,
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "cpuinfo";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0-unstable-2024-08-30";
|
2024-07-27 06:49:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pytorch";
|
|
|
|
repo = "cpuinfo";
|
2024-09-19 14:19:46 +00:00
|
|
|
rev = "fa1c679da8d19e1d87f20175ae1ec10995cd3dd3";
|
|
|
|
hash = "sha256-yaeiBXqI17oIp7f30PGy7LYAjiWh/8vrnBj6aiKpdO4=";
|
2024-07-27 06:49:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
|
|
|
|
|
|
|
|
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [ gtest ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
(lib.cmakeBool "CPUINFO_BUILD_UNIT_TESTS" finalAttrs.finalPackage.doCheck)
|
|
|
|
(lib.cmakeBool "CPUINFO_BUILD_MOCK_TESTS" finalAttrs.finalPackage.doCheck)
|
|
|
|
(lib.cmakeBool "CPUINFO_BUILD_BENCHMARKS" false)
|
|
|
|
(lib.cmakeBool "USE_SYSTEM_LIBS" true)
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = !(stdenv.isLinux && stdenv.isAarch64);
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Tools and library to detect essential for performance optimization information about host CPU";
|
|
|
|
homepage = "https://github.com/pytorch/cpuinfo";
|
|
|
|
license = lib.licenses.bsd2;
|
|
|
|
mainProgram = "cpu-info";
|
|
|
|
maintainers = with lib.maintainers; [ pawelchcki ];
|
|
|
|
pkgConfigModules = [ "libcpuinfo" ];
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
})
|