mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
make sure that libargon2 is always linked in before libsodium
This commit is contained in:
parent
385a46b96f
commit
9cd17fca1c
@ -23,4 +23,21 @@ class password_argon2 extends Extension
|
|||||||
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
|
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function patchBeforeMake(): bool
|
||||||
|
{
|
||||||
|
if ($this->builder->getLib('libsodium') !== null) {
|
||||||
|
$extraLibs = getenv('SPC_EXTRA_LIBS');
|
||||||
|
if ($extraLibs !== false) {
|
||||||
|
$extraLibs = str_replace(
|
||||||
|
[BUILD_LIB_PATH . '/libargon2.a', BUILD_LIB_PATH . '/libsodium.a'],
|
||||||
|
['', BUILD_LIB_PATH . '/libargon2.a' . ' ' . BUILD_LIB_PATH . '/libsodium.a'],
|
||||||
|
$extraLibs,
|
||||||
|
);
|
||||||
|
$extraLibs = trim(preg_replace('/\s+/', ' ', $extraLibs)); // normalize spacing
|
||||||
|
f_putenv('SPC_EXTRA_LIBS=' . $extraLibs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user