From 254844b5ec8b2722a69d559e09f7845a7e9f025b Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sat, 13 Apr 2024 16:12:05 +0800 Subject: [PATCH] add Archlinux doctor support --- src/SPC/builder/linux/SystemUtil.php | 2 ++ src/SPC/doctor/item/LinuxToolCheckList.php | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/SPC/builder/linux/SystemUtil.php b/src/SPC/builder/linux/SystemUtil.php index 0cca1524..7cd3f098 100644 --- a/src/SPC/builder/linux/SystemUtil.php +++ b/src/SPC/builder/linux/SystemUtil.php @@ -220,6 +220,8 @@ class SystemUtil 'redhat', // alpine 'alpine', + // arch + 'arch', 'manjaro', ]; } } diff --git a/src/SPC/doctor/item/LinuxToolCheckList.php b/src/SPC/doctor/item/LinuxToolCheckList.php index a8665e69..88b310a7 100644 --- a/src/SPC/doctor/item/LinuxToolCheckList.php +++ b/src/SPC/doctor/item/LinuxToolCheckList.php @@ -40,8 +40,13 @@ class LinuxToolCheckList 'xz', ]; + public const TOOLS_ARCH = [ + 'base-devel', 'cmake', + ]; + private const PROVIDED_COMMAND = [ 'binutils-gold' => 'ld.gold', + 'base-devel' => 'automake', ]; /** @noinspection PhpUnused */ @@ -53,6 +58,7 @@ class LinuxToolCheckList $required = match ($distro['dist']) { 'alpine' => self::TOOLS_ALPINE, 'redhat' => self::TOOLS_RHEL, + 'arch' => self::TOOLS_ARCH, default => self::TOOLS_DEBIAN, }; $missing = []; @@ -67,6 +73,7 @@ class LinuxToolCheckList 'alpine', 'redhat', 'Deepin', + 'arch', 'debian' => CheckResult::fail(implode(', ', $missing) . ' not installed on your system', 'install-linux-tools', [$distro, $missing]), default => CheckResult::fail(implode(', ', $missing) . ' not installed on your system'), }; @@ -114,6 +121,7 @@ class LinuxToolCheckList 'ubuntu', 'debian', 'Deepin' => 'apt-get install -y', 'alpine' => 'apk add', 'redhat' => 'dnf install -y', + 'arch' => 'pacman -S --noconfirm', default => throw new RuntimeException('Current linux distro does not have an auto-install script for musl packages yet.'), }; $prefix = '';