2018-07-21 00:44:44 +00:00
|
|
|
{ stdenv, fetchFromGitHub, jdk, ant, python2, python2Packages, watchman, bash, makeWrapper }:
|
2017-06-07 03:35:29 +00:00
|
|
|
|
2017-06-08 18:26:42 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-04-11 13:10:00 +00:00
|
|
|
pname = "buck";
|
2019-06-01 08:14:13 +00:00
|
|
|
version = "2019.05.22.01";
|
2017-06-07 03:35:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
2019-04-11 13:10:00 +00:00
|
|
|
repo = pname;
|
2018-11-18 08:28:02 +00:00
|
|
|
rev = "v${version}";
|
2019-06-01 08:14:13 +00:00
|
|
|
sha256 = "1fxprw18kd3cw1lzv4xi1lnbdni06hs4vm9yh0w548rsfn3wnmxq";
|
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 07:36:59 +00:00
|
|
|
buildPhase = ''
|
|
|
|
ant
|
2017-06-08 22:36:30 +00:00
|
|
|
|
2019-05-01 06:13:47 +00:00
|
|
|
PYTHONDONTWRITEBYTECODE=true ./bin/buck build -c buck.release_version=${version} buck
|
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 = ''
|
2019-04-11 13:10:00 +00:00
|
|
|
install -D -m755 buck-out/gen/programs/buck.pex $out/bin/buck
|
|
|
|
wrapProgram $out/bin/buck \
|
|
|
|
--prefix PYTHONPATH : $PYTHONPATH \
|
|
|
|
--prefix PATH : "${stdenv.lib.makeBinPath [jdk watchman]}"
|
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;
|
|
|
|
};
|
|
|
|
}
|