2016-08-26 01:22:57 +02:00
|
|
|
{ stdenv, fetchFromGitHub, php, flex, makeWrapper }:
|
2014-05-21 22:17:52 +02:00
|
|
|
|
|
|
|
let
|
2016-08-26 01:22:57 +02:00
|
|
|
libphutil = fetchFromGitHub {
|
|
|
|
owner = "phacility";
|
|
|
|
repo = "libphutil";
|
2020-01-28 04:19:40 +01:00
|
|
|
rev = "cc2a3dbf590389400da55563cb6993f321ec6d73";
|
|
|
|
sha256 = "1k7sr3racwz845i7r5kdwvgqrz8gldz07pxj3yw77s58rqbix3ad";
|
2014-05-21 22:17:52 +02:00
|
|
|
};
|
2016-08-26 01:22:57 +02:00
|
|
|
arcanist = fetchFromGitHub {
|
|
|
|
owner = "phacility";
|
|
|
|
repo = "arcanist";
|
2020-01-28 04:19:40 +01:00
|
|
|
rev = "21a1828ea06cf031e93082db8664d73efc88290a";
|
|
|
|
sha256 = "05rq9l9z7446ks270viay57r5ibx702b5bnlf4ck529zc4abympx";
|
2014-05-21 22:17:52 +02:00
|
|
|
};
|
|
|
|
in
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "arcanist";
|
2020-01-28 04:19:40 +01:00
|
|
|
version = "20200127";
|
2014-05-21 22:17:52 +02:00
|
|
|
|
|
|
|
src = [ arcanist libphutil ];
|
2014-06-07 14:11:50 +02:00
|
|
|
buildInputs = [ php makeWrapper flex ];
|
2014-05-21 22:17:52 +02:00
|
|
|
|
2018-01-06 16:49:26 +01:00
|
|
|
unpackPhase = ''
|
2018-09-18 01:38:05 +02:00
|
|
|
cp -aR ${libphutil} libphutil
|
|
|
|
cp -aR ${arcanist} arcanist
|
2014-06-09 08:29:53 +02:00
|
|
|
chmod +w -R libphutil arcanist
|
2018-01-06 16:49:26 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
postPatch = stdenv.lib.optionalString stdenv.isAarch64 ''
|
|
|
|
substituteInPlace libphutil/support/xhpast/Makefile \
|
|
|
|
--replace "-minline-all-stringops" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2016-08-26 01:22:57 +02:00
|
|
|
(
|
|
|
|
cd libphutil/support/xhpast
|
|
|
|
make clean all install
|
|
|
|
)
|
2014-06-07 14:11:50 +02:00
|
|
|
'';
|
2014-05-21 22:17:52 +02:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/libexec
|
2014-06-09 08:25:20 +02:00
|
|
|
cp -R libphutil $out/libexec/libphutil
|
|
|
|
cp -R arcanist $out/libexec/arcanist
|
2020-05-09 18:33:57 +02:00
|
|
|
${if stdenv.isDarwin then ''
|
|
|
|
echo "#! $shell -e" > $out/bin/arc
|
|
|
|
echo "exec ${php}/bin/php $out/libexec/arcanist/scripts/arcanist.php "'"$@"' >> $out/bin/arc
|
|
|
|
chmod +x $out/bin/arc''
|
|
|
|
else ''
|
|
|
|
ln -s $out/libexec/arcanist/scripts/arcanist.php $out/bin/arc''}
|
2014-05-21 22:17:52 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Command line interface to Phabricator";
|
|
|
|
homepage = "http://phabricator.org";
|
2014-05-21 22:21:50 +02:00
|
|
|
license = stdenv.lib.licenses.asl20;
|
2014-05-21 22:17:52 +02:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|