2015-08-27 11:29:45 +01:00
|
|
|
{ stdenv, lib, go, gox, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
|
2014-05-14 00:19:41 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-01-21 23:16:22 +00:00
|
|
|
name = "packer-0.8.6";
|
2014-05-14 00:19:41 +01:00
|
|
|
|
|
|
|
src = import ./deps.nix {
|
|
|
|
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
|
|
|
|
};
|
|
|
|
|
2015-08-27 11:29:45 +01:00
|
|
|
buildInputs = [ go gox ];
|
2014-05-14 00:19:41 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
export GOPATH=$src
|
|
|
|
XC_ARCH=$(go env GOARCH)
|
|
|
|
XC_OS=$(go env GOOS)
|
|
|
|
|
2014-07-22 10:01:32 +01:00
|
|
|
mkdir -p $out/bin
|
2014-05-14 00:19:41 +01:00
|
|
|
|
|
|
|
cd $src/src/github.com/mitchellh/packer
|
|
|
|
gox \
|
|
|
|
-os="''${XC_OS}" \
|
|
|
|
-arch="''${XC_ARCH}" \
|
|
|
|
-output "$out/bin/packer-{{.Dir}}" \
|
|
|
|
./...
|
|
|
|
mv $out/bin/packer{*packer*,}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A tool for creating identical machine images for multiple platforms from a single source configuration";
|
|
|
|
homepage = "http://www.packer.io";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ cstrahan ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|