Skip to content

Commit 37af8eb

Browse files
committed
bundle GTK libraries
1 parent 51700b0 commit 37af8eb

File tree

4 files changed

+27
-21
lines changed

4 files changed

+27
-21
lines changed

local-run.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
#!/bin/bash -ex
22

33
cd "$(dirname "$(readlink -f "${0}")")"
4-
rm -rf ./dist ./build
4+
rm -rf ./dist
55

6-
mkdir build
6+
mkdir -p build
77
pushd build
8-
git clone -b emacs-30.1 --depth 1 https://github.com/emacs-mirror/emacs emacs-src
8+
if [ ! -d emacs-src ]; then
9+
git clone -b emacs-30.1 --depth 1 https://github.com/emacs-mirror/emacs emacs-src
10+
fi
11+
pushd emacs-src
12+
git clean -dxf
13+
popd
914
popd
1015

1116
docker build . # next step has no log, so build first
1217
IMAGE_ID=$(docker build -q .)
1318

14-
./build.sh "$IMAGE_ID" ./build/emacs-src BUILD_GUI=lucid BUILD_NATIVE_COMP=no
19+
./build.sh "$IMAGE_ID" ./build/emacs-src BUILD_GUI=gtk3 BUILD_NATIVE_COMP=no

scripts/AppRun

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ export EMACSDATA="$APPIMAGE_ROOT/share/emacs/$VERSION/etc"
1515
export EMACSDOC="$APPIMAGE_ROOT/share/emacs/$VERSION/etc"
1616
export EMACSPATH="$(echo "$APPIMAGE_ROOT"/libexec/emacs/$VERSION/*)"
1717
export PATH="$APPIMAGE_ROOT/bin:$PATH"
18+
export XDG_DATA_DIRS="$APPIMAGE_ROOT/share:${XDG_DATA_DIRS}"
19+
20+
if [ -d "$APPIMAGE_ROOT/lib/gtk-3.0" ]; then
21+
export GSETTINGS_SCHEMA_DIR=${APPIMAGE_ROOT}/share/glib-2.0/schemas/:${GSETTINGS_SCHEMA_DIR}
22+
export GDK_PIXBUF_MODULE_FILE=${APPIMAGE_ROOT}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
23+
export GTK_PATH=${APPIMAGE_ROOT}/lib/gtk-3.0
24+
export GIO_MODULE_DIR=${APPIMAGE_ROOT}/lib/gio
25+
export GTK_DATA_PREFIX=${APPIMAGE_ROOT}
26+
export GTK_THEME=Adwaita
27+
fi
1828

1929
# check --emacs-appimage-run-as argument
2030
if [ "$1" = "--emacs-appimage-run-as" ]; then

scripts/build_emacs_in_docker.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SCRIPT_DIR=$(dirname "$(readlink -f "${0}")")
44

55
cd "$WORK_DIR"
66

7+
rm -rf emacs
78
cp -r emacs-src emacs
89

910
pushd emacs
@@ -26,24 +27,25 @@ if [[ "$BUILD_GUI" = "pgtk" ]]; then
2627
elif [[ "$BUILD_GUI" = "x11" || "$BUILD_GUI" = "gtk3" ]]; then
2728
IS_GUI=yes
2829
ARGS+=" --with-x --without-pgtk --without-gconf --with-x-toolkit=gtk3"
30+
31+
# copy GTK related files
32+
cp -r /usr/lib/$(uname -m)-linux-gnu/gdk-pixbuf-2.0 "$DIST_APPDIR/lib/"
33+
cp -r /usr/lib/$(uname -m)-linux-gnu/gtk-3.0 "$DIST_APPDIR/lib/"
34+
cp -r /usr/lib/$(uname -m)-linux-gnu/gio "$DIST_APPDIR/lib/"
35+
cp -r /usr/share/glib-2.0 "$DIST_APPDIR/share/"
2936
elif [[ "$BUILD_GUI" = "lucid" ]]; then
3037
IS_GUI=yes
3138
ARGS+=" --with-x --without-pgtk --without-gconf --with-x-toolkit=lucid"
3239
else
3340
ARGS+=" --without-x --without-pgtk --without-ns"
3441
fi
3542

36-
# TODO: libtiff caused some trouble on compatibility:
37-
# it's depend by gtk (which we donot bundle) and have incompatible APIs between versions.
38-
# so disable libtiff for now
3943
# TODO: imagemagick requires dynamic coders. we don't support them correctly now (so it cannot work correctly)
4044
# so disable imagemagick for now
4145
ARGS+=" --without-tiff --without-imagemagick"
4246
if [[ "$IS_GUI" = "yes" ]]; then
43-
ARGS+=" --with-gif --with-png --with-rsvg --with-webp"
47+
ARGS+=" --with-gif --with-png --with-rsvg --with-webp --with-tiff --with-jpeg"
4448
ARGS+=" --with-harfbuzz --with-cairo --with-libotf --without-m17n-flt"
45-
# use static lib for libjpeg, to prevent incompatible libjpeg.so version because it's depend by gtk
46-
ARGS+=" --with-jpeg emacs_cv_jpeglib=/usr/lib/$(uname -m)-linux-gnu/libjpeg.a"
4749
fi
4850

4951

scripts/postprocess.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,33 +154,22 @@ def _parse_node(node, expected_level):
154154

155155
# this is prefix
156156
LIB_BLACKLIST = [
157-
# GTK related
158-
'libgtk-3.so',
159-
'libgdk-3.so',
160-
'libgdk_pixbuf-2.0.so',
161-
'libgio-2.0.so',
162-
'libgobject-2.0.so',
163-
'libglib-2.0.so',
164157
# X related
165158
'libX', # prefix
166159
'libxcb.so',
167160
'libxcb-shape.so',
168161
'libSM.so',
169162
'libICE.so',
170163
# GUI base system
171-
'libpango',
172-
'libcairo.so',
173164
'libfreetype.so',
174165
'libfontconfig.so',
175166
'libharfbuzz.so',
176167
'libGL',
177168
'libOpenGL',
178169
'libEGL',
179170
'libdbus-1.so',
180-
'librsvg', # dynamic loaded by gdk
181171
# base system
182172
'libgcc_s.so',
183-
'libgnutls.so',
184173
'libstdc++.so.6',
185174
# glibc
186175
'libpthread.so',

0 commit comments

Comments
 (0)