Merge pull request #38049 from Profpatsch/skopeo-man

skopeo: build manpage
This commit is contained in:
lewo 2018-03-29 18:22:06 +02:00 committed by GitHub
commit 01ef780b5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;