Skip to content

Commit 3f48f68

Browse files
committed
containerd: conditionally build manpages
An in-tree binary is used to build some manpages, which won't work when cross compiling unless the buildPlatform can execute code for the hostPlatform
1 parent 0422fd6 commit 3f48f68

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkgs/by-name/co/containerd/package.nix

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
lib,
3+
stdenv,
34
btrfs-progs,
45
buildGoModule,
56
fetchFromGitHub,
@@ -9,6 +10,7 @@
910
nixosTests,
1011
util-linux,
1112
btrfsSupport ? btrfs-progs != null,
13+
withMan ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
1214
}:
1315

1416
buildGoModule rec {
@@ -18,8 +20,7 @@ buildGoModule rec {
1820
outputs = [
1921
"out"
2022
"doc"
21-
"man"
22-
];
23+
] ++ lib.optional withMan "man";
2324

2425
src = fetchFromGitHub {
2526
owner = "containerd";
@@ -35,9 +36,8 @@ buildGoModule rec {
3536
strictDeps = true;
3637

3738
nativeBuildInputs = [
38-
go-md2man
3939
util-linux
40-
];
40+
] ++ lib.optional withMan go-md2man;
4141

4242
buildInputs = lib.optional btrfsSupport btrfs-progs;
4343

@@ -54,8 +54,7 @@ buildGoModule rec {
5454
installTargets = [
5555
"install"
5656
"install-doc"
57-
"install-man"
58-
];
57+
] ++ lib.optional withMan "install-man";
5958

6059
buildPhase = ''
6160
runHook preBuild

0 commit comments

Comments
 (0)