Skip to content

Instantly share code, notes, and snippets.

@Akkiesoft
Last active June 30, 2019 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akkiesoft/53d78789f5d4b389cf808485bcb96cb1 to your computer and use it in GitHub Desktop.
Save Akkiesoft/53d78789f5d4b389cf808485bcb96cb1 to your computer and use it in GitHub Desktop.
mikutterのappimageを実行した環境のアーキテクチャでやっていきする改変と、gir1.2-glib-2.0はいるんじゃないですかねえしらんけど
diff --git a/deployment/appimage/Dockerfile b/deployment/appimage/Dockerfile
index 839ec539..c72827fc 100644
--- a/deployment/appimage/Dockerfile
+++ b/deployment/appimage/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM debian:buster
ARG ruby_version=2.6.3
ARG APPDIR=/AppDir
@@ -9,12 +9,13 @@ RUN apt update && apt install -y \
build-essential \
libssl-dev \
libreadline6-dev \
- libgdbm3 \
+ libgdbm6 \
libgdbm-dev \
zlib1g-dev \
libglib2.0-dev \
libatk1.0-dev \
libcairo2-dev \
+ gir1.2-glib-2.0 \
libgirepository1.0-dev \
libgdk-pixbuf2.0-dev \
libpango1.0-dev \
@@ -40,6 +41,7 @@ RUN wget -q https://cache.ruby-lang.org/pub/ruby/2.6/ruby-$ruby_version.tar.gz &
cp -v BSDL COPYING* GPL LEGAL README* $APPDIR/usr/lib/ruby
COPY AppRun mikutter.desktop gen_appimage.sh /
+COPY bin/ /bin/
ENV VOLUME /volume
diff --git a/deployment/appimage/gen_appimage.sh b/deployment/appimage/gen_appimage.sh
index a6deffc9..74080bee 100755
--- a/deployment/appimage/gen_appimage.sh
+++ b/deployment/appimage/gen_appimage.sh
@@ -15,9 +15,18 @@ git --git-dir=$REPO/.git/ archive --format=tar --prefix=mikutter/ HEAD | tar xf
BUILD_DIR="$PWD"/mikutter
APPDIR="$PWD"/AppDir
+
+echo "--> check the archtecture"
set +u
[[ -z "$ARCH" ]] && export ARCH="$(arch)"
+if [ "$ARCH" == "armv7l" ] ; then
+ # Perhaps this is Raspberry Pi.
+ ARCH="armhf"
+fi
+[[ -z "$ARCH_ENV" ]] && export ARCH_ENV="$(gcc -v 2>&1 | grep Target | awk '{print $2}')"
set -u
+echo $ARCH $ARCH_ENV
+
APP=mikutter
VERSION=$(git -C "$REPO" describe --tags --abbrev=0)
@@ -44,10 +53,14 @@ echo "--> get exec.so"
# outside of the AppImage
# see https://github.com/darealshinji/AppImageKit-checkrt/pull/11
mkdir -p $APPDIR/usr/optional || true
-wget -q -O $APPDIR/usr/optional/exec.so https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/exec-x86_64.so
+if [ -e bin/$ARCH/exec.so ] ; then
+ mv bin/$ARCH/exec.so $APPDIR/usr/optional/exec.so
+else
+ wget -q -O $APPDIR/usr/optional/exec.so https://github.com/darealshinji/AppImageKit-checkrt/releases/download/continuous/exec-$ARCH.so
+fi
echo "--> copy Typelibs for gobject-introspection gem"
-cp -av /usr/lib/girepository-* $APPDIR/usr/lib
+cp -av /usr/lib/$ARCH_ENV/girepository-* $APPDIR/usr/lib
# echo "--> patch away absolute paths"
# for gobject-introspection gem
@@ -72,12 +85,16 @@ cp "$BUILD_DIR"/core/skin/data/icon.png mikutter.png
chmod +x AppRun
echo "--> get linuxdeploy"
-wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
-chmod +x linuxdeploy-x86_64.AppImage
+if [ -e bin/$ARCH/linuxdeploy.AppImage ] ; then
+ mv bin/$ARCH/linuxdeploy.AppImage .
+else
+ wget -q -O linuxdeploy.AppImage https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$ARCH.AppImage
+fi
+chmod +x linuxdeploy.AppImage
export OUTPUT=$APP-$VERSION-$ARCH.AppImage
-./linuxdeploy-x86_64.AppImage --appimage-extract
+./linuxdeploy.AppImage --appimage-extract
./squashfs-root/AppRun \
--appdir $APPDIR \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment