Skip to content

Commit

Permalink
images: add appimagetool and friends
Browse files Browse the repository at this point in the history
  • Loading branch information
takase1121 committed Nov 15, 2024
1 parent e651161 commit 5e03058
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ It is based on manylinux_2014 with some workarounds to ensure libdecor support.
- `gcc-c++-aarch64-linux-gnu`
- `binutils-aarch64-linux-gnu`
- `libdecor-devel` (package yanked from Raven Extras)
- `appimagetool` (in `/opt/appimagetool/bin`)
- `bsdtar` (in `/opt/appimagetool/bin`)
- `mksquashfs` (in `/opt/appimagetool/bin`)
- `unsquashfs` (in `/opt/appimagetool/bin`)
- `desktop-file-install` (in `/opt/appimagetool/bin`)
- `desktop-file-validate` (in `/opt/appimagetool/bin`)
- `update-desktop-database` (in `/opt/appimagetool/bin`)
- `appstreamcli` (in `/opt/appimagetool/bin`)
- `zsyncmake` (in `/opt/appimagetool/bin`)

# GitHub Actions

Expand Down
35 changes: 35 additions & 0 deletions docker/Dockerfile-manylinux
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,41 @@ RUN yum -y update && \
# install meson and ninja
RUN pip install --no-cache-dir --no-compile meson ninja

# install appimagetool and friends
RUN set -eux; \
arch=; \
tools="bsdtar mksquashfs unsquashfs desktop-file-install desktop-file-validate update-desktop-database appstreamcli zsyncmake"; \
case $TARGETARCH in \
'arm64') \
arch="aarch64"; \
;; \
'amd64') \
arch="x86_64"; \
;; \
'arm') \
arch="armhf"; \
;; \
'386') \
arch="i686"; \
;; \
*) \
echo >&2 "error: Unsupported architecture $TARGETARCH"; \
exit 1; \
;; \
esac; \
mkdir -p /opt/appimagetool/bin; \
wget -O /opt/appimagetool/bin/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$arch.AppImage"; \
for tool in $tools; do \
wget -O /opt/appimagetool/bin/$tool "https://github.com/probonopd/static-tools/releases/download/continuous/$tool-$arch"; \
done; \
chmod -R +x /opt/appimagetool/bin

# tell appimages to extract themselves before running
ENV APPIMAGE_EXTRACT_AND_RUN=1

# add appimagetool to PATH
ENV PATH="/opt/appimagetool/bin:$PATH"

# pretend to have libdecor installed
RUN rpm -i --force --nodeps --ignorearch "https://pkgs.sysadmins.ws/el8/extras/x86_64/libdecor-devel-0.1.0-3.el8.x86_64.rpm" && \
touch /usr/lib64/libdecor-0.so /usr/lib64/libdecor-0.so.0 && \
Expand Down
37 changes: 36 additions & 1 deletion docker/Dockerfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN apt-get update && apt-get -y upgrade && \
add-apt-repository -y ppa:git-core/ppa && \
apt-get update && apt-get -y upgrade && \
apt-get install -y sudo ccache curl wget python3.8 python3-pip build-essential \
zip unzip git cmake wayland-protocols libsdl2-dev clang && \
zip unzip git cmake wayland-protocols libsdl2-dev clang desktop-file-utils && \
rm -rf /var/lib/apt/lists/*

# install cross compiler
Expand All @@ -45,6 +45,41 @@ RUN if [ $TARGETARCH = 'amd64' ]; then \
RUN python3.8 -m pip install --no-cache-dir --no-compile --upgrade pip && \
python3.8 -m pip install --no-cache-dir --no-compile meson ninja

# install appimagetool and friends
RUN set -eux; \
arch=; \
tools="bsdtar mksquashfs unsquashfs desktop-file-install desktop-file-validate update-desktop-database appstreamcli zsyncmake"; \
case $TARGETARCH in \
'arm64') \
arch="aarch64"; \
;; \
'amd64') \
arch="x86_64"; \
;; \
'arm') \
arch="armhf"; \
;; \
'386') \
arch="i686"; \
;; \
*) \
echo >&2 "error: Unsupported architecture $TARGETARCH"; \
exit 1; \
;; \
esac; \
mkdir -p /opt/appimagetool/bin; \
wget -O /opt/appimagetool/bin/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$arch.AppImage"; \
for tool in $tools; do \
wget -O /opt/appimagetool/bin/$tool "https://github.com/probonopd/static-tools/releases/download/continuous/$tool-$arch"; \
done; \
chmod -R +x /opt/appimagetool/bin

# tell appimages to extract themselves before running
ENV APPIMAGE_EXTRACT_AND_RUN=1

# add appimagetool to PATH
ENV PATH="/opt/appimagetool/bin:$PATH"

# pretend to have libdecor
RUN wget "http://archive.ubuntu.com/ubuntu/pool/main/libd/libdecor-0/libdecor-0-dev_0.1.0-3build1_amd64.deb" && \
dpkg --force-all -i "libdecor-0-dev_0.1.0-3build1_amd64.deb" && \
Expand Down

0 comments on commit 5e03058

Please sign in to comment.