Skip to content

Commit

Permalink
Merge pull request #3455 from zapashcanon/scripts
Browse files Browse the repository at this point in the history
Fix scripts using shellcheck
  • Loading branch information
tresf authored Mar 28, 2017
2 parents 9c5a334 + 5fca3d6 commit fc272d7
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 104 deletions.
3 changes: 2 additions & 1 deletion .travis/linux..install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ PACKAGES="cmake libsndfile-dev fftw3-dev libvorbis-dev libogg-dev
# Help with unmet dependencies
PACKAGES="$PACKAGES libjack0"

if [ $QT5 ]; then
if [ "$QT5" ]; then
PACKAGES="$PACKAGES qtbase5-dev qttools5-dev-tools qttools5-dev"
else
PACKAGES="$PACKAGES libqt4-dev"
fi

# shellcheck disable=SC2086
sudo apt-get install -y $PACKAGES
1 change: 1 addition & 0 deletions .travis/linux..script.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash

# shellcheck disable=SC2086
cmake -DUSE_WERROR=ON $CMAKE_FLAGS ..
5 changes: 3 additions & 2 deletions .travis/linux.win.download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
set -e

CACHE_DIR=$TRAVIS_BUILD_DIR/apt_mingw_cache/$1
mkdir -p $CACHE_DIR
mkdir -p "$CACHE_DIR"

pushd $CACHE_DIR
pushd "$CACHE_DIR"

# shellcheck disable=SC2086
apt-get --print-uris --yes install $MINGW_PACKAGES | grep ^\' | cut -d\' -f2 > downloads.list
wget -N --input-file downloads.list

Expand Down
7 changes: 5 additions & 2 deletions .travis/linux.win32.install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e

if [ $QT5 ]; then
if [ "$QT5" ]; then
MINGW_PACKAGES="mingw32-x-qt5base"
else
MINGW_PACKAGES="mingw32-x-qt"
Expand All @@ -16,10 +16,13 @@ MINGW_PACKAGES="mingw32-x-sdl mingw32-x-libvorbis mingw32-x-fluidsynth mingw32-x
export MINGW_PACKAGES

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $DIR/linux.win.download.sh win32

# shellcheck disable=SC1090
. "$DIR/linux.win.download.sh" win32

PACKAGES="nsis cloog-isl libmpc3 qt4-linguist-tools mingw32 $MINGW_PACKAGES"

# shellcheck disable=SC2086
sudo apt-get install -y $PACKAGES

# ccache 3.2 is needed because mingw32-x-gcc is version 4.9, which causes cmake
Expand Down
9 changes: 6 additions & 3 deletions .travis/linux.win64.install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ set -e

# First, install 32-bit deps
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $DIR/linux.win32.install.sh
# shellcheck disable=SC1090
. "$DIR/linux.win32.install.sh"


if [ $QT5 ]; then
if [ "$QT5" ]; then
MINGW_PACKAGES="mingw64-x-qt5base"
else
MINGW_PACKAGES="mingw64-x-qt"
Expand All @@ -21,6 +22,8 @@ MINGW_PACKAGES="mingw64-x-sdl mingw64-x-libvorbis mingw64-x-fluidsynth mingw64-x
export MINGW_PACKAGES

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $DIR/linux.win.download.sh win64
# shellcheck disable=SC1090
. "$DIR/linux.win.download.sh" win64

# shellcheck disable=SC2086
sudo apt-get install -y $MINGW_PACKAGES
5 changes: 3 additions & 2 deletions .travis/osx..install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

PACKAGES="cmake pkgconfig fftw libogg libvorbis libsndfile libsamplerate jack sdl stk portaudio node fltk"

if [ $QT5 ]; then
if [ "$QT5" ]; then
PACKAGES="$PACKAGES homebrew/versions/qt55"
else
PACKAGES="$PACKAGES cartr/qt4/qt"
fi

# shellcheck disable=SC2086
brew install $PACKAGES ccache

# 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
brew install --build-from-source "$url/raw/$branch/cmake/apple/fluid-synth.rb"

sudo npm install -g appdmg
6 changes: 4 additions & 2 deletions .travis/osx..script.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env bash

