2021-04-25 03:57:28 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, jdk8, ant, python3, watchman, bash, makeWrapper }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "buck";
|
2021-04-22 02:08:21 +00:00
|
|
|
version = "2021.01.12.01";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-04-22 02:08:21 +00:00
|
|
|
sha256 = "sha256-NFiMQ+cG93R10LlkfUMzZ4TnV0uO5G+8S5TiMI6hU5o=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./pex-mtime.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
grep -l -r '/bin/bash' --null | xargs -0 sed -i -e "s!/bin/bash!${bash}/bin/bash!g"
|
|
|
|
'';
|
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper python3 jdk8 ant watchman ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2021-04-22 02:08:21 +00:00
|
|
|
# Set correct version, see https://github.com/facebook/buck/issues/2607
|
|
|
|
echo v${version} > .buckrelease
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
ant
|
|
|
|
|
|
|
|
PYTHONDONTWRITEBYTECODE=true ./bin/buck build -c buck.release_version=${version} buck
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-22 02:08:21 +00:00
|
|
|
install -D -m755 buck-out/gen/*/programs/buck.pex $out/bin/buck
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/bin/buck \
|
2021-04-25 03:57:28 +00:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ jdk8 watchman python3 ]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://buck.build/";
|
|
|
|
description = "A high-performance build tool";
|
|
|
|
maintainers = [ maintainers.jgertm maintainers.marsam ];
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|