diff options
Diffstat (limited to 'pkgs/by-name/cp/cpuinfo/package.nix')
-rw-r--r-- | pkgs/by-name/cp/cpuinfo/package.nix | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/pkgs/by-name/cp/cpuinfo/package.nix b/pkgs/by-name/cp/cpuinfo/package.nix new file mode 100644 index 0000000000000..7e3c88015fa8c --- /dev/null +++ b/pkgs/by-name/cp/cpuinfo/package.nix @@ -0,0 +1,51 @@ +{ + lib, + fetchFromGitHub, + cmake, + pkg-config, + stdenv, + gtest, + nix-update-script, + testers, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "cpuinfo"; + version = "0-unstable-2024-08-07"; + + src = fetchFromGitHub { + owner = "pytorch"; + repo = "cpuinfo"; + rev = "16bfc1622c6902d6f91d316ec54894910c620325"; + hash = "sha256-LDqBH2O64PaVaqNvvjy/17kNpvfa60oP8VZ0GLeAAag="; + }; + + 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; + }; +}) |