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