Convert a couple shell scripts from bash -> sh to improve portability.

This commit is contained in:
casey langen 2023-01-20 19:08:20 -08:00
parent d7f6dbe46f
commit 1f60f7c1d8
3 changed files with 15 additions and 16 deletions

View File

@ -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

View File

@ -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"

View File

@ -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"