Files
nixpkgs/pkgs/by-name/li/libbytesize/package.nix
Dark Steveneq 646b892680
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
push sheeet
2025-10-09 14:15:47 +02:00

79 lines
1.6 KiB
Nix

{
lib,
autoreconfHook,
docbook_xml_dtd_43,
docbook_xsl,
fetchFromGitHub,
gettext,
gmp,
gtk-doc,
libxslt,
mpfr,
pcre2,
pkg-config,
python3Packages,
stdenv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libbytesize";
version = "2.11";
src = fetchFromGitHub {
owner = "storaged-project";
repo = "libbytesize";
rev = finalAttrs.version;
hash = "sha256-scOnucn7xp6KKEtkpwfyrdzcntJF2l0h0fsQotcceLc=";
};
outputs = [
"out"
"dev"
"devdoc"
"man"
];
nativeBuildInputs = [
autoreconfHook
docbook_xml_dtd_43
docbook_xsl
gettext
gtk-doc
libxslt
pkg-config
python3Packages.python
];
nativeInstallCheckInputs = [
python3Packages.pythonImportsCheckHook
];
buildInputs = [
gmp
mpfr
pcre2
];
doInstallCheck = true;
strictDeps = true;
postInstall = ''
substituteInPlace $out/${python3Packages.python.sitePackages}/bytesize/bytesize.py \
--replace-fail 'CDLL("libbytesize.so.1")' "CDLL('$out/lib/libbytesize.so.1')"
# Force compilation of .pyc files to make them deterministic
${python3Packages.python.pythonOnBuildForHost.interpreter} -m compileall $out/${python3Packages.python.sitePackages}/bytesize
'';
pythonImportsCheck = [ "bytesize" ];
meta = {
homepage = "https://github.com/storaged-project/libbytesize";
description = "Tiny library providing a C 'class' for working with arbitrary big sizes in bytes";
license = lib.licenses.lgpl2Plus;
mainProgram = "bscalc";
maintainers = [ ];
platforms = lib.platforms.linux;
};
})