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

View File

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