diff --git a/config/lib.json b/config/lib.json index bc011b78..53c26d2c 100644 --- a/config/lib.json +++ b/config/lib.json @@ -11,6 +11,11 @@ "lib-depends": [ "lib-base", "micro" + ], + "lib-depends-linux": [ + "lib-base", + "libacl", + "micro" ] }, "micro": { diff --git a/src/SPC/command/BuildCliCommand.php b/src/SPC/command/BuildCliCommand.php index abeeeb0b..cee98b73 100644 --- a/src/SPC/command/BuildCliCommand.php +++ b/src/SPC/command/BuildCliCommand.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace SPC\command; use SPC\builder\BuilderProvider; -use SPC\builder\linux\LinuxBuilder; use SPC\exception\ExceptionHandler; use SPC\exception\WrongUsageException; use SPC\store\Config; @@ -109,8 +108,8 @@ class BuildCliCommand extends BuildCommand $include_suggest_ext = $this->getOption('with-suggested-exts'); $include_suggest_lib = $this->getOption('with-suggested-libs'); [$extensions, $libraries, $not_included] = DependencyUtil::getExtsAndLibs($extensions, $libraries, $include_suggest_ext, $include_suggest_lib); - if ($builder instanceof LinuxBuilder && !in_array('libacl', $libraries) && ($rule & BUILD_TARGET_FPM)) { - array_unshift($libraries, 'attr', 'libacl'); + if (PHP_OS_FAMILY !== 'Linux' || !($rule & BUILD_TARGET_FPM)) { + $libraries = array_filter($libraries, fn ($lib) => !in_array($lib, ['attr', 'libacl'])); } $display_libs = array_filter($libraries, fn ($lib) => in_array(Config::getLib($lib, 'type', 'lib'), ['lib', 'package'])); diff --git a/src/SPC/command/DownloadCommand.php b/src/SPC/command/DownloadCommand.php index 43dd143c..7bf82ebb 100644 --- a/src/SPC/command/DownloadCommand.php +++ b/src/SPC/command/DownloadCommand.php @@ -81,9 +81,6 @@ class DownloadCommand extends BaseCommand $final_sources = array_merge($final_sources, array_diff($sources, $final_sources)); } if (!empty($final_sources)) { - if (PHP_OS_FAMILY === 'Linux') { - array_unshift($final_sources, 'attr', 'libacl'); - } $input->setArgument('sources', implode(',', $final_sources)); } parent::initialize($input, $output);