Patch paths to php executable, so things like ssh-auth work again
without workarounds.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
PORTNAME?= arcanist
|
||||
PORTVERSION?= 20200514
|
||||
PORTREVISION?= 1
|
||||
CATEGORIES?= devel
|
||||
PKGNAMESUFFIX= ${SLAVE_PKGNAMESUFFIX}${PHP_PKGNAMESUFFIX}
|
||||
|
||||
@@ -15,7 +16,17 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
PHP_DESTDIR= lib/php/arcanist
|
||||
USES= php:flavors python:env shebangfix
|
||||
SHEBANG_FILES= support/arcanoid/arcanoid.py
|
||||
SHEBANG_FILES= bin/arc \
|
||||
bin/phage \
|
||||
scripts/*.php \
|
||||
scripts/hgdaemon/*.php \
|
||||
src/parser/*.php \
|
||||
support/arcanoid/arcanoid.py \
|
||||
support/lib/*.php \
|
||||
support/unit/*.php \
|
||||
support/xhpast/*.php \
|
||||
support/xhpast/bin/*.php
|
||||
|
||||
USE_PHP= curl dom hash json simplexml zlib
|
||||
USE_GITHUB= yes
|
||||
NO_BUILD= yes
|
||||
@@ -61,10 +72,17 @@ do-install:
|
||||
s|%%PKGVERSION%%|${PKGVERSION}|g; \
|
||||
s|%%PKGORIGIN%%|${PKGORIGIN}|g' \
|
||||
${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/src/toolset/workflow/ArcanistVersionWorkflow.php
|
||||
@${REINPLACE_CMD} \
|
||||
's|%%PHP_CMD%%|${PREFIX}/bin/php|g' \
|
||||
${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/src/lint/linter/ArcanistPhpLinter.php \
|
||||
${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/src/moduleutils/PhutilLibraryMapBuilder.php \
|
||||
${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/src/phage/bootloader/PhagePHPAgentBootloader.php \
|
||||
${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/src/runtime/ArcanistRuntime.php \
|
||||
${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/src/utils/PhutilExecutionEnvironment.php \
|
||||
${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/src/workflow/ArcanistLiberateWorkflow.php
|
||||
@${REINPLACE_CMD} \
|
||||
's|%%PYTHON_CMD%%|${PYTHON_CMD}|g' \
|
||||
${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/src/workflow/ArcanistAnoidWorkflow.php
|
||||
${RM} ${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/src/toolset/workflow/*.orig
|
||||
${RLN} ${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/support/shell/hooks/bash-completion.sh \
|
||||
${STAGEDIR}${PREFIX}/share/bash-completion/completions/arc
|
||||
.endif
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- src/lint/linter/ArcanistPhpLinter.php.orig 2020-05-19 10:39:38 UTC
|
||||
+++ src/lint/linter/ArcanistPhpLinter.php
|
||||
@@ -44,7 +44,7 @@ final class ArcanistPhpLinter extends ArcanistExternal
|
||||
}
|
||||
|
||||
public function getDefaultBinary() {
|
||||
- return 'php';
|
||||
+ return '%%PHP_CMD%%';
|
||||
}
|
||||
|
||||
public function getVersion() {
|
||||
@@ -0,0 +1,11 @@
|
||||
--- src/moduleutils/PhutilLibraryMapBuilder.php.orig 2020-05-19 10:41:00 UTC
|
||||
+++ src/moduleutils/PhutilLibraryMapBuilder.php
|
||||
@@ -268,7 +268,7 @@ final class PhutilLibraryMapBuilder extends Phobject {
|
||||
$absolute_file = $this->getPath($file);
|
||||
$bin = dirname(__FILE__).'/../../support/lib/extract-symbols.php';
|
||||
|
||||
- return new ExecFuture('php -f %R -- --ugly %R', $bin, $absolute_file);
|
||||
+ return new ExecFuture('%%PHP_CMD%% -f %R -- --ugly %R', $bin, $absolute_file);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- src/phage/bootloader/PhagePHPAgentBootloader.php.orig 2020-05-19 10:37:09 UTC
|
||||
+++ src/phage/bootloader/PhagePHPAgentBootloader.php
|
||||
@@ -27,7 +27,7 @@ final class PhagePHPAgentBootloader extends PhageAgent
|
||||
// reads and evaluates the main agent program.
|
||||
|
||||
return csprintf(
|
||||
- 'php -r %s',
|
||||
+ '%%PHP_CMD%% -r %s',
|
||||
"eval(fread(\$I=fopen('php://stdin', 'r'), {$len})); /* phage! */");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- src/runtime/ArcanistRuntime.php.orig 2020-05-19 10:39:08 UTC
|
||||
+++ src/runtime/ArcanistRuntime.php
|
||||
@@ -206,7 +206,7 @@ final class ArcanistRuntime {
|
||||
$bin = $arcanist_root.'/scripts/arcanist.php';
|
||||
|
||||
$err = phutil_passthru(
|
||||
- 'php -f %R -- %Ls',
|
||||
+ '%%PHP_CMD%% -f %R -- %Ls',
|
||||
$bin,
|
||||
array_slice($argv, 1));
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- src/utils/PhutilExecutionEnvironment.php.orig 2020-05-19 10:38:43 UTC
|
||||
+++ src/utils/PhutilExecutionEnvironment.php
|
||||
@@ -36,7 +36,7 @@ final class PhutilExecutionEnvironment extends Phobjec
|
||||
}
|
||||
|
||||
list($env) = execx(
|
||||
- 'php -d variables_order=E -r %s',
|
||||
+ '%%PHP_CMD%% -d variables_order=E -r %s',
|
||||
'echo json_encode($_ENV);');
|
||||
$env = phutil_json_decode($env);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--- src/workflow/ArcanistAnoidWorkflow.php.orig 2020-05-14 23:31:28 UTC
|
||||
+++ src/workflow/ArcanistAnoidWorkflow.php
|
||||
@@ -24,11 +24,10 @@ EOTEXT
|
||||
}
|
||||
|
||||
public function runWorkflow() {
|
||||
- if (!Filesystem::binaryExists('python3')) {
|
||||
+ if (!Filesystem::binaryExists('%%PYTHON_CMD%%')) {
|
||||
throw new PhutilArgumentUsageException(
|
||||
pht(
|
||||
- 'The "arc anoid" workflow requires "python3" to be available '.
|
||||
- 'in your $PATH.'));
|
||||
+ 'The "arc anoid" workflow requires "%%PYTHON_CMD%%" to be available.'));
|
||||
}
|
||||
|
||||
$support_dir = phutil_get_library_root('arcanist');
|
||||
@@ -0,0 +1,11 @@
|
||||
--- src/workflow/ArcanistLiberateWorkflow.php.orig 2020-05-19 10:37:58 UTC
|
||||
+++ src/workflow/ArcanistLiberateWorkflow.php
|
||||
@@ -148,7 +148,7 @@ EOTEXT
|
||||
}
|
||||
|
||||
return phutil_passthru(
|
||||
- 'php -f %R -- %Ls %R',
|
||||
+ '%%PHP_CMD%% -f %R -- %Ls %R',
|
||||
$bin,
|
||||
$argv,
|
||||
$path);
|
||||
@@ -0,0 +1,15 @@
|
||||
--- support/shell/hooks/bash-completion.sh.orig 2020-05-14 22:49:28 UTC
|
||||
+++ support/shell/hooks/bash-completion.sh
|
||||
@@ -1,9 +1,10 @@
|
||||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
|
||||
-GENERATED_RULES_FILE="${SCRIPTDIR}/../rules/bash-rules.sh"
|
||||
+GENERATED_RULES_FILE="%%PREFIX%%/%%PHP_DESTDIR%%/support/shell/rules/bash-rules.sh"
|
||||
|
||||
# Try to generate the shell completion rules if they do not yet exist.
|
||||
if [ ! -f "${GENERATED_RULES_FILE}" ]; then
|
||||
- arc shell-complete --generate >/dev/null 2>/dev/null
|
||||
+ %%PREFIX%%/%%PHP_DESTDIR%%/bin/arc \
|
||||
+ shell-complete --generate >/dev/null 2>/dev/null
|
||||
fi;
|
||||
|
||||
# Source the shell completion rules.
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
PORTNAME= phabricator
|
||||
PORTVERSION= 20200514
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= devel
|
||||
PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX}
|
||||
|
||||
@@ -11,18 +12,21 @@ COMMENT= Open source, software engineering platform
|
||||
LICENSE= APACHE20
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
IGNORE_WITH_PHP=74
|
||||
|
||||
RUN_DEPENDS= arcanist-lib${PHP_PKGNAMESUFFIX}>=20200514:devel/arcanist-lib@${PHP_FLAVOR} \
|
||||
git:devel/git
|
||||
|
||||
USES= php:flavors shebangfix
|
||||
IGNORE_WITH_PHP= 74
|
||||
|
||||
REINPLACE_ARGS= -i ""
|
||||
SHEBANG_FILES= scripts/*.php \
|
||||
SHEBANG_FILES= resources/timezones/*.php \
|
||||
scripts/*.php \
|
||||
scripts/almanac/*.php \
|
||||
scripts/cache/*.php \
|
||||
scripts/celerity/*.php \
|
||||
scripts/daemon/*.php \
|
||||
scripts/daemon/exec/exec_daemon.php \
|
||||
scripts/diviner/*.php \
|
||||
scripts/drydock/*.php \
|
||||
scripts/fact/*.php \
|
||||
@@ -40,6 +44,7 @@ SHEBANG_FILES= scripts/*.php \
|
||||
scripts/symbols/*.php \
|
||||
scripts/util/*.php \
|
||||
support/aphlict/server/*.php
|
||||
|
||||
USE_PHP= ctype curl fileinfo filter hash iconv mbstring mysqli openssl \
|
||||
pcntl posix zip
|
||||
|
||||
@@ -75,6 +80,10 @@ post-patch:
|
||||
s|PrintLastLog no||g; \
|
||||
s|PidFile /var/run/sshd-phabricator.pid||g' \
|
||||
${WRKSRC}/resources/sshd/sshd_config.phabricator.example
|
||||
@${REINPLACE_CMD} \
|
||||
's|%%PHP_CMD%%|${PREFIX}/bin/php|g' \
|
||||
${WRKSRC}/scripts/celerity/install_merge.sh \
|
||||
${WRKSRC}/src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php
|
||||
|
||||
do-install:
|
||||
@${MKDIR} ${STAGEDIR}${PREFIX}/${PHP_DESTDIR}/conf/local
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
--- scripts/celerity/install_merge.sh.orig 2020-05-19 10:53:29 UTC
|
||||
+++ scripts/celerity/install_merge.sh
|
||||
@@ -6,4 +6,4 @@ echo "resources/celerity/map.php merge=celerity" \
|
||||
git config merge.celerity.name "Celerity Mapper"
|
||||
|
||||
git config merge.celerity.driver \
|
||||
- 'php $GIT_DIR/../bin/celerity map'
|
||||
+ '%%PHP_CMD%% $GIT_DIR/../bin/celerity map'
|
||||
@@ -0,0 +1,20 @@
|
||||
--- src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php.orig 2020-05-19 10:51:50 UTC
|
||||
+++ src/infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php
|
||||
@@ -11,7 +11,7 @@ final class PhabricatorStorageFixtureScopeGuard extend
|
||||
$this->name = $name;
|
||||
|
||||
execx(
|
||||
- 'php %s upgrade --force --namespace %s',
|
||||
+ '%%PHP_CMD%% %s upgrade --force --namespace %s',
|
||||
$this->getStorageBinPath(),
|
||||
$this->name);
|
||||
|
||||
@@ -30,7 +30,7 @@ final class PhabricatorStorageFixtureScopeGuard extend
|
||||
PhabricatorLiskDAO::closeAllConnections();
|
||||
|
||||
execx(
|
||||
- 'php %s destroy --force --namespace %s',
|
||||
+ '%%PHP_CMD%% %s destroy --force --namespace %s',
|
||||
$this->getStorageBinPath(),
|
||||
$this->name);
|
||||
}
|
||||
Reference in New Issue
Block a user