2020-08-06 12:43:25 +01:00
|
|
|
|
{ stdenv, fetchFromGitHub, php, flex }:
|
|
|
|
|
|
|
|
|
|
# Make a custom wrapper. If `wrapProgram` is used, arcanist thinks .arc-wrapped is being
|
|
|
|
|
# invoked and complains about it being an unknown toolset. We could use `makeWrapper`, but
|
|
|
|
|
# then we’d need to still craft a script that does the `php libexec/arcanist/bin/...` dance
|
|
|
|
|
# anyway... So just do everything at once.
|
|
|
|
|
let makeArcWrapper = toolset: ''
|
|
|
|
|
cat << WRAPPER > $out/bin/${toolset}
|
|
|
|
|
#!$shell -e
|
|
|
|
|
export PATH='${php}/bin/'\''${PATH:+':'}\$PATH
|
|
|
|
|
exec ${php}/bin/php $out/libexec/arcanist/bin/${toolset} "\$@"
|
|
|
|
|
WRAPPER
|
|
|
|
|
chmod +x $out/bin/${toolset}
|
|
|
|
|
'';
|
2014-05-21 21:17:52 +01:00
|
|
|
|
|
|
|
|
|
in
|
2020-08-06 12:43:25 +01:00
|
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
|
stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
|
pname = "arcanist";
|
2020-08-06 12:43:25 +01:00
|
|
|
|
version = "20200711";
|
2014-05-21 21:17:52 +01:00
|
|
|
|
|
2020-08-06 12:43:25 +01:00
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "phacility";
|
|
|
|
|
repo = "arcanist";
|
|
|
|
|
rev = "2565cc7b4d1dbce6bc7a5b3c4e72ae94be4712fe";
|
|
|
|
|
sha256 = "0jiv4aj4m5750dqw9r8hizjkwiyxk4cg4grkr63sllsa2dpiibxw";
|
|
|
|
|
};
|
|
|
|
|
buildInputs = [ php flex ];
|
2018-01-06 15:49:26 +00:00
|
|
|
|
|
|
|
|
|
postPatch = stdenv.lib.optionalString stdenv.isAarch64 ''
|
2020-08-06 12:43:25 +01:00
|
|
|
|
substituteInPlace support/xhpast/Makefile \
|
2018-01-06 15:49:26 +00:00
|
|
|
|
--replace "-minline-all-stringops" ""
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
buildPhase = ''
|
2020-08-06 12:43:25 +01:00
|
|
|
|
make xhpast -C support/xhpast
|
2014-06-07 13:11:50 +01:00
|
|
|
|
'';
|
2020-08-06 12:43:25 +01:00
|
|
|
|
|
2014-05-21 21:17:52 +01:00
|
|
|
|
installPhase = ''
|
|
|
|
|
mkdir -p $out/bin $out/libexec
|
2020-08-06 12:43:25 +01:00
|
|
|
|
make install -C support/xhpast
|
|
|
|
|
cp -R $src $out/libexec/arcanist
|
|
|
|
|
|
|
|
|
|
${makeArcWrapper "arc"}
|
|
|
|
|
${makeArcWrapper "phage"}
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
|
$out/bin/arc help diff -- > /dev/null
|
|
|
|
|
$out/bin/phage help alias -- > /dev/null
|
2014-05-21 21:17:52 +01:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
|
description = "Command line interface to Phabricator";
|
|
|
|
|
homepage = "http://phabricator.org";
|
2014-05-21 21:21:50 +01:00
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
2014-05-21 21:17:52 +01:00
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
|
|
|
|
};
|
|
|
|
|
}
|