-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathlibopenmpt
More file actions
27 lines (23 loc) · 973 Bytes
/
libopenmpt
File metadata and controls
27 lines (23 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Skip if disabled
if [ "$DISABLE_AUTOBREW" ]; then return 0; fi
bottle="https://github.com/autobrew/bundler/releases/download/libopenmpt-0.7.11/libopenmpt-0.7.11-universal.tar.xz"
echo "Using autobrew bundle: $(basename $bottle)"
# General setup
BREWDIR="$PWD/.deps"
mkdir -p $BREWDIR
curl -sSL $bottle -o libs.tar.xz
tar -xf libs.tar.xz --strip 1 -C $BREWDIR
rm -f libs.tar.xz
# Hardcoded flags
PKG_CFLAGS="-I${BREWDIR}/include"
PKG_LIBS="-L${BREWDIR}/lib -lopenmpt -lvorbisfile -lvorbis -logg -lopus -lmpg123 -lportaudiocpp -lportaudio -lz -framework Foundation -framework AppKit -framework CoreAudio -framework AudioToolbox"
# Prevent linking against other libs in /usr/local/lib
for FILE in $BREWDIR/lib/*.a; do
BASENAME=$(basename $FILE)
LIBNAME=$(echo "${BASENAME%.*}" | cut -c4-)
cp -f $FILE $BREWDIR/lib/libbrew$LIBNAME.a
PKG_LIBS=$(echo $PKG_LIBS | sed "s/-l$LIBNAME /-lbrew$LIBNAME /g")
done
# Cleanup
echo "rm -Rf .deps" >> cleanup
chmod +x cleanup