Skip to content

Commit

Permalink
fix: ubuntu does not provide mips packages
Browse files Browse the repository at this point in the history
Ubuntu does not support mips, so we cannot add libraries with pre-build
configuration in Cross.toml.

This changes the mipsel-unknown-linux-musl image to build from Debian
stable.

You can now use something like:

```
pre-build = ["dpkg --add-architecture mipsel && apt-get update && apt-get install -y zlib1g-dev:mipsel && ln -s /usr/include/zlib.h /usr/local/mipsel-linux-muslsf/include"]
```
  • Loading branch information
sarfata committed Sep 13, 2023
1 parent 539a2b0 commit 0a17355
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile.mipsel-unknown-linux-musl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM debian:bookworm
ARG DEBIAN_FRONTEND=noninteractive

COPY common.sh lib.sh /
Expand Down
6 changes: 3 additions & 3 deletions docker/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set_centos_ulimit() {
}

install_packages() {
if grep -i ubuntu /etc/os-release; then
if grep -i debian /etc/os-release || grep -i ubuntu /etc/os-release; then
apt-get update

for pkg in "${@}"; do
Expand All @@ -34,7 +34,7 @@ install_packages() {

purge_packages() {
if (( ${#purge_list[@]} )); then
if grep -i ubuntu /etc/os-release; then
if grep -i ubuntu /etc/os-release || grep -i debian /etc/os-release ; then
apt-get purge --assume-yes --auto-remove "${purge_list[@]}"
else
yum remove -y "${purge_list[@]}"
Expand All @@ -49,7 +49,7 @@ if_centos() {
}

if_ubuntu() {
if grep -q -i ubuntu /etc/os-release; then
if grep -q -i debian /etc/os-release || grep -q -i ubuntu /etc/os-release; then
eval "${@}"
fi
}
Expand Down

0 comments on commit 0a17355

Please sign in to comment.