remove lhelper script, build configuration and dependency support (#1906)
* remove lhelper script, build configuration and dependency support * turn lhelper flag into a error
This commit is contained in:
parent
de805aaf64
commit
0966be64b0
|
@ -1,8 +0,0 @@
|
|||
CC="${CC:-gcc}"
|
||||
CXX="${CXX:-g++}"
|
||||
CFLAGS=
|
||||
CXXFLAGS=
|
||||
LDFLAGS=
|
||||
BUILD_TYPE=Release
|
||||
|
||||
packages=(pcre2 freetype2 sdl2 lua)
|
|
@ -14,20 +14,16 @@ show_help() {
|
|||
echo
|
||||
echo "Available options:"
|
||||
echo
|
||||
echo "-l --lhelper Install tools required by LHelper and doesn't"
|
||||
echo " install external libraries."
|
||||
echo " --debug Debug this script."
|
||||
echo
|
||||
}
|
||||
|
||||
main() {
|
||||
local lhelper=false
|
||||
|
||||
for i in "$@"; do
|
||||
case $i in
|
||||
-s|--lhelper)
|
||||
lhelper=true
|
||||
shift
|
||||
echo "error: support for lhelper has been deprecated" >> /dev/stderr
|
||||
exit 1
|
||||
;;
|
||||
--debug)
|
||||
set -x
|
||||
|
@ -45,28 +41,15 @@ main() {
|
|||
fi
|
||||
|
||||
if [[ "$OSTYPE" == "linux"* ]]; then
|
||||
if [[ $lhelper == true ]]; then
|
||||
sudo apt-get install -qq ninja-build
|
||||
else
|
||||
sudo apt-get install -qq libfuse2 ninja-build wayland-protocols libsdl2-dev libfreetype6
|
||||
fi
|
||||
pip3 install meson
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
if [[ $lhelper == true ]]; then
|
||||
brew install bash md5sha1sum ninja
|
||||
else
|
||||
brew install bash ninja sdl2
|
||||
fi
|
||||
pip3 install meson dmgbuild
|
||||
elif [[ "$OSTYPE" == "msys" ]]; then
|
||||
if [[ $lhelper == true ]]; then
|
||||
pacman --noconfirm -S \
|
||||
${MINGW_PACKAGE_PREFIX}-{ca-certificates,gcc,meson,ninja,ntldd,pkg-config,mesa} unzip
|
||||
else
|
||||
pacman --noconfirm -S \
|
||||
${MINGW_PACKAGE_PREFIX}-{ca-certificates,gcc,meson,ninja,ntldd,pkg-config,mesa,freetype,pcre2,SDL2} unzip
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
show_help() {
|
||||
echo
|
||||
echo "Usage: $0 <OPTIONS>"
|
||||
echo
|
||||
echo "Available options:"
|
||||
echo
|
||||
echo " --debug Debug this script."
|
||||
echo "-h --help Show this help and exit."
|
||||
echo "-p --prefix PREFIX Install directory prefix."
|
||||
echo " Default: '$HOME/.local'."
|
||||
echo
|
||||
}
|
||||
|
||||
main() {
|
||||
local lhelper_prefix="$HOME/.local"
|
||||
|
||||
for i in "$@"; do
|
||||
case $i in
|
||||
-h|--help)
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
-p|--prefix)
|
||||
lhelper_prefix="$2"
|
||||
echo "LHelper prefix set to: \"${lhelper_prefix}\""
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
--debug)
|
||||
set -x
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -n $1 ]]; then show_help; exit 1; fi
|
||||
|
||||
if [[ ! -f ${lhelper_prefix}/bin/lhelper ]]; then
|
||||
|
||||
git clone https://github.com/franko/lhelper.git
|
||||
|
||||
# FIXME: This should be set in ~/.bash_profile if not using CI
|
||||
# export PATH="${HOME}/.local/bin:${PATH}"
|
||||
mkdir -p "${lhelper_prefix}/bin"
|
||||
pushd lhelper; bash install "${lhelper_prefix}"; popd
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
CC=clang CXX=clang++ lhelper create build
|
||||
else
|
||||
lhelper create lite-xl build
|
||||
fi
|
||||
fi
|
||||
|
||||
# Not using $(lhelper activate lite-xl) to support CI
|
||||
source "$(lhelper env-source build)"
|
||||
|
||||
# Help MSYS2 to find the SDL2 include and lib directories to avoid errors
|
||||
# during build and linking when using lhelper.
|
||||
# Francesco: not sure why this is needed. I have never observed the problem when
|
||||
# building on window.
|
||||
# if [[ "$OSTYPE" == "msys" ]]; then
|
||||
# CFLAGS=-I${LHELPER_ENV_PREFIX}/include/SDL2
|
||||
# LDFLAGS=-L${LHELPER_ENV_PREFIX}/lib
|
||||
# fi
|
||||
}
|
||||
|
||||
main "$@"
|
Loading…
Reference in New Issue