2018-02-12 11:10:40 +00:00
|
|
|
|
{ stdenv, lib, buildGoPackage, fetchFromGitHub, runCommand
|
2018-07-17 21:11:16 +01:00
|
|
|
|
, gpgme, libgpgerror, lvm2, btrfs-progs, pkgconfig, ostree, libselinux, libseccomp
|
2018-02-12 11:10:40 +00:00
|
|
|
|
, go-md2man }:
|
|
|
|
|
|
|
|
|
|
let
|
2018-07-08 08:49:57 +01:00
|
|
|
|
version = "1.1";
|
2018-02-12 11:10:40 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
rev = "v${version}";
|
|
|
|
|
owner = "projectatomic";
|
|
|
|
|
repo = "buildah";
|
2018-07-08 08:49:57 +01:00
|
|
|
|
sha256 = "0pc7bzcaafrz56glygzhnbilgaz4ca2kmklw8njfgamffbw4d54p";
|
2018-02-12 11:10:40 +00:00
|
|
|
|
};
|
|
|
|
|
goPackagePath = "github.com/projectatomic/buildah";
|
|
|
|
|
|
|
|
|
|
in buildGoPackage rec {
|
|
|
|
|
name = "buildah-${version}";
|
|
|
|
|
inherit src;
|
|
|
|
|
|
|
|
|
|
outputs = [ "bin" "man" "out" ];
|
|
|
|
|
|
|
|
|
|
inherit goPackagePath;
|
|
|
|
|
excludedPackages = [ "tests" ];
|
|
|
|
|
|
2018-07-08 08:49:57 +01:00
|
|
|
|
# Optimizations break compilation of libseccomp c bindings
|
|
|
|
|
hardeningDisable = [ "fortify" ];
|
|
|
|
|
|
2018-02-12 11:10:40 +00:00
|
|
|
|
nativeBuildInputs = [ pkgconfig go-md2man.bin ];
|
2018-07-17 21:11:16 +01:00
|
|
|
|
buildInputs = [ gpgme libgpgerror lvm2 btrfs-progs ostree libselinux libseccomp ];
|
2018-02-12 11:10:40 +00:00
|
|
|
|
|
|
|
|
|
# Copied from the skopeo package, doesn’t seem to make a difference?
|
|
|
|
|
# If something related to these libs failed, uncomment these lines.
|
|
|
|
|
/*preBuild = with lib; ''
|
|
|
|
|
export CGO_CFLAGS="-I${getDev gpgme}/include -I${getDev libgpgerror}/include -I${getDev devicemapper}/include -I${getDev btrfs-progs}/include"
|
|
|
|
|
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}/docs
|
|
|
|
|
make docs
|
|
|
|
|
make install PREFIX="$man"
|
|
|
|
|
popd
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
|
description = "A tool which facilitates building OCI images";
|
|
|
|
|
homepage = https://github.com/projectatomic/buildah;
|
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ Profpatsch ];
|
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
|
|
|
|
};
|
|
|
|
|
}
|