2024-08-08 19:59:05 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
static ? stdenv.hostPlatform.isStatic,
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cpu_features";
|
2025-05-13 15:34:33 +00:00
|
|
|
version = "0.10.1";
|
2024-08-08 19:59:05 +02:00
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "cpu_features";
|
2025-04-08 02:51:45 -04:00
|
|
|
rev = "v${version}";
|
2025-05-13 15:34:33 +00:00
|
|
|
hash = "sha256-IBJc1sHHh4G3oTzQm1RAHHahsEECC+BDl14DHJ8M1Ys=";
|
2024-08-08 19:59:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2025-06-05 09:11:29 -07:00
|
|
|
description = "Cross platform C99 library to get cpu features at runtime";
|
2024-08-08 19:59:05 +02:00
|
|
|
homepage = "https://github.com/google/cpu_features";
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ renesat ];
|
|
|
|
};
|
|
|
|
}
|