diff --git a/script/patch-rpath.sh b/script/patch-rpath.sh index e8efa57a0..8fdfd1794 100755 --- a/script/patch-rpath.sh +++ b/script/patch-rpath.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/sh PLATFORM=$(uname) -if [[ "$PLATFORM" == 'Linux' ]]; then - echo "[patch-rpath] patch Linux .so files..." +if [ "$PLATFORM" = 'Linux' ]; then + echo "[patch-rpath] patching Linux .so files..." chmod -x ./bin/lib/* chmod -x ./bin/plugins/* @@ -29,8 +29,8 @@ if [[ "$PLATFORM" == 'Linux' ]]; then patchelf --set-rpath "\$ORIGIN:\$ORIGIN/lib" bin/musikcubed fi -if [[ "$PLATFORM" == 'Darwin' ]]; then - echo "[patch-rpath] patch macOS binaries..." +if [ "$PLATFORM" = 'Darwin' ]; then + echo "[patch-rpath] patching macOS binaries..." install_name_tool -add_rpath "@executable_path/" bin/musikcube install_name_tool -add_rpath "@executable_path/lib" bin/musikcube @@ -38,4 +38,4 @@ if [[ "$PLATFORM" == 'Darwin' ]]; then install_name_tool -add_rpath "@executable_path/lib" bin/musikcubed fi -exit 0 \ No newline at end of file +exit 0 diff --git a/script/post-build.sh b/script/post-build.sh index 0d7a6fa25..9dbbfb957 100755 --- a/script/post-build.sh +++ b/script/post-build.sh @@ -1,6 +1,5 @@ -#!/bin/bash +#!/bin/sh -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) CMAKE_CURRENT_SOURCE_DIR=$1 CMAKE_SYSTEM_NAME=$2 CMAKE_BUILD_TYPE=$3 @@ -9,15 +8,15 @@ DISABLE_STRIP=$5 echo "[post-build] started..." -if [[ "$BUILD_TYPE" == 'Release' ]]; then - echo "[post-build] BUILD_TYPE=${BUILD_TYPE}, stripping binaries" - $SCRIPT_DIR/strip-binaries.sh $DIR +if [ "$CMAKE_BUILD_TYPE" = 'Release' ]; then + echo "[post-build] BUILD_TYPE=${CMAKE_BUILD_TYPE}, stripping binaries" + $CMAKE_CURRENT_SOURCE_DIR/script/strip-nix.sh $DIR else - echo "[post-build] BUILD_TYPE=${BUILD_TYPE}, not stripping" + echo "[post-build] BUILD_TYPE=${CMAKE_BUILD_TYPE}, not stripping" fi echo "[post-build] patching library rpath entries..." -$SCRIPT_DIR/patch-rpath.sh $DIR +$CMAKE_CURRENT_SOURCE_DIR/script/patch-rpath.sh $CMAKE_CURRENT_SOURCE_DIR echo "[post-build] staging static assets..." mkdir -p "$CMAKE_CURRENT_SOURCE_DIR/bin/themes" diff --git a/script/strip-nix.sh b/script/strip-nix.sh index 98383386b..e4ecea69e 100755 --- a/script/strip-nix.sh +++ b/script/strip-nix.sh @@ -1,11 +1,11 @@ #!/bin/sh DIR=$1 if [ -z "$DIR" ]; then - echo "[strip] directory not specified, using current working directory" + echo "[strip-nix] directory not specified, using current working directory" DIR=`pwd` fi -echo "[strip] resolved directory: ${DIR}" +echo "[strip-nix] using directory: ${DIR}/bin/" strip "$DIR/bin/*" 2> /dev/null strip "$DIR/bin/lib/*" 2> /dev/null strip "$DIR/bin/plugin/*" 2> /dev/null -echo "[strip] finished" +echo "[strip-nix] finished"