nixpkgs/pkgs/development/tools/build-managers/buck/default.nix

45 lines
1.2 KiB
Nix
Raw Normal View History

2021-04-24 18:25:35 +00:00
{ lib, stdenv, fetchFromGitHub, jdk8, ant, python3, 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";
2021-04-12 18:15:06 +00:00
version = "2021.01.12.01";
2017-06-07 03:35:29 +00:00
src = fetchFromGitHub {
owner = "facebook";
2019-04-11 13:10:00 +00:00
repo = pname;
rev = "v${version}";
2021-04-12 18:15:06 +00:00
sha256 = "sha256-NFiMQ+cG93R10LlkfUMzZ4TnV0uO5G+8S5TiMI6hU5o=";
2017-06-07 03:35:29 +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"
2017-06-07 03:35:29 +00:00
'';
2021-04-24 18:25:35 +00:00
nativeBuildInputs = [ makeWrapper python3 jdk8 ant watchman ];
2017-06-07 03:35:29 +00:00
buildPhase = ''
2021-04-12 18:15:06 +00:00
# Set correct version, see https://github.com/facebook/buck/issues/2607
echo v${version} > .buckrelease
ant
2019-05-01 06:13:47 +00:00
PYTHONDONTWRITEBYTECODE=true ./bin/buck build -c buck.release_version=${version} buck
'';
2017-06-07 03:35:29 +00:00
installPhase = ''
2021-04-12 18:15:06 +00:00
install -D -m755 buck-out/gen/*/programs/buck.pex $out/bin/buck
2019-04-11 13:10:00 +00:00
wrapProgram $out/bin/buck \
2021-04-24 18:25:35 +00:00
--prefix PATH : "${lib.makeBinPath [ jdk8 watchman python3 ]}"
'';
2017-06-07 03:35:29 +00:00
meta = with lib; {
homepage = "https://buck.build/";
2017-06-07 03:35:29 +00:00
description = "A high-performance build tool";
maintainers = [ maintainers.jgertm maintainers.marsam ];
2017-06-07 03:35:29 +00:00
license = licenses.asl20;
platforms = platforms.all;
};
}