Skip to content

Commit bac2874

Browse files
authored
Manually debloat .pyc files
1 parent c1b41a3 commit bac2874

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

make-appimage.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}
1111
export ICON=/usr/share/icons/hicolor/scalable/apps/org.gnome.World.Secrets.svg
1212
export DESKTOP=/usr/share/applications/org.gnome.World.Secrets.desktop
1313
export DEPLOY_SYS_PYTHON=1
14+
export DEBLOAT_SYS_PYTHON=0 # we will manually debloat, as the pyc directory name is not the same as mainbin (gsecrets vs secrets)
1415
export DEPLOY_P11KIT=1
1516
export DEPLOY_GTK=1
1617
export GTK_DIR=gtk-4.0
@@ -28,6 +29,19 @@ quick-sharun /usr/bin/secrets \
2829
/usr/lib/libcups* \
2930
/sbin/ldconfig
3031

32+
# Manually debloat .pyc files
33+
python_dir=$(echo ./AppDir/shared/lib/python*)
34+
(
35+
cd "$python_dir"
36+
for f in $(find ./ -type f -name '*.pyc' -print); do
37+
case "$f" in
38+
gsecrets) :;;
39+
secrets) :;;
40+
*) [ ! -f "$f" ] || rm -f "$f";;
41+
esac
42+
done
43+
)
44+
3145
# Patch secrets to use AppImage's directory
3246
sed -i '/from gsecrets import const/a \
3347
SHARUN_DIR = os.getenv('"'"'SHARUN_DIR'"'"')\n\

0 commit comments

Comments
 (0)