runner-images/shared/fedora/pkgs.ts

63 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2025-06-30 21:17:41 +08:00
#!/usr/bin/env bun
type SoftwareGroup = {
name: string
packages: string[]
}
async function install(groups: SoftwareGroup[]) {
const packageNames = groups.flatMap(x => x.packages)
await Bun.$`dnf install -y --setopt install_weak_deps=False ${packageNames}`
}
const EXT_SOFTWARES: SoftwareGroup[] = [
{
name: "Python", packages: [
"python",
"python-devel",
"poetry"
]
},
{
name: "NodeJS", packages: [
"nodejs", "nodejs-devel"
]
},
{
name: "Perl", packages: [
"perl", "perl-devel"
]
},
{
name: "Ruby", packages: [
"ruby", "ruby-devel"
]
},
{
name: "PHP", packages: [
"php", "php-devel", "composer"
]
},
{
name: "Java", packages: [
"java-21-openjdk", "java-21-openjdk-devel",
]
},
{
name: "QEMU", packages: [
"qemu-user-static", "qemu-user-binfmt"
]
},
{
name: "C", packages: [
"bison", "flex", "vcpkg", "@c-development"
]
}
]
const command = process.argv[2]
if (command === "install") {
await install(EXT_SOFTWARES)
}