depot/third_party/nixpkgs/pkgs/by-name/li/libcpucycles/package.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

53 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchzip,
python3,
librandombytes,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libcpucycles";
version = "20240318";
src = fetchzip {
url = "https://cpucycles.cr.yp.to/libcpucycles-${finalAttrs.version}.tar.gz";
hash = "sha256-Fb73EOHGgEehZJwTCtCG12xwyiqtDXFs9eFDsHBQiDo=";
};
patches = [ ./environment-variable-tools.patch ];
postPatch = ''
patchShebangs configure
patchShebangs scripts-build
'';
nativeBuildInputs = [ python3 ];
inherit (librandombytes) hardeningDisable configurePlatforms env;
preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
install_name_tool -id "$out/lib/libcpucycles.1.dylib" "$out/lib/libcpucycles.1.dylib"
install_name_tool -change "libcpucycles.1.dylib" "$out/lib/libcpucycles.1.dylib" "$out/bin/cpucycles-info"
'';
meta = {
homepage = "https://cpucycles.cr.yp.to/";
description = "Microlibrary for counting CPU cycles";
changelog = "https://cpucycles.cr.yp.to/download.html";
license = with lib.licenses; [
# Upstream specifies the public domain licenses with the terms here https://cr.yp.to/spdx.html
publicDomain
cc0
bsd0
mit
mit0
];
maintainers = with lib.maintainers; [
kiike
imadnyc
jleightcap
];
inherit (librandombytes.meta) platforms;
};
})