Improve build.sh script (#1512)

This commit is contained in:
optizone 2019-05-14 08:57:43 +03:00 committed by xarkes
parent 67dec4cc3c
commit 378e94912a
3 changed files with 16 additions and 10 deletions

View File

@ -7,7 +7,7 @@ ERR=0
#### User variables ####
BUILD="`pwd`/build"
QMAKE_CONF=""
QMAKE_CONF=$*
ROOT_DIR=`pwd`
check_r2() {
@ -64,13 +64,17 @@ find_gmake() {
}
prepare_breakpad() {
if [[ $OSTYPE == "linux-gnu" ]]; then
source $ROOT_DIR/scripts/prepare_breakpad_linux.sh
export PKG_CONFIG_PATH="$CUSTOM_BREAKPAD_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"
elif [[ $OSTYPE == "darwin" ]]; then
source $ROOT_DIR/scripts/prepare_breakpad_macos.sh
if [ -z $OSTYPE ]; then
echo "Could not identify OS, OSTYPE var is empty. You can try to disable breakpad to avoid this error."
exit 1
fi
if [ $OSTYPE = "linux-gnu" ]; then
. $ROOT_DIR/scripts/prepare_breakpad_linux.sh
export PKG_CONFIG_PATH="$CUSTOM_BREAKPAD_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"
elif [ $OSTYPE = "darwin" ]; then
. $ROOT_DIR/scripts/prepare_breakpad_macos.sh
fi
return 1
}
# Build radare2
@ -96,7 +100,9 @@ fi
$(find_lrelease) ./src/Cutter.pro
# Build
prepare_breakpad
if [ "${QMAKE_CONF/CUTTER_ENABLE_CRASH_REPORTS=true/something}" != $QMAKE_CONF ]; then
prepare_breakpad
fi
mkdir -p "$BUILD"
cd "$BUILD" || exit 1
$(find_qmake) ../src/Cutter.pro $QMAKE_CONF

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
git clone https://github.com/google/breakpad.git
cd breakpad

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")