Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Alpine Linux #382

Merged
merged 8 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions R/sysreqs2.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ sysreqs2_cmds <- utils::read.table(
'Fedora Linux' linux fedora * NA 'dnf install -y' rpm
'openSUSE Linux' linux opensuse * NA 'zypper --non-interactive install' rpm
'SUSE Linux Enterprise' linux sle * NA 'zypper --non-interactive install' rpm
'Alpine Linux' linux alpine * NA 'apk add --no-cache' apk
gaborcsardi marked this conversation as resolved.
Show resolved Hide resolved
"))

find_sysreqs_platform <- function(sysreqs_platform = NULL) {
Expand Down
42 changes: 42 additions & 0 deletions R/system-packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ async_system_list_packages <- function(config = NULL) {
pkgtool <- sysreqs2_command(sysreqs_platform, "query")
if (pkgtool == "dpkg-query") {
async_system_list_packages_dpkg_query(config)
} else if (pkgtool == "apk") {
async_system_list_packages_apk(config)
} else {
async_system_list_packages_rpm(config)
}
Expand Down Expand Up @@ -124,3 +126,43 @@ parse_rpm_output <- function(lines) {
pkgs <- pkgs[order(tolower(pkgs$package)), ]
pkgs
}

# For APK, we need this query:

async_system_list_packages_apk <- function(config) {
args <- c(
"list",
"-I"
)
stdout <- tempfile()
external_process(function(...) {
processx::process$new(
"apk",
stdout = stdout,
stderr = stdout,
args = args,
...
)
})$
then(function(ret) {
parse_apk_output(strsplit(ret$stdout, "\n")[[1]])
})$
finally(function() unlink(stdout))
}

parse_apk_output <- function(lines) {

package = sub("-[0-9].*", "", lines)
version = sub(".*?-([0-9][^ ]*).*", "\\1", lines)
provides = ""

pkgs <- data_frame(
status = "ii",
package = package,
version = version,
provides = provides
)

pkgs <- pkgs[order(tolower(pkgs$package)), ]
pkgs
}
11 changes: 10 additions & 1 deletion inst/sysreqs/rules/apparmor.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@
"distribution": "sle"
}
]
},
{
"packages": ["libapparmor-dev", "libapparmor"],
"constraints": [
{
"os": "linux",
"distribution": "alpine"
}
]
}
]
}
}
41 changes: 39 additions & 2 deletions inst/sysreqs/rules/atk.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,53 @@
}
]
},
{
"packages": ["libatk-1_0-0"],
"constraints": [
{
"os": "linux",
"distribution": "opensuse",
"versions": ["15.6"]
},
{
"os": "linux",
"distribution": "sle",
"versions": ["15.6"]
}
]
},
{
"packages": ["atk-devel"],
"constraints": [
{
"os": "linux",
"distribution": "opensuse"
"distribution": "opensuse",
"versions": ["15.3", "15.4", "15.5"]
},
{
"os": "linux",
"distribution": "sle"
"distribution": "sle",
"versions": ["15.3", "15.4", "15.5"]
}
]
},
{
"packages": ["atk-dev"],
"constraints": [
{
"os": "linux",
"distribution": "alpine",
"versions": [ "3.15", "3.16" ]
}
]
},
{
"packages": ["atkmm-dev"],
"constraints": [
{
"os": "linux",
"distribution": "alpine",
"versions": [ "3.17", "3.18", "3.19", "3.20", "edge" ]
}
]
}
Expand Down
9 changes: 9 additions & 0 deletions inst/sysreqs/rules/automake.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@
"distribution": "sle"
}
]
},
{
"packages": ["automake"],
"constraints": [
{
"os": "linux",
"distribution": "alpine"
}
]
}
]
}
9 changes: 9 additions & 0 deletions inst/sysreqs/rules/berkeleydb.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@
"distribution": "sle"
}
]
},
{
"packages": ["db-dev"],
"constraints": [
{
"os": "linux",
"distribution": "alpine"
}
]
}
]
}
10 changes: 10 additions & 0 deletions inst/sysreqs/rules/blender.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@
"versions": [ "12.3", "15.0", "15.2" ]
}
]
},
{
"packages": ["blender"],
"constraints": [
{
"os": "linux",
"distribution": "alpine",
"versions": [ "3.16", "3.17", "3.18", "3.19", "3.20", "edge" ]
}
]
}
]
}
61 changes: 61 additions & 0 deletions inst/sysreqs/rules/boost.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"patterns": ["\\Boost\\b"],
"dependencies": [
{
"packages": ["libboost-all-dev"],
"constraints": [
{
"os": "linux",
"distribution": "ubuntu"
},
{
"os": "linux",
"distribution": "debian"
}
]
},
{
"packages": ["boost-devel"],
"constraints": [
{
"os": "linux",
"distribution": "fedora"
},
{
"os": "linux",
"distribution": "centos"
},
{
"os": "linux",
"distribution": "rockylinux"
},
{
"os": "linux",
"distribution": "redhat"
}
]
},
{
"packages": ["boost-gnu-hpc-devel"],
"constraints": [
{
"os": "linux",
"distribution": "opensuse"
},
{
"os": "linux",
"distribution": "sle"
}
]
},
{
"packages": ["boost-dev"],
"constraints": [
{
"os": "linux",
"distribution": "alpine"
}
]
}
]
}
9 changes: 9 additions & 0 deletions inst/sysreqs/rules/cairo.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@
}
]
},
{
"packages": ["cairo-dev"],
"constraints": [
{
"os": "linux",
"distribution": "alpine"
}
]
},
{
"packages": [
"mingw-w64-x86_64-cairo",
Expand Down
38 changes: 36 additions & 2 deletions inst/sysreqs/rules/chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,56 @@
"constraints": [
{
"os": "linux",
"distribution": "centos"
"distribution": "centos",
"versions": ["8"]
},
{
"os": "linux",
"distribution": "rockylinux"
},
{
"os": "linux",
"distribution": "redhat"
"distribution": "redhat",
"versions": ["8"]
},
{
"os": "linux",
"distribution": "fedora",
"versions": [ "36", "37" ]
}
]
},
{
"pre_install": [
{ "command": "yum install -y which" },
{ "command": "[ $(which google-chrome) ] || curl -fsSL -o /tmp/google-chrome.rpm https://dl.google.com/linux/chrome/rpm/stable/x86_64/google-chrome-stable-125.0.6422.141-1.x86_64.rpm" },
{ "command": "[ $(which google-chrome) ] || yum install -y /tmp/google-chrome.rpm" }
],
"packages": [],
"post_install": [
{ "command": "rm -f /tmp/google-chrome.rpm" }
],
"constraints": [
{
"os": "linux",
"distribution": "centos",
"versions": ["7"]
},
{
"os": "linux",
"distribution": "redhat",
"versions": ["7"]
}
]
},
{
"packages": ["chromium"],
"constraints": [
{
"os": "linux",
"distribution": "alpine"
}
]
}
]
}
9 changes: 9 additions & 0 deletions inst/sysreqs/rules/cmake.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@
"distribution": "sle"
}
]
},
{
"packages": ["cmake"],
"constraints": [
{
"os": "linux",
"distribution": "alpine"
}
]
}
]
}
Loading
Loading