Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3367501
D4662.id15110.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D4662.id15110.diff
View Options
diff --git a/nix/arcanist.nix b/nix/arcanist.nix
new file mode 100644
--- /dev/null
+++ b/nix/arcanist.nix
@@ -0,0 +1,64 @@
+{ stdenv
+, lib
+, cacert
+, fetchFromGitHub
+, installShellFiles
+, makeWrapper
+, php80
+, python3
+, which
+}:
+
+stdenv.mkDerivation {
+ pname = "arcanist";
+ version = "20220517";
+
+ src = fetchFromGitHub {
+ owner = "phacility";
+ repo = "arcanist";
+ rev = "85c953ebe4a6fef332158fd757d97c5a58682d3a";
+ sha256 = "0x847fw74mzrbhzpgc4iqgvs6dsf4svwfa707dsbxi78fn2lxbl7";
+ };
+
+ # These need to be in PATH during the build
+ nativeBuildInputs = [ php80 python3 installShellFiles makeWrapper ];
+
+ # Since we are exporting a script, we do not need to do an actual "build"
+ doBuild = false;
+
+ installPhase = ''
+ # Copy arcanist contents
+ mkdir -p $out/libexec
+ cp -R . $out/libexec/arcanist
+
+ # provide a recent up-to-date certificate bundle for ssl
+ ln -sf ${cacert}/etc/ssl/certs/ca-bundle.crt \
+ $out/libexec/arcanist/resources/ssl/default.pem
+
+ # convert `#!/usr/bin/env php` into calling nixpkgs php interpreter
+ patchShebangs $out/libexec/arcanist/bin/arc
+
+ # Create a bin/arc which points to the real script, but provides
+ # assumptions such as the PATH including python3 and which
+ makeWrapper $out/libexec/arcanist/bin/arc $out/bin/arc \
+ --prefix PATH : ${lib.makeBinPath [ which python3 ]}
+
+ # Add shell completion for bash
+ $out/bin/arc shell-complete --generate --
+ installShellCompletion --cmd arc --bash \
+ $out/libexec/arcanist/support/shell/rules/bash-rules.sh
+ '';
+
+ # Ensure `arc` is able to run without failing
+ doInstallCheck = true;
+ installCheckPhase = ''
+ $out/bin/arc help diff -- > /dev/null
+ '';
+
+ meta = {
+ description = "Command line interface to Phabricator";
+ homepage = "http://phabricator.org";
+ license = lib.licenses.asl20;
+ platforms = lib.platforms.unix;
+ };
+}
diff --git a/nix/overlay.nix b/nix/overlay.nix
--- a/nix/overlay.nix
+++ b/nix/overlay.nix
@@ -39,6 +39,8 @@
# add packages meant for just this repository
amqp-cpp = prev.callPackage ./amqp-cpp.nix { };
+ arcanist = prev.callPackage ./arcanist.nix { };
+
protobuf_3_15_cmake = prev.callPackage ./protobuf_3_15.nix { };
devShell = final.callPackage ./dev-shell.nix { };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 2:57 PM (20 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2585238
Default Alt Text
D4662.id15110.diff (2 KB)
Attached To
Mode
D4662: [Nix] Re-package arcanist as just the php scripts
Attached
Detach File
Event Timeline
Log In to Comment