nixpkgs/pkgs/development/tools/build-managers/buck/default.nix
Guillaume Maudoux de8fe66ba0 buck: use upstream version convention
Changes added in 4d1fd3775d break
automated updates by moving to a custom version scheme.

This switches back to upstream versioning, while maintaining version
schema convention of `builtins.parseDrvName`.

See issue #43717
2018-11-18 09:56:23 +01:00

50 lines
1.2 KiB
Nix

{ stdenv, fetchFromGitHub, jdk, ant, python2, python2Packages, watchman, bash, makeWrapper }:
stdenv.mkDerivation rec {
name = "buck-${version}";
version = "2017.10.01.01";
src = fetchFromGitHub {
owner = "facebook";
repo = "buck";
rev = "v${version}";
sha256 = "05nyyb6f0hv1h67zzvdq8297yl8zjhpbasx35lxnrsjz0m1h8ngw";
};
patches = [ ./pex-mtime.patch ];
postPatch = ''
grep -l -r '/bin/bash' --null | xargs -0 sed -i -e "s!/bin/bash!${bash}/bin/bash!g"
'';
buildInputs = [ jdk ant python2 watchman python2Packages.pywatchman ];
nativeBuildInputs = [ makeWrapper ];
targets = [ "buck" "buckd" ];
buildPhase = ''
ant
for exe in ${toString targets}; do
./bin/buck build //programs:$exe
done
'';
installPhase = ''
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
'';
meta = with stdenv.lib; {
homepage = https://buckbuild.com/;
description = "A high-performance build tool";
maintainers = [ maintainers.jgertm ];
license = licenses.asl20;
platforms = platforms.all;
};
}