2021-08-02 18:43:59 +02:00
|
|
|
#!/bin/bash
|
2021-08-29 10:15:55 +02:00
|
|
|
set -e
|
2021-08-02 18:43:59 +02:00
|
|
|
|
|
|
|
if [ ! -e "src/api/api.h" ]; then
|
2021-08-29 10:15:55 +02:00
|
|
|
echo "Please run this script from the root directory of Lite XL."; exit 1
|
2021-08-02 18:43:59 +02:00
|
|
|
fi
|
|
|
|
|
2021-08-29 10:15:55 +02:00
|
|
|
source scripts/common.sh
|
|
|
|
|
|
|
|
show_help() {
|
2021-08-02 18:43:59 +02:00
|
|
|
echo
|
|
|
|
echo "Usage: $0 <OPTIONS>"
|
|
|
|
echo
|
|
|
|
echo "Available options:"
|
|
|
|
echo
|
|
|
|
echo "-b --builddir DIRNAME Sets the name of the build directory (not path)."
|
2021-08-29 10:15:55 +02:00
|
|
|
echo " Default: '$(get_default_build_dir)'."
|
|
|
|
echo " --debug Debug this script."
|
2021-08-02 18:43:59 +02:00
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
2021-08-29 10:15:55 +02:00
|
|
|
main() {
|
|
|
|
local build_dir=$(get_default_build_dir)
|
|
|
|
local arch
|
|
|
|
|
|
|
|
if [[ $MSYSTEM == "MINGW64" ]]; then arch=x64; else arch=Win32; fi
|
|
|
|
|
|
|
|
for i in "$@"; do
|
|
|
|
case $i in
|
|
|
|
-h|--help)
|
|
|
|
show_help
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
-b|--builddir)
|
|
|
|
build_dir="$2"
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--debug)
|
|
|
|
set -x
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# unknown option
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2021-08-02 18:43:59 +02:00
|
|
|
|
2021-08-29 10:15:55 +02:00
|
|
|
if [[ -n $1 ]]; then
|
|
|
|
show_help
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Copy MinGW libraries dependencies.
|
|
|
|
# MSYS2 ldd command seems to be only 64bit, so use ntldd
|
|
|
|
# see https://github.com/msys2/MINGW-packages/issues/4164
|
|
|
|
local mingwLibsDir="${build_dir}/mingwLibs$arch"
|
2021-08-02 18:43:59 +02:00
|
|
|
mkdir -p "$mingwLibsDir"
|
2021-08-29 10:15:55 +02:00
|
|
|
ntldd -R "${build_dir}/src/lite-xl.exe" | grep mingw | awk '{print $3}' | sed 's#\\#/#g' | xargs -I '{}' cp -v '{}' $mingwLibsDir
|
|
|
|
|
|
|
|
"/c/Program Files (x86)/Inno Setup 6/ISCC.exe" -dARCH=$arch "${build_dir}/scripts/innosetup.iss"
|
|
|
|
pushd "${build_dir}/scripts"; mv LiteXL*.exe "./../../"; popd
|
|
|
|
}
|
2021-08-02 18:43:59 +02:00
|
|
|
|
2021-08-29 10:15:55 +02:00
|
|
|
main "$@"
|