Skip to content

Commit 339c03a

Browse files
committed
fix linux build (dont know why linux failed)
1 parent 48551cc commit 339c03a

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/SPC/builder/linux/library/libargon2.php

+13
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,22 @@
44

55
namespace SPC\builder\linux\library;
66

7+
use SPC\exception\WrongUsageException;
8+
use SPC\store\FileSystem;
9+
710
class libargon2 extends LinuxLibraryBase
811
{
912
use \SPC\builder\unix\library\libargon2;
1013

1114
public const NAME = 'libargon2';
15+
16+
public function patchBeforeBuild(): bool
17+
{
18+
// detect libsodium (The libargon2 conflicts with the libsodium library.)
19+
if ($this->builder->getLib('libsodium') !== null) {
20+
throw new WrongUsageException('libargon2 (required by password-argon2) conflicts with the libsodium library !');
21+
}
22+
FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'LIBRARY_REL ?= lib/x86_64-linux-gnu', 'LIBRARY_REL ?= lib');
23+
return true;
24+
}
1225
}

src/globals/test-extensions.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
declare(strict_types=1);
44

55
# If you want to test new extensions here, just modify it.
6-
$extensions = 'password-argon2,apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,imap,intl,ldap,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,swoole,sysvmsg,sysvsem,sysvshm,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib';
6+
$extensions = 'password-argon2,apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,imap,intl,ldap,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sqlite3,swoole,sysvmsg,sysvsem,sysvshm,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib';
7+
8+
if (PHP_OS_FAMILY === 'Darwin') {
9+
$extensions .= ',sodium';
10+
}
711

812
echo $extensions;

0 commit comments

Comments
 (0)