depot/third_party/nixpkgs/pkgs/development/libraries/libndctl/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

76 lines
1.5 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
meson,
ninja,
pkg-config,
asciidoctor,
iniparser,
json_c,
keyutils,
kmod,
udev,
util-linux,
}:
stdenv.mkDerivation rec {
pname = "libndctl";
version = "79";
src = fetchFromGitHub {
owner = "pmem";
repo = "ndctl";
rev = "v${version}";
sha256 = "sha256-gG1Rz5AtDLzikGFr8A3l25ypd+VoLw2oWjszy9ogDLk=";
};
outputs = [
"out"
"man"
"dev"
];
nativeBuildInputs = [
meson
ninja
pkg-config
asciidoctor
];
buildInputs = [
iniparser
json_c
keyutils
kmod
udev
util-linux
];
mesonFlags = [
(lib.mesonOption "rootprefix" "${placeholder "out"}")
(lib.mesonOption "sysconfdir" "${placeholder "out"}/etc/ndctl.conf.d")
(lib.mesonEnable "libtracefs" false)
# Use asciidoctor due to xmlto errors
(lib.mesonEnable "asciidoctor" true)
(lib.mesonEnable "systemd" false)
(lib.mesonOption "iniparserdir" "${iniparser}")
];
postPatch = ''
patchShebangs test
substituteInPlace git-version --replace-fail /bin/bash ${stdenv.shell}
substituteInPlace git-version-gen --replace-fail /bin/sh ${stdenv.shell}
echo "m4_define([GIT_VERSION], [${version}])" > version.m4;
'';
meta = {
description = "Tools for managing the Linux Non-Volatile Memory Device sub-system";
homepage = "https://github.com/pmem/ndctl";
license = lib.licenses.lgpl21;
maintainers = with lib.maintainers; [ thoughtpolice ];
platforms = lib.platforms.linux;
};
}