1{ stdenv, fetchFromGitHub, autoreconfHook
2, asciidoctor, pkgconfig, xmlto, docbook_xsl, docbook_xml_dtd_45, libxslt
3, json_c, kmod, which, file, utillinux, systemd
4}:
5
6stdenv.mkDerivation rec {
7 name = "libndctl-${version}";
8 version = "63";
9
10 src = fetchFromGitHub {
11 owner = "pmem";
12 repo = "ndctl";
13 rev = "v${version}";
14 sha256 = "060nsza8xic769bxj3pvl70a9885bwrc0myw16l095i3z6w7yzwq";
15 };
16
17 outputs = [ "out" "lib" "man" "dev" ];
18
19 nativeBuildInputs =
20 [ autoreconfHook asciidoctor pkgconfig xmlto docbook_xml_dtd_45 docbook_xsl libxslt
21 ];
22
23 buildInputs =
24 [ json_c kmod utillinux systemd
25 ];
26
27 configureFlags =
28 [ "--without-bash"
29 "--without-systemd"
30 ];
31
32 patchPhase = ''
33 patchShebangs test
34 substituteInPlace configure.ac --replace "which" "${which}/bin/which"
35
36 substituteInPlace git-version --replace /bin/bash ${stdenv.shell}
37 substituteInPlace git-version-gen --replace /bin/sh ${stdenv.shell}
38
39 echo "m4_define([GIT_VERSION], [${version}])" > version.m4;
40 '';
41
42 meta = with stdenv.lib; {
43 description = "Tools for managing the Linux Non-Volatile Memory Device sub-system";
44 homepage = https://github.com/pmem/ndctl;
45 license = licenses.lgpl21;
46 maintainers = with maintainers; [ thoughtpolice ];
47 platforms = platforms.linux;
48 };
49}