2015-03-17 15:28:06 -04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# This is the official script used to make wxWidgets releases.
|
|
|
|
#
|
|
|
|
# We use the git export features to track which files should be included in the
|
|
|
|
# distribution and we don't need to maintain the list of them ourselves but we
|
|
|
|
# also don't run the risk of including anything unwanted.
|
|
|
|
#
|
2015-10-31 16:45:00 -04:00
|
|
|
# See docs/contributing/how-to-release.md for usage instructions.
|
2015-03-17 15:28:06 -04:00
|
|
|
|
|
|
|
version=$1
|
|
|
|
if [ -z "$version" ]; then
|
|
|
|
echo "Must specify the distribution version." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-10-31 16:45:00 -04:00
|
|
|
root="$(readlink -f $(dirname $(readlink -f $0))/../..)"
|
|
|
|
cd "$root"
|
|
|
|
|
2015-03-17 15:28:06 -04:00
|
|
|
if ! git diff --quiet; then
|
|
|
|
echo "Working copy has modifications, commit or stash them." >&2
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
prefix=wxWidgets-$version
|
2015-10-31 16:45:00 -04:00
|
|
|
destdir="$root/distrib/release/$version"
|
2015-03-17 15:28:06 -04:00
|
|
|
|
|
|
|
cleanup() {
|
2015-10-31 16:45:00 -04:00
|
|
|
rm -rf $destdir/$prefix
|
2015-03-17 15:28:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
trap cleanup INT TERM EXIT
|
|
|
|
|
|
|
|
cleanup
|
|
|
|
|
2015-10-31 16:45:00 -04:00
|
|
|
mkdir -p $destdir
|
2017-11-16 16:16:12 -05:00
|
|
|
|
|
|
|
# We use GNU tar -i option to allow successfully extracting files from several
|
|
|
|
# tar archives concatenated together, without it we'd have to pipe output of
|
|
|
|
# each git-archive separately.
|
|
|
|
(git archive --prefix=$prefix/ HEAD;
|
|
|
|
git submodule foreach --quiet "cd $root/\$path && git archive --prefix=$prefix/\$path/ HEAD") |
|
|
|
|
tar x -C $destdir -i
|
|
|
|
|
2015-10-31 16:45:00 -04:00
|
|
|
cd $destdir
|
2015-03-17 15:28:06 -04:00
|
|
|
# All setup0.h files are supposed to be renamed to just setup.h when checked
|
|
|
|
# out and in the distribution.
|
|
|
|
find $prefix/include/wx -type f -name setup0.h | while read f; do
|
|
|
|
mv $f ${f%0.h}.h
|
|
|
|
done
|
|
|
|
|
|
|
|
# Compile gettext catalogs.
|
2017-11-16 16:26:39 -05:00
|
|
|
make -C $prefix/locale -s MSGFMT=msgfmt allmo
|
2015-03-17 15:28:06 -04:00
|
|
|
|
|
|
|
tar cjf $prefix.tar.bz2 $prefix
|
|
|
|
|
|
|
|
cd $prefix
|
|
|
|
|
|
|
|
zip -q -r ../$prefix.zip .
|
|
|
|
|
|
|
|
7z a ../$prefix.7z . >/dev/null
|
2015-10-30 02:34:44 -04:00
|
|
|
7z a ../${prefix}-headers.7z include >/dev/null
|
2015-10-31 16:45:00 -04:00
|
|
|
|
|
|
|
# Build HTML documentation packages.
|
|
|
|
prefix_docs=$prefix-docs-html
|
|
|
|
cd "$root/docs/doxygen"
|
|
|
|
rm -rf out
|
|
|
|
./regen.sh html
|
|
|
|
cd out
|
|
|
|
mv html "$prefix_docs"
|
|
|
|
tar cjf "$destdir/$prefix_docs.tar.bz2" "$prefix_docs"
|
|
|
|
cd "$prefix_docs"
|
|
|
|
zip -q -r "$destdir/$prefix_docs.zip" .
|
|
|
|
cd "$root"
|
|
|
|
rm -rf "$root/docs/doxygen/out"
|