Skip to content

Commit

Permalink
portaudio & portmidi script formatting and print updates
Browse files Browse the repository at this point in the history
  • Loading branch information
danomatika committed Sep 23, 2018
1 parent 8cb571b commit 1899839
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
20 changes: 12 additions & 8 deletions portaudio/update.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##! /bin/bash
#! /bin/bash
#
# this script automatically downloads and copies the portaudio library for Pd
#
Expand Down Expand Up @@ -29,32 +29,36 @@ VERSION=""

# copy .h & .c files from $SRC to $DEST, ignore missing file errors
function copysrc {
mkdir -p $DEST/$1
cp -v $SRC/$1/*.h $DEST/$1 2>/dev/null || :
cp -v $SRC/$1/*.c $DEST/$1 2>/dev/null || :
mkdir -p $DEST/$1
cp -v $SRC/$1/*.h $DEST/$1 2>/dev/null || :
cp -v $SRC/$1/*.c $DEST/$1 2>/dev/null || :
}

##### GO

if [ $# -gt 0 ] ; then
VERSION="$1"
VERSION="$1"
fi

# move to this scripts dir
cd $(dirname $0)

# clone source
echo "==== Downloading portaudio $VERSION"
if [ -d $SRC ] ; then
rm -rf $SRC
rm -rf $SRC
fi
git clone https://git.assembla.com/portaudio.git $SRC
if [ "$VERSION" -ne "" ] ; then
cd $SRC && git checkout $VERSION && cd -
if [[ "$VERSION" != "" ]] ; then
cd $SRC && git checkout $VERSION && cd -
fi

# set git revision
echo "==== Set git revision"
cd $SRC && ./update_gitrevision.sh && cd -

echo "==== Copying"

# remove stuff we don't need
rm $SRC/include/pa_jack.h
rm $SRC/include/pa_win_ds.h
Expand Down
20 changes: 12 additions & 8 deletions portmidi/update.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##! /bin/bash
#! /bin/bash
#
# this script automatically downloads and copies the portmidi library for Pd
#
Expand All @@ -25,39 +25,43 @@ VERSION=""

# copy .h & .c files from $SRC to $DEST, ignore missing file errors
function copysrc {
mkdir -p $DEST/$1
cp -v $SRC/$1/*.h $DEST/$1 2>/dev/null || :
cp -v $SRC/$1/*.c $DEST/$1 2>/dev/null || :
mkdir -p $DEST/$1
cp -v $SRC/$1/*.h $DEST/$1 2>/dev/null || :
cp -v $SRC/$1/*.c $DEST/$1 2>/dev/null || :
}

##### GO

# append revision number to checkout rule ala @###
if [ $# -gt 0 ] ; then
VERSION="@$1"
VERSION="@$1"
fi

# move to this scripts dir
cd $(dirname $0)

# checkout source
echo "==== Downloading portmidi $VERSION"
if [ -d $SRC ] ; then
rm -rf $SRC
rm -rf $SRC
fi
svn checkout https://svn.code.sf.net/p/portmedia/code/portmidi/trunk${VERSION} $SRC

# apply patches, note: this probably can't handle filenames with spaces
# temp disable exit on error since the exit value of patch --dry-run is used
set +e
echo "==== Applying any patches"
for p in $(find ./patches -type f -name "*.patch") ; do
cd $SRC
set +e
(patch -p0 -N --silent --dry-run --input "../${p}" > /dev/null 2>&1)
set -e
if [[ $? == 0 ]] ; then
patch -p0 < "../${p}"
fi
cd ../
done
set -e

echo "==== Copying"

# copy what we need, namely the main headers and relevant sources
copysrc pm_common
Expand Down

0 comments on commit 1899839

Please sign in to comment.