Adapt all scripts to work together with build-packages.sh

This commit is contained in:
redtide
2021-09-05 15:23:08 +02:00
committed by Francesco
parent 9e5d404b29
commit 38d85f2483
17 changed files with 829 additions and 601 deletions
+46 -36
View File
@@ -1,55 +1,65 @@
#!/bin/bash
set -ex
set -e
if [ ! -e "src/api/api.h" ]; then
echo "Please run this script from the root directory of Lite XL."
exit 1
echo "Please run this script from the root directory of Lite XL."; exit 1
fi
show_help(){
source scripts/common.sh
show_help() {
echo
echo "Usage: $0 <OPTIONS>"
echo
echo "Available options:"
echo
echo "-b --builddir DIRNAME Sets the name of the build directory (not path)."
echo " Default: 'build'."
echo " Default: '$(get_default_build_dir)'."
echo " --debug Debug this script."
echo
}
BUILD_DIR=build
main() {
local build_dir=$(get_default_build_dir)
local arch
for i in "$@"; do
case $i in
-h|--belp)
show_help
exit 0
;;
-b|--BUILD_DIR)
BUILD_DIR="$2"
shift
shift
;;
*)
# unknown option
;;
esac
done
if [[ $MSYSTEM == "MINGW64" ]]; then arch=x64; else arch=Win32; fi
if [[ -n $1 ]]; then
show_help
exit 1
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
# TODO: Required MinGW dlls are built only (?) when using lhelper on 64 bit
if [[ $MSYSTEM == "MINGW64" ]]; then
ARCH=x64;
mingwLibsDir=$BUILD_DIR/mingwLibs$ARCH
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"
mkdir -p "$mingwLibsDir"
ldd "$BUILD_DIR/src/lite-xl.exe" | grep mingw | awk '{print $3}' | xargs -I '{}' cp -v '{}' $mingwLibsDir
else
ARCH=Win32
fi
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
mv $BUILD_DIR/LiteXL*.exe $(pwd)
"/c/Program Files (x86)/Inno Setup 6/ISCC.exe" -dARCH=$arch "${build_dir}/scripts/innosetup.iss"
pushd "${build_dir}/scripts"; mv LiteXL*.exe "./../../"; popd
}
main "$@"