{ stdenv, fetchgit, php, flex, makeWrapper }: let libphutil = fetchgit { url = "git://github.com/facebook/libphutil.git"; rev = "0027e97cd6cbafcbdc626b4ac6cf315b9508a14f"; sha256 = "4781a4e3e1cb72da24e97f89a9b879803be8e1cf6baa2a4517801dfb893eec26"; }; arcanist = fetchgit { url = "git://github.com/facebook/arcanist.git"; rev = "680ec3670cd9d9195debf3e9b674b1b232156e61"; sha256 = "a70cde586960676c0d69f4d98e6936633e0d79c37c6f6cc5b0213146a6b18c83"; }; in stdenv.mkDerivation rec { name = "arcanist-${version}"; version = "20140617"; src = [ arcanist libphutil ]; buildInputs = [ php makeWrapper flex ]; unpackPhase = "true"; buildPhase = '' ORIG=`pwd` cp -R ${libphutil} libphutil cp -R ${arcanist} arcanist chmod +w -R libphutil arcanist cd libphutil/support/xhpast make clean all install cd $ORIG ''; installPhase = '' mkdir -p $out/bin $out/libexec cp -R libphutil $out/libexec/libphutil cp -R arcanist $out/libexec/arcanist ln -s $out/libexec/arcanist/bin/arc $out/bin wrapProgram $out/bin/arc \ --prefix PATH : "${php}/bin" ''; meta = { description = "Command line interface to Phabricator"; homepage = "http://phabricator.org"; license = stdenv.lib.licenses.asl20; platforms = stdenv.lib.platforms.unix; maintainers = [ stdenv.lib.maintainers.thoughtpolice ]; }; }