mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-02 21:54:45 +00:00
- Add OR operator, as per https://cpucycles.cr.yp.to/license.html - Update URL to license in comment (the previous URL is included in the page the replaced one points to). Ref: https://github.com/ngi-nix/projects/issues/102 This work is done as part of Summer of Nix 2026.
57 lines
1.5 KiB
Nix
57 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchzip,
|
|
python3,
|
|
librandombytes,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "libcpucycles";
|
|
version = "20260105";
|
|
|
|
src = fetchzip {
|
|
url = "https://cpucycles.cr.yp.to/libcpucycles-${finalAttrs.version}.tar.gz";
|
|
hash = "sha256-hWmMLBadM/E/kF8D/cTjU+G0f2HTkZQlKoIWsgzAFj0=";
|
|
};
|
|
|
|
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 =
|
|
# Upstream specifies the public domain licenses with the terms here https://cpucycles.cr.yp.to/license.html
|
|
lib.licenses.OR [
|
|
lib.licenses.publicDomain
|
|
lib.licenses.cc0
|
|
lib.licenses.bsd0
|
|
lib.licenses.mit
|
|
lib.licenses.mit0
|
|
];
|
|
maintainers = with lib.maintainers; [
|
|
kiike
|
|
imadnyc
|
|
jleightcap
|
|
];
|
|
inherit (librandombytes.meta) platforms;
|
|
};
|
|
})
|