Merge pull request #85414 from zowoq/skopeo

This commit is contained in:
Jörg Thalheim 2020-04-19 18:12:50 +01:00 committed by GitHub
commit d96959a629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,4 @@
{ stdenv { stdenv
, lib
, buildGoPackage , buildGoPackage
, fetchFromGitHub , fetchFromGitHub
, runCommand , runCommand
@ -10,10 +9,9 @@
, pkg-config , pkg-config
, libselinux , libselinux
, go-md2man , go-md2man
, installShellFiles
}: }:
with stdenv.lib;
let let
version = "0.2.0"; version = "0.2.0";
@ -28,6 +26,8 @@ let
goPackagePath = "github.com/containers/skopeo"; goPackagePath = "github.com/containers/skopeo";
vendorPath = "${goPackagePath}/vendor/github.com/containers/image/v5";
in in
buildGoPackage { buildGoPackage {
pname = "skopeo"; pname = "skopeo";
@ -36,26 +36,23 @@ buildGoPackage {
outputs = [ "bin" "man" "out" ]; outputs = [ "bin" "man" "out" ];
excludedPackages = "integration"; excludedPackages = [ "integration" ];
nativeBuildInputs = [ pkg-config (lib.getBin go-md2man) ]; nativeBuildInputs = [ pkg-config go-md2man installShellFiles ];
buildInputs = [ gpgme ] ++ lib.optionals stdenv.isLinux [ libgpgerror lvm2 btrfs-progs libselinux ]; buildInputs = [ gpgme ]
++ stdenv.lib.optionals stdenv.isLinux [ libgpgerror lvm2 btrfs-progs libselinux ];
buildFlagsArray = '' buildFlagsArray = ''
-ldflags= -ldflags=
-X github.com/containers/skopeo/vendor/github.com/containers/image/v5/signature.systemDefaultPolicyPath=${defaultPolicyFile} -X ${vendorPath}/signature.systemDefaultPolicyPath=${defaultPolicyFile}
-X github.com/containers/skopeo/vendor/github.com/containers/image/v5/internal/tmpdir.unixTempDirForBigFiles=/tmp -X ${vendorPath}/internal/tmpdir.unixTempDirForBigFiles=/tmp
'';
preBuild = ''
export CGO_CFLAGS="$CFLAGS"
export CGO_LDFLAGS="$LDFLAGS"
''; '';
postBuild = '' postBuild = ''
# depends on buildGoPackage not changing … # depends on buildGoPackage not changing …
pushd ./go/src/${goPackagePath} pushd ./go/src/${goPackagePath}
make install-docs MANINSTALLDIR="$man/share/man" make install-docs MANINSTALLDIR="$man/share/man"
installShellCompletion --bash completions/bash/skopeo
popd popd
''; '';