if [ $QT5 ]; then
if [ "$QT5" ]; then
# Workaround; No FindQt5.cmake module exists
export CMAKE_PREFIX_PATH="$(brew --prefix qt55)"
CMAKE_PREFIX_PATH="$(brew --prefix qt55)"
export CMAKE_PREFIX_PATH
fi

# shellcheck disable=SC2086
cmake $CMAKE_FLAGS -DUSE_WERROR=OFF ..
4 changes: 3 additions & 1 deletion cmake/build_mingw32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ if [ $QT5 ]; then
fi

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cmake $DIR/.. -DCMAKE_TOOLCHAIN_FILE=$DIR/../cmake/modules/Win32Toolchain.cmake -DCMAKE_MODULE_PATH=$DIR/../cmake/modules/ $CMAKE_OPTS

# shellcheck disable=SC2086
cmake "$DIR/.." -DCMAKE_TOOLCHAIN_FILE="$DIR/../cmake/modules/Win32Toolchain.cmake" -DCMAKE_MODULE_PATH="$DIR/../cmake/modules/" $CMAKE_OPTS
4 changes: 3 additions & 1 deletion cmake/build_mingw64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ if [ $QT5 ]; then
fi

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cmake $DIR/.. -DCMAKE_TOOLCHAIN_FILE=$DIR/../cmake/modules/Win64Toolchain.cmake -DCMAKE_MODULE_PATH=$DIR/../cmake/modules/ $CMAKE_OPTS

# shellcheck disable=SC2086
cmake "$DIR/.." -DCMAKE_TOOLCHAIN_FILE="$DIR/../cmake/modules/Win64Toolchain.cmake" -DCMAKE_MODULE_PATH="$DIR/../cmake/modules/" $CMAKE_OPTS
2 changes: 1 addition & 1 deletion cmake/msys/extract_debs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pushd $ppa_dir

for f in *.deb; do
echo "Extracting $f..."
ar xv $f
ar xv "$f"
rm debian-binary
rm control.tar.*
tar xf data.tar.*
Expand Down
23 changes: 10 additions & 13 deletions cmake/msys/fetch_ppa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PPA_ARCH=amd64
# These shouldn't change
PPA_HOST=http://ppa.launchpad.net
PPA_USER=tobydox
PPA_PROJECT=mingw-x-trusty
PPA_PROJECT=mingw-x-trusty
PPA_ROOT=$PPA_HOST/$PPA_USER/$PPA_PROJECT/ubuntu

PPA_URL=$PPA_ROOT/dists/$PPA_DISTRO/main/binary-$PPA_ARCH/Packages
Expand All @@ -20,39 +20,36 @@ temp_file=/tmp/ppa_listing_$$
temp_temp_file=/tmp/ppa_listing_temp_$$

skip_files="binutils openssl flac libgig libogg libvorbis x-bootstrap zlib"
skip_files="$skip_files x-runtime gcc qt_4 qt5 x-stk pkgconfig"
skip_files="$skip_files x-runtime gcc qt_4 qt5 x-stk pkgconfig"
skip_files="$skip_files glib2 libpng"

echo "Connecting to $PPA_HOST to get list of packages..."
wget -qO- $PPA_URL |grep "Filename:" > $temp_file

for j in $skip_files ; do
grep -v $j $temp_file > $temp_temp_file
grep -v "$j" $temp_file > $temp_temp_file
mv $temp_temp_file $temp_file
done

line_count=`wc -l $temp_file |awk '{print $1}'`
line_count=$(wc -l $temp_file |awk '{print $1}')

echo "Found $line_count packages for download..."

echo "Downloading packages. They will be saved to $ppa_dir"

mkdir $ppa_dir

for j in `cat $temp_file` ; do
if [ "$j" = "Filename:" ] ; then
continue
while read -r j
do
if [ "$j" = "Filename:" ] ; then
continue
fi
echo "Downloading $j..."
wget -O $ppa_dir$(basename $j) $PPA_ROOT/$j
done
wget -O "$ppa_dir$(basename "$j")" "$PPA_ROOT/$j"
done < $temp_file


echo "Cleaning up temporary files..."
rm -rf $temp_file

echo "Packages have been saved to $ppa_dir. Please run extract_debs.sh"




Loading

0 comments on commit fc272d7

Please sign in to comment.