Skip to content

Commit

Permalink
Merge pull request #1 from antony-jr/reduce_size
Browse files Browse the repository at this point in the history
Purge unwanted files and binaries.
  • Loading branch information
antony-jr authored May 14, 2018
2 parents 68647cf + adc55ba commit ca8ea99
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 16 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ script:
- ./linuxdeployqt-continuous-x86_64.AppImage AppDir/Insight.desktop -bundle-non-qt-libs
- bash scripts/copy_libs.sh
- bash scripts/apply_patches.sh
- bash scripts/purge_unwanted.sh
- wget -O AppDir/AppRun https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-x86_64
- chmod +x AppDir/AppRun
- wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
Expand Down
16 changes: 0 additions & 16 deletions scripts/copy_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,7 @@

# Required libraries.
cp /usr/share/tcltk/* -p -r AppDir/usr/lib/
cp /usr/bin/tclsh8.5 -p -r AppDir/usr/bin/
cp /usr/include/tcl8.5 -p -r AppDir/usr/include/
cp /usr/lib/tcl8.5 -p -r AppDir/usr/lib/
cp /usr/lib/tk8.5 -p -r AppDir/usr/lib/
cp /usr/lib/tcltk -p -r AppDir/usr/lib/
mkdir AppDir/usr/lib/x86_64-linux-gnu
cp /usr/lib/x86_64-linux-gnu/libtcl8.5.a -p AppDir/usr/lib/x86_64-linux-gnu/
cp /usr/lib/x86_64-linux-gnu/libtclstub8.5.a -p AppDir/usr/lib/x86_64-linux-gnu/
cp /usr/lib/x86_64-linux-gnu/tcl8.5 -p -r AppDir/usr/lib/x86_64-linux-gnu/
cp /usr/lib/x86_64-linux-gnu/tk8.5 -p -r AppDir/usr/lib/x86_64-linux-gnu/
cp /usr/lib/x86_64-linux-gnu/libtk8.5.a -p AppDir/usr/lib/x86_64-linux-gnu/
cp /usr/lib/x86_64-linux-gnu/libtkstub8.5.a -p AppDir/usr/lib/x86_64-linux-gnu/
cp /usr/lib/x86_64-linux-gnu/libtk8.5.so -p AppDir/usr/lib/x86_64-linux-gnu/
cp /usr/lib/x86_64-linux-gnu/libtk8.5.so.0 -p AppDir/usr/lib/x86_64-linux-gnu/
cp /usr/share/lintian -p -r AppDir/usr/share/
mkdir AppDir/usr/share/aclocal
cp /usr/share/aclocal/tcl8.5.m4 -p AppDir/usr/share/aclocal/
cp /usr/lib/libitcl3.4.so.1 -p AppDir/usr/lib/
cp /usr/lib/libitcl3.4.so -p AppDir/usr/lib/
cp /usr/lib/libitclstub3.4.a -p AppDir/usr/lib/
Expand Down
44 changes: 44 additions & 0 deletions scripts/purge_unwanted.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# The MIT License.
# Copyright (C) 2018 Antony Jr.
# -------------------------------
# Purges unwanted files from
# the AppDir to reduce size.
# -------------------------------

# We already compiled so no dev-packages.
rm -rf AppDir/usr/include

# Remove unwanted binaries.
rm -rf AppDir/usr/bin/addr2line \
AppDir/usr/bin/c++filt \
AppDir/usr/bin/gdb \
AppDir/usr/bin/gprof \
AppDir/usr/bin/ld \
AppDir/usr/bin/objcopy \
AppDir/usr/bin/readelf \
AppDir/usr/bin/strip \
AppDir/usr/bin/ar \
AppDir/usr/bin/elfedit \
AppDir/usr/bin/gdb-add-index \
AppDir/usr/bin/ld.bfd \
AppDir/usr/bin/objdump \
AppDir/usr/bin/size \
AppDir/usr/bin/as \
AppDir/usr/bin/gcore \
AppDir/usr/bin/gdbserver \
AppDir/usr/bin/nm \
AppDir/usr/bin/ranlib \
AppDir/usr/bin/strings

# Remove ubuntu specific files
# Just in case
rm -rf AppDir/usr/x86_64-pc-linux-gnu \
AppDir/usr/lib/x86_64-linux-gnu

# Remove unwanted doc files and locales
rm -rf AppDir/usr/share/doc \
AppDir/usr/share/man \
AppDir/usr/share/info \
AppDir/usr/share/locale

0 comments on commit ca8ea99

Please sign in to comment.