nixpkgs/pkgs/by-name/li/libndctl/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

77 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;
};
}