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