SDRPlusPlus/make_macos_dotapp.sh

47 lines
1.8 KiB
Bash
Raw Normal View History

2021-11-15 17:53:32 +01:00
#!/bin/sh
set -e
# Options
BUILD_DIR=$1
DOTAPP=$2
# Remove existing .app
rm -rf $DOTAPP
# Create .app structure
mkdir $DOTAPP
2021-11-15 17:59:52 +01:00
mkdir $DOTAPP/Contents
mkdir $DOTAPP/Contents/MacOS
mkdir $DOTAPP/Contents/Frameworks
mkdir $DOTAPP/Contents/Resources
2021-11-15 17:53:32 +01:00
# Gather all dependencies
# Copy core and its dependencies
2021-11-15 17:59:52 +01:00
cp $BUILD_DIR/sdrpp $DOTAPP/Contents/MacOS/
cp $BUILD_DIR/core/libsdrpp_core.dylib $DOTAPP/Contents/Frameworks/
2021-11-15 17:53:32 +01:00
# Get dep paths
2021-11-15 17:59:52 +01:00
LIBGLEW_PATH=$(sh macos/get_library_path.sh libGLEW $DOTAPP/Contents/MacOS/sdrpp)
LIBFFTW3F_PATH=$(sh macos/get_library_path.sh libfftw3f $DOTAPP/Contents/MacOS/sdrpp)
LIBGLFW_PATH=$(sh macos/get_library_path.sh libglfw $DOTAPP/Contents/MacOS/sdrpp)
LIBVOLK_PATH=$(sh macos/get_library_path.sh libvolk $DOTAPP/Contents/MacOS/sdrpp)
2021-11-15 17:53:32 +01:00
# Modify path for sdrpp
2021-11-15 17:59:52 +01:00
sh macos/set_library_path.sh libglew @rpath/libglew.dylib $DOTAPP/Contents/MacOS/sdrpp
sh macos/set_library_path.sh libfftw3f @rpath/libfftw3f.dylib $DOTAPP/Contents/MacOS/sdrpp
sh macos/set_library_path.sh libglfw @rpath/libglfw.dylib $DOTAPP/Contents/MacOS/sdrpp
sh macos/set_library_path.sh libvolk @rpath/libvolk.dylib $DOTAPP/Contents/MacOS/sdrpp
2021-11-15 17:53:32 +01:00
# Modify path for libsdrpp_core
2021-11-15 17:59:52 +01:00
sh macos/set_library_path.sh libglew @rpath/libglew.dylib $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
sh macos/set_library_path.sh libfftw3f @rpath/libfftw3f.dylib $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
sh macos/set_library_path.sh libglfw @rpath/libglfw.dylib $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
sh macos/set_library_path.sh libvolk @rpath/libvolk.dylib $DOTAPP/Contents/Frameworks/libsdrpp_core.dylib
2021-11-15 17:53:32 +01:00
# Copy deps
2021-11-15 17:59:52 +01:00
cp $LIBGLEW_PATH $DOTAPP/Contents/Frameworks/libglew.dylib
cp $LIBFFTW3F_PATH $DOTAPP/Contents/Frameworks/libfftw3f.dylib
cp $LIBGLFW_PATH $DOTAPP/Contents/Frameworks/libglfw.dylib
cp $LIBVOLK_PATH $DOTAPP/Contents/Frameworks/libvolk.dylib