mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 17:14:00 +00:00
Merge pull request #319608 from jleightcap/fern/libcpucycles
libcpucycles: init at 20240318
This commit is contained in:
commit
c2ed3fdd4a
55
pkgs/by-name/li/libcpucycles/package.nix
Normal file
55
pkgs/by-name/li/libcpucycles/package.nix
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
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=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs configure
|
||||
patchShebangs scripts-build
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ python3 ];
|
||||
|
||||
inherit (librandombytes) hardeningDisable configurePlatforms env;
|
||||
|
||||
preFixup = lib.optionalString stdenv.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
|
||||
];
|
||||
# list of architectures it supports, but currentlly untested with nix https://cpucycles.cr.yp.to/libcpucycles-20240318/cpucycles/options.html
|
||||
platforms = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
] ++ lib.platforms.darwin;
|
||||
};
|
||||
})
|
@ -21,6 +21,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
patchShebangs scripts-build
|
||||
'';
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
||||
# NOTE: librandombytes uses a custom Python `./configure`: it does not expect standard
|
||||
# autoconfig --build --host etc. arguments: disable
|
||||
configurePlatforms = [ ];
|
||||
|
Loading…
Reference in New Issue
Block a user