Skip to content

Commit ff15973

Browse files
committed
suggestions
1 parent b88a68d commit ff15973

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

src/SPC/builder/unix/library/postgresql.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function patchBeforeBuild(): bool
4545

4646
protected function build(): void
4747
{
48-
$libs = array_map(fn ($x) => $x->getName(), $this->getDependencies());
48+
$libs = array_map(fn ($x) => $x->getName(), $this->getDependencies(true));
4949
$spc = new SPCConfigUtil($this->builder, ['no_php' => true, 'libs_only_deps' => true]);
5050
$config = $spc->config(libraries: $libs, include_suggest_lib: $this->builder->getOption('with-suggested-libs'));
5151

src/SPC/util/DependencyUtil.php

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public static function getLibs(array $libs, bool $include_suggested_libs = false
105105
* @param array $additional_libs Array of additional libraries
106106
* @return array Ordered array of extension names
107107
*/
108-
public static function getExtsAndLibs(array $exts, array $additional_libs = [], bool $include_suggested_exts = false, bool $include_suggested_libs = false, array $extra_libraries_from_builder = []): array
108+
public static function getExtsAndLibs(array $exts, array $additional_libs = [], bool $include_suggested_exts = false, bool $include_suggested_libs = false): array
109109
{
110110
$dep_list = self::platExtToLibs();
111111

@@ -144,23 +144,6 @@ public static function getExtsAndLibs(array $exts, array $additional_libs = [],
144144
$dep_list[$name]['suggests'] = array_values($dep_list[$name]['suggests']);
145145
}
146146
}
147-
// include suggested libraries
148-
if ($extra_libraries_from_builder) {
149-
// check every deps suggests
150-
foreach ($dep_list as $name => $obj) {
151-
$del_list = [];
152-
foreach ($obj['suggests'] as $id => $suggest) {
153-
if (!str_starts_with($suggest, 'ext@') && in_array($suggest, $extra_libraries_from_builder)) {
154-
$dep_list[$name]['depends'][] = $suggest;
155-
$del_list[] = $id;
156-
}
157-
}
158-
foreach ($del_list as $id) {
159-
unset($dep_list[$name]['suggests'][$id]);
160-
}
161-
$dep_list[$name]['suggests'] = array_values($dep_list[$name]['suggests']);
162-
}
163-
}
164147

165148
// convert ext_name to ext@ext_name
166149
$origin_exts = $exts;

src/SPC/util/SPCConfigUtil.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ public function config(array $extensions = [], array $libraries = [], bool $incl
6262
$extensions[] = $ext;
6363
}
6464
}
65-
$extra_builder_libs = $this->builder?->getLibs() ?? [];
66-
[$extensions, $libraries] = DependencyUtil::getExtsAndLibs($extensions, $libraries, $include_suggest_ext, $include_suggest_lib, array_map(fn ($l) => $l->getName(), $extra_builder_libs));
65+
[$extensions, $libraries] = DependencyUtil::getExtsAndLibs($extensions, $libraries, $include_suggest_ext, $include_suggest_lib);
6766

6867
ob_start();
6968
if ($this->builder === null) {

0 commit comments

Comments
 (0)