summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/buck/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/build-managers/buck/default.nix')
-rw-r--r--pkgs/development/tools/build-managers/buck/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/development/tools/build-managers/buck/default.nix b/pkgs/development/tools/build-managers/buck/default.nix
new file mode 100644
index 00000000000..020750393cd
--- /dev/null
+++ b/pkgs/development/tools/build-managers/buck/default.nix
@@ -0,0 +1,46 @@
+  { stdenv, pkgs, fetchFromGitHub, fetchgit, jdk, ant, python2, watchman, unzip, bash }:
+
+stdenv.mkDerivation rec {
+  name = "buck-${version}";
+  version = "v2017.05.31.01";
+
+  src = fetchFromGitHub {
+    owner = "facebook";
+    repo = "buck";
+    rev = "0b8b3828a11afa79dc128832cb55b106f07e48aa";
+    sha256 = "1g3yg8qq91cdhsq7zmir7wxw3767l120f5zhq969gppdw9apqy0s";
+  };
+
+  patches = [ ./pex-mtime.patch ];
+
+  postPatch = ''
+    for f in $(grep -l -r '/bin/bash'); do
+      substituteInPlace "$f" --replace '/bin/bash' '${bash}/bin/bash'
+    done
+  '';
+
+  buildInputs = [ jdk ant ];
+
+  propagatedBuildInputs = [ python2 watchman pkgs.python27Packages.pywatchman ];
+
+  buildPhase =
+    ''
+      ant
+      ./bin/buck --version
+      ./bin/buck build buck
+    '';
+
+  installPhase =
+    ''
+      mkdir -p $out/bin
+      cp  buck-out/gen/programs/buck.pex $out/bin/buck
+    '';
+
+  meta = with stdenv.lib; {
+    homepage = https://buckbuild.com/;
+    description = "A high-performance build tool";
+    maintainers = [ maintainers.jgertm ];
+    license = licenses.asl20;
+    platforms = platforms.all;
+  };
+}