Fix latest libsodium compatibility (#388)

* fix #384

* bypass password-argon2 micro sanity check

* ignore funding yaml schema [skip ci]

* test linux compatibility for libargon2 and libsodium

* update composer.json to prevent smart-aleck composer [skip ci]
This commit is contained in:
Jerry Ma 2024-03-16 22:37:39 +08:00 committed by GitHub
parent 96c3e6b935
commit 46984b6df1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 16 additions and 9 deletions

1
.github/FUNDING.yml vendored
View File

@ -10,5 +10,6 @@ liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
# noinspection YAMLSchemaValidation
buy_me_a_coffee: crazywhalecc
custom: 'https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md' # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@ -54,5 +54,11 @@
},
"optimize-autoloader": true,
"sort-packages": true
},
"funding": [
{
"type": "other",
"url": "https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md"
}
]
}

View File

@ -224,7 +224,7 @@
"libargon2": {
"type": "git",
"rev": "master",
"url": "https://github.com/mpociot/phc-winner-argon2",
"url": "https://github.com/static-php/phc-winner-argon2",
"license": {
"type": "file",
"path": "LICENSE"

View File

@ -11,6 +11,11 @@ use SPC\util\CustomExt;
#[CustomExt('password-argon2')]
class password_argon2 extends Extension
{
public function getDistName(): string
{
return '';
}
public function runCliCheckUnix(): void
{
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "assert(defined(\'PASSWORD_ARGON2I\'));"');

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace SPC\builder\linux\library;
use SPC\exception\WrongUsageException;
use SPC\store\FileSystem;
class libargon2 extends LinuxLibraryBase
@ -15,10 +14,6 @@ class libargon2 extends LinuxLibraryBase
public function patchBeforeBuild(): bool
{
// detect libsodium (The libargon2 conflicts with the libsodium library.)
if ($this->builder->getLib('libsodium') !== null) {
throw new WrongUsageException('libargon2 (required by password-argon2) conflicts with the libsodium library !');
}
FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'LIBRARY_REL ?= lib/x86_64-linux-gnu', 'LIBRARY_REL ?= lib');
return true;
}

View File

@ -13,13 +13,13 @@ declare(strict_types=1);
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'zlib,openssl,curl,pcntl,posix,mbstring,tokenizer,phar,pdo_sqlsrv',
'Linux', 'Darwin' => 'intl,pdo_sqlite,sqlite3,curl,openssl,tokenizer,bcmath,bz2,calendar,dba,ftp,iconv,mysqli,mbstring,mbregex,xml,simplexml,ctype,dom,pdo,filter,session,zlib,fileinfo,pdo_mysql,posix,sockets,shmop,sodium,sysvmsg,sysvsem,sysvshm,gd,zip,gmp,redis,xmlwriter,phar,exif,xmlreader,readline,pcntl,soap,imagick,ffi,password-argon2,pgsql,pdo_pgsql,imap,ldap,xsl',
'Windows' => 'mbstring,pdo_sqlite,mbregex,ffi',
};
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
$with_libs = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => '',
'Linux', 'Darwin' => 'nghttp2',
'Windows' => '',
};