Remove some bulky artifacts from the source tarball

* harfbuzz includes some ttf fixtures.
* libpng has some test images
* the wezterm web page has some movie files(!)

None of these are required to be in the source tarball, so strip them
out to save ~40MB and bring the tarball down to <5MB.

Refs: https://github.com/wez/wezterm/issues/46
This commit is contained in:
Wez Furlong committed 2019-12-24 13:13:41 -08:00
1 parent 11b79827de
commit db2194d793
1 file changed
+13 -3
+13 -3
View File
@@ -14,7 +14,9 @@ fi
rm -f ${TAR_NAME}*
git archive --prefix=wezterm-${TAG_NAME}/ -o ${TAR_NAME} HEAD
NAME_PREFIX=wezterm-${TAG_NAME}
git archive --prefix=${NAME_PREFIX}/ -o ${TAR_NAME} HEAD
p=`pwd`
# `git submodule foreach` outputs lines like:
@@ -25,16 +27,24 @@ git submodule foreach | while read entering path; do
path="${path#\'}";
[ "$path" = "" ] && continue;
cd $path
git archive --prefix=wezterm-${TAG_NAME}/$path/ HEAD > tmp.tar && \
git archive --prefix=${NAME_PREFIX}/$path/ HEAD > tmp.tar && \
tar --concatenate --file=$p/${TAR_NAME} tmp.tar
rm tmp.tar
cd $p
done
echo $TAG_NAME > .tag
tar --owner root --group root --transform "s,^,wezterm-$TAG_NAME/," -c -f tmp.tar .tag
tar --owner root --group root --transform "s,^,$NAME_PREFIX/," -c -f tmp.tar .tag
tar --concatenate --file=${TAR_NAME} tmp.tar
rm tmp.tar .tag
# Remove bulky bits that are not required to build from source; this helps
# to keep the source tarball small!
tar --delete \
${NAME_PREFIX}/deps/harfbuzz/harfbuzz/test \
${NAME_PREFIX}/deps/freetype/libpng/contrib \
${NAME_PREFIX}/docs/screenshots \
-f ${TAR_NAME}
gzip ${TAR_NAME}