Skip to content

Commit af75ffa

Browse files
committed
suggestions, change openssldir
1 parent d902e70 commit af75ffa

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

config/env.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fno-ident -fPIE
115115
; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so
116116
SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS=""
117117

118+
; optional, path to openssl conf. This affects where openssl will look for the default CA.
119+
; default on Debian/Alpine: /etc/ssl, default on RHEL: /etc/pki/tls
120+
OPENSSLDIR=""
121+
118122
[macos]
119123
; build target: macho or macho (possibly we could support macho-universal in the future)
120124
; Currently we do not support universal and cross-compilation for macOS.

config/ext.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,9 @@
499499
"mysqlnd"
500500
],
501501
"lib-depends": [
502-
"libsodium",
502+
"libsodium"
503+
],
504+
"lib-suggests": [
503505
"openssl"
504506
]
505507
},
@@ -514,7 +516,9 @@
514516
"mysqlnd"
515517
],
516518
"lib-depends": [
517-
"libsodium",
519+
"libsodium"
520+
],
521+
"lib-suggests": [
518522
"openssl"
519523
]
520524
},

src/SPC/builder/Extension.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,6 @@ public function buildShared(array $visited = []): void
398398
$dependency->buildShared([...$visited, $this->getName()]);
399399
}
400400
}
401-
if (Config::getExt($this->getName(), 'type') === 'addon') {
402-
return;
403-
}
404401
$this->builder->emitPatchPoint('before-shared-ext[' . $this->getName() . ']-build');
405402
match (PHP_OS_FAMILY) {
406403
'Darwin', 'Linux' => $this->buildUnixShared(),

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
namespace SPC\builder\linux\library;
2323

24+
use SPC\builder\linux\SystemUtil;
2425
use SPC\store\FileSystem;
2526

2627
class openssl extends LinuxLibraryBase
@@ -51,8 +52,9 @@ public function build(): void
5152
$zlib_extra = '';
5253
}
5354

54-
$openssl_conf = getenv('OPENSSL_CONF');
55-
$openssl_dir = $openssl_conf ? dirname($openssl_conf) : '/etc/ssl';
55+
$openssl_dir = getenv('OPENSSLDIR') ?: null;
56+
// TODO: in v3 use the following: $openssl_dir ??= SystemUtil::getOSRelease()['dist'] === 'redhat' ? '/etc/pki/tls' : '/etc/ssl';
57+
$openssl_dir ??= '/etc/ssl';
5658
$ex_lib = trim($ex_lib);
5759

5860
shell()->cd($this->source_dir)->initializeEnv($this)

0 commit comments

Comments
 (0)