2017-06-08 18:26:42 +00:00
|
|
|
{ stdenv, fetchFromGitHub, jdk, ant, python2, python2Packages, watchman, unzip, bash, makeWrapper }:
|
2017-06-07 03:35:29 +00:00
|
|
|
|
2017-06-08 18:26:42 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2017-06-07 03:35:29 +00:00
|
|
|
name = "buck-${version}";
|
2017-11-01 19:33:54 +00:00
|
|
|
version = "v2017.10.01.01";
|
2017-06-07 03:35:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = "buck";
|
2017-11-01 19:33:54 +00:00
|
|
|
rev = "2025fd74327477728b524eafdd4619a0170a24ea";
|
|
|
|
sha256 = "05nyyb6f0hv1h67zzvdq8297yl8zjhpbasx35lxnrsjz0m1h8ngw";
|
2017-06-07 03:35:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./pex-mtime.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2017-06-08 07:36:59 +00:00
|
|
|
grep -l -r '/bin/bash' --null | xargs -0 sed -i -e "s!/bin/bash!${bash}/bin/bash!g"
|
2017-06-07 03:35:29 +00:00
|
|
|
'';
|
|
|
|
|
2017-06-08 07:36:59 +00:00
|
|
|
buildInputs = [ jdk ant python2 watchman python2Packages.pywatchman ];
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2017-06-07 03:35:29 +00:00
|
|
|
|
2017-06-08 22:36:30 +00:00
|
|
|
targets = [ "buck" "buckd" ];
|
|
|
|
|
2017-06-08 07:36:59 +00:00
|
|
|
buildPhase = ''
|
|
|
|
ant
|
2017-06-08 22:36:30 +00:00
|
|
|
|
|
|
|
for exe in ${toString targets}; do
|
|
|
|
./bin/buck build //programs:$exe
|
|
|
|
done
|
2017-06-08 07:36:59 +00:00
|
|
|
'';
|
2017-06-07 03:35:29 +00:00
|
|
|
|
2017-06-08 07:36:59 +00:00
|
|
|
installPhase = ''
|
2017-06-08 22:36:30 +00:00
|
|
|
for exe in ${toString targets}; do
|
|
|
|
install -D -m755 buck-out/gen/programs/$exe.pex $out/bin/$exe
|
|
|
|
wrapProgram $out/bin/$exe \
|
|
|
|
--prefix PYTHONPATH : $PYTHONPATH \
|
|
|
|
--prefix PATH : "${stdenv.lib.makeBinPath [jdk watchman]}"
|
|
|
|
done
|
2017-06-08 07:36:59 +00:00
|
|
|
'';
|
2017-06-07 03:35:29 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://buckbuild.com/;
|
|
|
|
description = "A high-performance build tool";
|
|
|
|
maintainers = [ maintainers.jgertm ];
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|