Merge pull request #323890 from pawelchcki/add-cpu-info

cpuinfo: init at 0-unstable-2024-06-02
This commit is contained in:
Martin Weinelt 2024-07-11 00:21:18 +02:00 committed by GitHub
commit 12f8b4b1e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 57 additions and 0 deletions

View File

@ -15413,6 +15413,12 @@
githubId = 49961859;
name = "Pavel Sobolev";
};
pawelchcki = {
email = "pawel.chcki@gmail.com";
github = "pawelchcki";
githubId = 812891;
name = "Paweł Chojnacki";
};
pawelpacana = {
email = "pawel.pacana@gmail.com";
github = "pawelpacana";

View File

@ -0,0 +1,51 @@
{
lib,
fetchFromGitHub,
cmake,
pkg-config,
stdenv,
gtest,
nix-update-script,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cpuinfo";
version = "0-unstable-2024-06-02";
src = fetchFromGitHub {
owner = "pytorch";
repo = "cpuinfo";
rev = "05332fd802d9109a2a151ec32154b107c1e5caf9";
hash = "sha256-VhTRHpT+4g97m+amOZ52lJWavHsN5QVnjnEn6wJzE3A=";
};
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;
};
})