{ stdenv, fetchgit, php, flex, makeWrapper }: let libphutil = fetchgit { url = "git://github.com/facebook/libphutil.git"; rev = "6c29d5c8d169084927df75b18761312195080550"; sha256 = "5891e5d7688a2f026e02a2684a2002c0715f0492fd8475bdcb8fab2066eff37a"; }; arcanist = fetchgit { url = "git://github.com/facebook/arcanist.git"; rev = "a70a00a960ff4a7e30e20b4db1c68c081f16eaa0"; sha256 = "37d9b80fbfc694df86a4bf75a540f81aa2e65f463d301d1f8a5930ecae8ba9fc"; }; in stdenv.mkDerivation rec { name = "arcanist-${version}"; version = "20140924"; 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 ]; }; }