skopeo: build manpage

This commit is contained in:
Profpatsch 2018-03-29 18:05:48 +02:00
parent e01d485ce4
commit 679ac626dc

View File

@ -1,5 +1,6 @@
{ stdenv, lib, buildGoPackage, fetchFromGitHub, runCommand
, gpgme, libgpgerror, devicemapper, btrfs-progs, pkgconfig, ostree, libselinux }:
, gpgme, libgpgerror, devicemapper, btrfs-progs, pkgconfig, ostree, libselinux
, go-md2man }:
with stdenv.lib;
@ -15,15 +16,18 @@ let
defaultPolicyFile = runCommand "skopeo-default-policy.json" {} "cp ${src}/default-policy.json $out";
goPackagePath = "github.com/projectatomic/skopeo";
in
buildGoPackage rec {
name = "skopeo-${version}";
inherit src;
inherit src goPackagePath;
outputs = [ "bin" "man" "out" ];
goPackagePath = "github.com/projectatomic/skopeo";
excludedPackages = "integration";
nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [ pkgconfig (lib.getBin go-md2man) ];
buildInputs = [ gpgme libgpgerror devicemapper btrfs-progs ostree libselinux ];
buildFlagsArray = "-ldflags= -X github.com/projectatomic/skopeo/vendor/github.com/containers/image/signature.systemDefaultPolicyPath=${defaultPolicyFile}";
@ -33,6 +37,13 @@ buildGoPackage rec {
export CGO_LDFLAGS="-L${getLib gpgme}/lib -L${getLib libgpgerror}/lib -L${getLib devicemapper}/lib"
'';
postBuild = ''
# depends on buildGoPackage not changing …
pushd ./go/src/${goPackagePath}
make install-docs MANINSTALLDIR="$man"
popd
'';
meta = {
description = "A command line utility for various operations on container images and image repositories";
homepage = https://github.com/projectatomic/skopeo;