From 3901f0c853ae3e8b2d727b1035e7a2590a105833 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 1 Aug 2023 14:34:05 -0700 Subject: [PATCH] libnvme: add withDocs The libnvme documentation fails to build when cross compiling, with: FAILED: doc/nvme_admin_opcode.2 /nix/store/qcvcsink30f4wh36jzg3rbvkshwzj38c-meson-1.1.1/bin/meson --internal exe --capture doc/nvme_admin_opcode.2 -- /build/source/doc/kernel-doc -module libnvme -man -function nvme_admin_opcode ../doc/../src/nvme/types.h Traceback (most recent call last): File "/nix/store/qcvcsink30f4wh36jzg3rbvkshwzj38c-meson-1.1.1/bin/meson", line 6, in File "/nix/store/qcvcsink30f4wh36jzg3rbvkshwzj38c-meson-1.1.1/lib/python3.10/site-packages/mesonbuild/mesonmain.py", line 30, in from . import mlog ImportError: cannot import name 'mlog' from 'mesonbuild' (/nix/store/qcvcsink30f4wh36jzg3rbvkshwzj38c-meson-1.1.1/lib/python3.10/site-packages/mesonbuild/__init__.py) [703/811] Generating doc/nvme_identify_cns_man with a custom command (wrapped by meson to capture output) FAILED: doc/nvme_identify_cns.2 /nix/store/qcvcsink30f4wh36jzg3rbvkshwzj38c-meson-1.1.1/bin/meson --internal exe --capture doc/nvme_identify_cns.2 -- /build/source/doc/kernel-doc -module libnvme -man -function nvme_identify_cns ../doc/../src/nvme/types.h Traceback (most recent call last): File "/nix/store/qcvcsink30f4wh36jzg3rbvkshwzj38c-meson-1.1.1/bin/meson", line 6, in File "/nix/store/qcvcsink30f4wh36jzg3rbvkshwzj38c-meson-1.1.1/lib/python3.10/site-packages/mesonbuild/mesonmain.py", line 30, in from . import mlog --- pkgs/os-specific/linux/libnvme/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/libnvme/default.nix b/pkgs/os-specific/linux/libnvme/default.nix index 4ed838051f6ff..029deb0b48a27 100644 --- a/pkgs/os-specific/linux/libnvme/default.nix +++ b/pkgs/os-specific/linux/libnvme/default.nix @@ -11,13 +11,15 @@ , stdenv , swig , systemd +# ImportError: cannot import name 'mlog' from 'mesonbuild' +, withDocs ? stdenv.hostPlatform.canExecute stdenv.buildPlatform }: stdenv.mkDerivation rec { pname = "libnvme"; version = "1.4"; - outputs = [ "out" "man" ]; + outputs = [ "out" ] ++ lib.optionals withDocs [ "man" ]; src = fetchFromGitHub { owner = "linux-nvme"; @@ -51,7 +53,7 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Ddocs=man" - "-Ddocs-build=true" + (lib.mesonBool "docs-build" withDocs) ]; preConfigure = ''