-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request LMMS#3476 from zapashcanon/shellcheck
Add shellcheck to the build
- Loading branch information
Showing
18 changed files
with
127 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [ "$TYPE" != 'style' ]; then | ||
ccache -s | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [ "$TYPE" = 'style' ]; then | ||
sudo apt-get -yqq update | ||
sudo apt-get install shellcheck | ||
else | ||
"$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.before_install.sh" | ||
"$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.install.sh" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# shellcheck disable=SC2086 | ||
cmake -DUSE_WERROR=ON $CMAKE_FLAGS .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
CACHE_DIR=$TRAVIS_BUILD_DIR/apt_mingw_cache/$1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
sudo add-apt-repository ppa:tobydox/mingw-x-trusty -y | ||
sudo apt-get update -qq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON" | ||
../cmake/build_mingw32.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
. .travis/linux.win32.before_install.sh | ||
set -e | ||
|
||
"$TRAVIS_BUILD_DIR/.travis/linux.win32.before_install.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON" | ||
../cmake/build_mingw64.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
brew update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
PACKAGES="cmake pkgconfig fftw libogg libvorbis libsndfile libsamplerate jack sdl stk portaudio node fltk" | ||
set -e | ||
|
||
PACKAGES="cmake pkg-config fftw libogg libvorbis libsndfile libsamplerate jack sdl stk portaudio node fltk" | ||
|
||
if [ "$QT5" ]; then | ||
PACKAGES="$PACKAGES homebrew/versions/qt55" | ||
PACKAGES="$PACKAGES [email protected]" | ||
else | ||
PACKAGES="$PACKAGES cartr/qt4/qt" | ||
PACKAGES="$PACKAGES cartr/qt4/qt@4" | ||
fi | ||
|
||
if "${TRAVIS}"; then | ||
PACKAGES="$PACKAGES ccache" | ||
fi | ||
|
||
# removing already installed packages from the list | ||
for p in $(brew list); do | ||
PACKAGES=${PACKAGES//$p/} | ||
done; | ||
|
||
# shellcheck disable=SC2086 | ||
brew install $PACKAGES ccache | ||
brew install $PACKAGES | ||
|
||
# Recompile fluid-synth without CoreAudio per issues #649 | ||
# Changes to fluid-synth.rb must be pushed to URL prior to use | ||
url=$(git remote get-url origin) | ||
branch=$(git symbolic-ref --short HEAD) | ||
brew install --build-from-source "$url/raw/$branch/cmake/apple/fluid-synth.rb" | ||
if [ "$TRAVIS_EVENT_TYPE" == "pull_request" ]; then | ||
slug=$TRAVIS_PULL_REQUEST_SLUG | ||
branch=$TRAVIS_PULL_REQUEST_BRANCH | ||
elif "${TRAVIS}"; then | ||
slug=$TRAVIS_REPO_SLUG | ||
branch=$TRAVIS_BRANCH | ||
else | ||
slug="LMMS/lmms" | ||
branch=$(git symbolic-ref --short HEAD) | ||
fi | ||
|
||
brew install --build-from-source "https://raw.githubusercontent.com/${slug}/${branch}/cmake/apple/fluid-synth.rb" | ||
|
||
sudo npm install -g appdmg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [ "$TYPE" = 'style' ]; then | ||
|
||
# shellcheck disable=SC2046 | ||
shellcheck $(find -O3 "$TRAVIS_BUILD_DIR/.travis/" "$TRAVIS_BUILD_DIR/cmake/" -type f -name '*.sh' -o -name "*.sh.in") | ||
|
||
else | ||
|
||
mkdir build | ||
cd build | ||
|
||
export CMAKE_FLAGS="-DWANT_QT5=$QT5 -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo" | ||
|
||
if [ -z "$TRAVIS_TAG" ]; then | ||
export CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_CCACHE=ON" | ||
fi | ||
|
||
"$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.script.sh" | ||
|
||
make -j4 | ||
|
||
if [[ $TARGET_OS != win* ]]; then | ||
|
||
make tests | ||
tests/tests | ||
|
||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,16 @@ | |
# Examine linkings using `otool -L somelib.so` | ||
# Debug the loading of dynamic libraries using `export DYLD_PRINT_LIBRARIES=1` | ||
|
||
set -e | ||
|
||
# STK rawwaves directory | ||
STK_RAWWAVE=$HOME/stk-*/rawwaves | ||
STK_RAWWAVE_LIST=( $HOME/stk-*/rawwaves ) | ||
STK_RAWWAVE=${STK_RAWWAVE_LIST[0]} | ||
|
||
if [ ! -d "$STK_RAWWAVE" ]; then | ||
STK_RAWWAVE=$(brew --prefix stk)/share/stk/rawwaves | ||
fi | ||
|
||
# Place to create ".app" bundle | ||
APP="@CMAKE_BINARY_DIR@/@[email protected]" | ||
|
||
|
@@ -24,29 +27,30 @@ if [ $? -ne 0 ]; then | |
brew --prefix qt55 > /dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
# Prefer Qt 5.5 (QTBUG-53533) | ||
export PATH=$PATH:$(brew --prefix qt55)/bin | ||
PATH=$PATH:$(brew --prefix qt55)/bin | ||
else | ||
# Fallback Qt 5.6+ | ||
export PATH=$PATH:$(brew --prefix qt5)/bin | ||
PATH=$PATH:$(brew --prefix qt5)/bin | ||
fi | ||
export PATH | ||
fi | ||
|
||
# Remove any old .app bundles | ||
rm -Rf "$APP" | ||
|
||
# Copy/overwrite Info.plist | ||
\cp "@CMAKE_BINARY_DIR@/Info.plist" "@CMAKE_INSTALL_PREFIX@/" | ||
command cp "@CMAKE_BINARY_DIR@/Info.plist" "@CMAKE_INSTALL_PREFIX@/" | ||
|
||
# Create .app bundle containing contents from CMAKE_INSTALL_PREFIX | ||
mkdir -p "$APP/Contents/MacOS" | ||
mkdir -p "$APP/Contents/Frameworks" | ||
mkdir -p "$APP/Contents/Resources" | ||
mkdir -p "$APP/Contents/share/stk/rawwaves" | ||
cd "@CMAKE_INSTALL_PREFIX@" | ||
cp -R * "$APP/Contents" | ||
cp -R ./* "$APP/Contents" | ||
cp "@CMAKE_SOURCE_DIR@/cmake/apple/"*.icns "$APP/Contents/Resources/" | ||
cp $STK_RAWWAVE/*.raw "$APP/Contents/share/stk/rawwaves" > /dev/null 2>&1 | ||
cp "$STK_RAWWAVE"/*.raw "$APP/Contents/share/stk/rawwaves" > /dev/null 2>&1 | ||
|
||
# Make all libraries writable for macdeployqt | ||
cd "$APP" | ||
find . -type f -print0 | xargs -0 chmod u+w | ||
|
@@ -55,11 +59,11 @@ lmmsbin="MacOS/@CMAKE_PROJECT_NAME@" | |
zynlib="lib/lmms/libzynaddsubfx.so" | ||
zynfmk="Frameworks/libZynAddSubFxCore.dylib" | ||
zynbin="MacOS/RemoteZynAddSubFx" | ||
|
||
# Move lmms binary | ||
mv "$APP/Contents/bin/@CMAKE_PROJECT_NAME@" "$APP/Contents/$lmmsbin" | ||
# Fix zyn linking | ||
|
||
# Fix zyn linking | ||
mv "$APP/Contents/lib/lmms/RemoteZynAddSubFx" "$APP/Contents/$zynbin" | ||
mv "$APP/Contents/lib/lmms/libZynAddSubFxCore.dylib" "$APP/Contents/$zynfmk" | ||
|
||
|
@@ -70,24 +74,25 @@ install_name_tool -change @rpath/libZynAddSubFxCore.dylib \ | |
install_name_tool -change @rpath/libZynAddSubFxCore.dylib \ | ||
@loader_path/../../$zynfmk \ | ||
"$APP/Contents/$zynlib" | ||
|
||
# Link lmms binary | ||
_executables="${_executables} -executable=$APP/Contents/$zynbin" | ||
_executables="${_executables} -executable=$APP/Contents/$zynfmk" | ||
|
||
# Build a list of shared objects in target/lib/lmms | ||
for file in "$APP/Contents/lib/lmms/"*.so; do | ||
_thisfile="$APP/Contents/lib/lmms/${file##*/}" | ||
_executables="${_executables} -executable=$_thisfile" | ||
done | ||
|
||
# Build a list of shared objects in target/lib/lmms/ladspa | ||
for file in "$APP/Contents/lib/lmms/ladspa/"*.so; do | ||
_thisfile="$APP/Contents/lib/lmms/ladspa/${file##*/}" | ||
_executables="${_executables} -executable=$_thisfile" | ||
done | ||
|
||
# Finalize .app | ||
# shellcheck disable=SC2086 | ||
macdeployqt "$APP" $_executables | ||
|
||
# Cleanup | ||
|