Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
56 lines
1.4 KiB
Nix
56 lines
1.4 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"
|
|
'';
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
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;
|
|
};
|
|
})
|