9 stdenv.mkDerivation (finalAttrs: {
10 pname = "libcpucycles";
14 url = "https://cpucycles.cr.yp.to/libcpucycles-${finalAttrs.version}.tar.gz";
15 hash = "sha256-Fb73EOHGgEehZJwTCtCG12xwyiqtDXFs9eFDsHBQiDo=";
18 patches = [ ./environment-variable-tools.patch ];
21 patchShebangs configure
22 patchShebangs scripts-build
25 nativeBuildInputs = [ python3 ];
27 inherit (librandombytes) hardeningDisable configurePlatforms env;
29 preFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
30 install_name_tool -id "$out/lib/libcpucycles.1.dylib" "$out/lib/libcpucycles.1.dylib"
31 install_name_tool -change "libcpucycles.1.dylib" "$out/lib/libcpucycles.1.dylib" "$out/bin/cpucycles-info"
34 passthru.updateScript = ./update.sh;
37 homepage = "https://cpucycles.cr.yp.to/";
38 description = "Microlibrary for counting CPU cycles";
39 changelog = "https://cpucycles.cr.yp.to/download.html";
40 license = with lib.licenses; [
41 # Upstream specifies the public domain licenses with the terms here https://cr.yp.to/spdx.html
48 maintainers = with lib.maintainers; [
53 inherit (librandombytes.meta) platforms;