1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/bin/sh
if [ -z $APPDIR ]; then APPDIR=$(readlink -f $(dirname "$0")); fi
export APPDIR
# env vars for GTK
if [ -z $GTK_IM_MODULE_FILE ]; then
libdir=$(pkg-config --variable=libdir gtk+-2.0)
gtk_binary_version=$(pkg-config --variable=gtk_binary_version gtk+-2.0)
export GTK_IM_MODULE_FILE=$libdir/gtk-2.0/$gtk_binary_version/immodules.cache
fi
# NOTE GI_TYPELIB_PATH must be a absolute path
export GI_TYPELIB_PATH="$APPDIR"/usr/lib/girepository-1.0
export LD_LIBRARY_PATH="$APPDIR"/usr/lib
export LD_PRELOAD="$APPDIR"/usr/optional/exec.so
export GDK_PIXBUF_MODULEDIR="$APPDIR"/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders
export GDK_PIXBUF_MODULE_FILE=/tmp/loaders.cache
"$APPDIR"/usr/lib/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders > $GDK_PIXBUF_MODULE_FILE
export GTK_PATH="$APPDIR"/usr/lib/gtk-2.0/2.10.0
# enable debug output of exec.so
# export APPIMAGE_CHECKRT_DEBUG=1
# env vars for Ruby Gems
export DISABLE_BUNDLER_SETUP=1
# set GEM_PATH not to load host's gems
export GEM_PATH="$APPDIR"/usr/lib/ruby/gems/2.6.0
# workaround for following error
# "SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed"
# copied from https://github.com/Pext/Pext/blob/f8e422b2d10f2cdee609fae8d7866fc34ceb7226/travis/build-appimage.sh#L38
for path in \
/etc/ssl/ca-bundle.pem \
/etc/ssl/certs/ca-certificates.crt \
/etc/ssl/cert.pem \
/etc/pki/tls/certs/ca-bundle.crt \
/etc/pki/tls/cert.pem /etc/pki/tls/cacert.pem \
/usr/local/share/certs/ca-root-nss.crt; do
if [ -f "$path" ]; then
export SSL_CERT_FILE="$path"
break
fi
done
# install additional dependencies of mikutter plugins
# mkdir -p ~/.mikutter/plugin || true
# for d in ~/.mikutter/plugin/*; do
# if [ ! -f "$d/Gemfile" ]; then
# continue
# fi
# bin/ruby bin/bundle install "--gemfile=$d/Gemfile" --path=vendor/bundler
# export GEM_PATH="$GEM_PATH:$d/vendor/bundler/ruby/2.3.0"
# done
exec "$APPDIR"/usr/bin/ruby -x "$APPDIR"/usr/share/mikutter/mikutter.rb "$@"
|