1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-14 08:34:50 +00:00
nixpkgs/pkgs/development/tools/misc/arcanist/default.nix

61 lines
1.7 KiB
Nix
Raw Normal View History

2016-08-26 00:22:57 +01:00
{ stdenv, fetchFromGitHub, php, flex, makeWrapper }:
let
2016-08-26 00:22:57 +01:00
libphutil = fetchFromGitHub {
owner = "phacility";
repo = "libphutil";
2020-01-28 03:19:40 +00:00
rev = "cc2a3dbf590389400da55563cb6993f321ec6d73";
sha256 = "1k7sr3racwz845i7r5kdwvgqrz8gldz07pxj3yw77s58rqbix3ad";
};
2016-08-26 00:22:57 +01:00
arcanist = fetchFromGitHub {
owner = "phacility";
repo = "arcanist";
2020-01-28 03:19:40 +00:00
rev = "21a1828ea06cf031e93082db8664d73efc88290a";
sha256 = "05rq9l9z7446ks270viay57r5ibx702b5bnlf4ck529zc4abympx";
};
in
2019-08-13 22:52:01 +01:00
stdenv.mkDerivation {
pname = "arcanist";
2020-01-28 03:19:40 +00:00
version = "20200127";
src = [ arcanist libphutil ];
buildInputs = [ php makeWrapper flex ];
2018-01-06 15:49:26 +00:00
unpackPhase = ''
cp -aR ${libphutil} libphutil
cp -aR ${arcanist} arcanist
chmod +w -R libphutil arcanist
2018-01-06 15:49:26 +00:00
'';
postPatch = stdenv.lib.optionalString stdenv.isAarch64 ''
substituteInPlace libphutil/support/xhpast/Makefile \
--replace "-minline-all-stringops" ""
'';
buildPhase = ''
2016-08-26 00:22:57 +01:00
(
cd libphutil/support/xhpast
make clean all install
)
'';
installPhase = ''
mkdir -p $out/bin $out/libexec
cp -R libphutil $out/libexec/libphutil
cp -R arcanist $out/libexec/arcanist
${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''}
'';
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 ];
};
}