packer: 0.8.6 -> 0.10.1
This commit is contained in:
parent
8ce8226655
commit
3aa2992bc1
@ -1,35 +1,53 @@
|
|||||||
{ stdenv, lib, go, gox, fetchgit, fetchhg, fetchbzr, fetchFromGitHub }:
|
{ stdenv, lib, go, gox, goPackages, fetchFromGitHub
|
||||||
|
, fetchgit, fetchhg, fetchbzr, fetchsvn }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "packer-0.8.6";
|
name = "packer-${version}";
|
||||||
|
version = "0.10.1";
|
||||||
|
|
||||||
src = import ./deps.nix {
|
src = import ./deps.nix {
|
||||||
inherit stdenv lib fetchgit fetchhg fetchbzr fetchFromGitHub;
|
inherit stdenv lib go gox goPackages fetchgit fetchhg fetchbzr fetchsvn;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ go gox ];
|
buildInputs = [ go gox goPackages.tools ];
|
||||||
|
|
||||||
|
configurePhase = ''
|
||||||
|
export GOPATH=$PWD/share/go
|
||||||
|
export XC_ARCH=$(go env GOARCH)
|
||||||
|
export XC_OS=$(go env GOOS)
|
||||||
|
|
||||||
|
mkdir $GOPATH/bin
|
||||||
|
|
||||||
|
cd $GOPATH/src/github.com/mitchellh/packer
|
||||||
|
|
||||||
|
# Don't fetch the deps
|
||||||
|
substituteInPlace "Makefile" --replace ': deps' ':'
|
||||||
|
|
||||||
|
# Avoid using git
|
||||||
|
sed \
|
||||||
|
-e "s|GITBRANCH:=.*||" \
|
||||||
|
-e "s|GITSHA:=.*|GITSHA=${src.rev}|" \
|
||||||
|
-i Makefile
|
||||||
|
sed \
|
||||||
|
-e "s|GIT_COMMIT=.*|GIT_COMMIT=${src.rev}|" \
|
||||||
|
-e "s|GIT_DIRTY=.*|GIT_DIRTY=|" \
|
||||||
|
-i "scripts/build.sh"
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
make generate releasebin
|
||||||
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
export GOPATH=$src
|
|
||||||
XC_ARCH=$(go env GOARCH)
|
|
||||||
XC_OS=$(go env GOOS)
|
|
||||||
|
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
|
mv bin/* $out/bin
|
||||||
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; {
|
meta = with stdenv.lib; {
|
||||||
description = "A tool for creating identical machine images for multiple platforms from a single source configuration";
|
description = "A tool for creating identical machine images for multiple platforms from a single source configuration";
|
||||||
homepage = "http://www.packer.io";
|
homepage = http://www.packer.io;
|
||||||
license = licenses.mpl20;
|
license = licenses.mpl20;
|
||||||
maintainers = with maintainers; [ cstrahan ];
|
maintainers = with maintainers; [ cstrahan zimbatm ];
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user