summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-04-15 18:06:26 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2022-04-15 18:06:26 +0200
commit53a8de1e50765b3ff2a05478d3318dd5c60e4889 (patch)
treeb89ba147f52c76eb5afeb53430faf0e6bb0e30b1 /tools
parent37a1793a9961d182e6a901fe9cbfc7753e341d98 (diff)
Add macOS build files.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/macos/build-dg.sh258
-rw-r--r--tools/macos/drumgizmo.vst.tar.gzbin0 -> 626 bytes
-rw-r--r--tools/macos/zita-resampler-static-build.patch28
3 files changed, 286 insertions, 0 deletions
diff --git a/tools/macos/build-dg.sh b/tools/macos/build-dg.sh
new file mode 100755
index 0000000..bd799b8
--- /dev/null
+++ b/tools/macos/build-dg.sh
@@ -0,0 +1,258 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------------------------------------------------
+# stop on error
+
+set -e
+
+# ---------------------------------------------------------------------------------------------------------------------
+# stop on error
+
+TARGETDIR=$PWD/builds/drumgizmo
+
+DOWNLOADS=$PWD/downloads
+
+PKG_CONFIG_VERSION=0.28
+LIBOGG_VERSION=1.3.3
+LIBVORBIS_VERSION=1.3.6
+FLAC_VERSION=1.3.2
+LIBSNDFILE_VERSION=1.0.28
+ZITA_RESAMPLER_VERSION=1.6.2
+
+DRUMGIZMO_VERSION=0.9.20
+
+# ---------------------------------------------------------------------------------------------------------------------
+# function to remove old stuff
+
+cleanup()
+{
+
+rm -rf $TARGETDIR
+rm -rf flac-*
+rm -rf libogg-*
+rm -rf libsndfile-*
+rm -rf libvorbis-*
+rm -rf pkg-config-*
+exit 0
+
+}
+
+# ---------------------------------------------------------------------------------------------------------------------
+# setup build vars
+
+export CC=clang
+export CXX=clang++
+
+export PREFIX=${TARGETDIR}
+export PATH=${PREFIX}/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
+export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
+
+export CFLAGS="-O3 -mtune=generic -msse -msse2 -fvisibility=hidden"
+export CFLAGS="${CFLAGS} -fPIC -DPIC -DNDEBUG -I${PREFIX}/include"
+export CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden -stdlib=libc++"
+
+export LDFLAGS="-Wl,-dead_strip -Wl,-dead_strip_dylibs"
+export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
+
+# ---------------------------------------------------------------------------------------------------------------------
+echo ==== Package pkgconfig ====
+
+if [ ! -f ${DOWNLOADS}/pkg-config-${PKG_CONFIG_VERSION}.tar.gz ]; then
+ pushd ${DOWNLOADS}
+ curl -O https://pkg-config.freedesktop.org/releases/pkg-config-${PKG_CONFIG_VERSION}.tar.gz
+ popd
+fi
+
+if [ ! -d pkg-config-${PKG_CONFIG_VERSION} ]; then
+ tar -xf ${DOWNLOADS}/pkg-config-${PKG_CONFIG_VERSION}.tar.gz
+fi
+
+if [ ! -f pkg-config-${PKG_CONFIG_VERSION}/build-done ]; then
+ cd pkg-config-${PKG_CONFIG_VERSION}
+ ./configure --enable-indirect-deps --with-internal-glib --with-pc-path=$PKG_CONFIG_PATH --prefix=${PREFIX}
+ make ${MAKE_ARGS}
+ make install
+ touch build-done
+ cd ..
+fi
+
+# ---------------------------------------------------------------------------------------------------------------------
+echo ==== Package libogg ====
+
+if [ ! -f ${DOWNLOADS}/libogg-${LIBOGG_VERSION}.tar.gz ]; then
+ pushd ${DOWNLOADS}
+ curl -O http://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-${LIBOGG_VERSION}.tar.gz
+ popd
+fi
+
+if [ ! -d libogg-${LIBOGG_VERSION} ]; then
+ tar -xf ${DOWNLOADS}/libogg-${LIBOGG_VERSION}.tar.gz
+fi
+
+if [ ! -f libogg-${LIBOGG_VERSION}/build-done ]; then
+ cd libogg-${LIBOGG_VERSION}
+ ./configure --enable-static --disable-shared --prefix=${PREFIX}
+ make ${MAKE_ARGS}
+ make install
+ touch build-done
+ cd ..
+fi
+
+# ---------------------------------------------------------------------------------------------------------------------
+echo ==== Package libvorbis ====
+
+if [ ! -f ${DOWNLOADS}/libvorbis-${LIBVORBIS_VERSION}.tar.gz ]; then
+ pushd ${DOWNLOADS}
+ curl -O http://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-${LIBVORBIS_VERSION}.tar.gz
+ popd
+fi
+
+if [ ! -d libvorbis-${LIBVORBIS_VERSION} ]; then
+ tar -xf ${DOWNLOADS}/libvorbis-${LIBVORBIS_VERSION}.tar.gz
+fi
+
+if [ ! -f libvorbis-${LIBVORBIS_VERSION}/build-done ]; then
+ cd libvorbis-${LIBVORBIS_VERSION}
+ ./configure --enable-static --disable-shared --prefix=${PREFIX}
+ make ${MAKE_ARGS}
+ make install
+ touch build-done
+ cd ..
+fi
+
+# ---------------------------------------------------------------------------------------------------------------------
+echo ==== Package flac ====
+
+if [ ! -f ${DOWNLOADS}/flac-${FLAC_VERSION}.tar.xz ]; then
+ pushd ${DOWNLOADS}
+ curl -O http://ftp.osuosl.org/pub/xiph/releases/flac/flac-${FLAC_VERSION}.tar.xz
+ popd
+fi
+if [ ! -d flac-${FLAC_VERSION} ]; then
+ tar -xf ${DOWNLOADS}/flac-${FLAC_VERSION}.tar.xz
+fi
+
+if [ ! -f flac-${FLAC_VERSION}/build-done ]; then
+ cd flac-${FLAC_VERSION}
+ sed -i -e "s/HAVE_CPUID_H/HAVE_CPUID_H_NOT/" src/libFLAC/cpu.c
+ chmod +x configure install-sh
+ ./configure --enable-static --disable-shared --prefix=${PREFIX} \
+ --disable-cpplibs
+ echo "exit 0" > missing
+ make ${MAKE_ARGS}
+ make install
+ touch build-done
+ cd ..
+fi
+
+# ---------------------------------------------------------------------------------------------------------------------
+echo ==== Package libsndfile ====
+
+if [ ! -f ${DOWNLOADS}/libsndfile-${LIBSNDFILE_VERSION}.tar.gz ]; then
+ pushd ${DOWNLOADS}
+ curl -O http://www.mega-nerd.com/libsndfile/files/libsndfile-${LIBSNDFILE_VERSION}.tar.gz
+ popd
+fi
+
+if [ ! -d libsndfile-${LIBSNDFILE_VERSION} ]; then
+ tar -xf ${DOWNLOADS}/libsndfile-${LIBSNDFILE_VERSION}.tar.gz
+fi
+
+if [ ! -f libsndfile-${LIBSNDFILE_VERSION}/build-done ]; then
+ cd libsndfile-${LIBSNDFILE_VERSION}
+ ./configure --enable-static --disable-shared --prefix=${PREFIX} \
+ --disable-full-suite --disable-sqlite
+ make ${MAKE_ARGS}
+ make install
+ sed -i -e "s|-lsndfile|-lsndfile -lFLAC -lvorbisenc -lvorbis -logg -lm|" ${PREFIX}/lib/pkgconfig/sndfile.pc
+ touch build-done
+ cd ..
+fi
+
+# ---------------------------------------------------------------------------------------------------------------------
+echo ==== Package zita-resampler ====
+
+if [ ! -f ${DOWNLOADS}/zita-resampler-${ZITA_RESAMPLER_VERSION}.tar.bz2 ]; then
+ pushd ${DOWNLOADS}
+ curl -O http://kokkinizita.linuxaudio.org/linuxaudio/downloads/zita-resampler-${ZITA_RESAMPLER_VERSION}.tar.bz2
+ popd
+fi
+
+if [ ! -d zita-resampler-${ZITA_RESAMPLER_VERSION} ]; then
+ tar -xf ${DOWNLOADS}/zita-resampler-${ZITA_RESAMPLER_VERSION}.tar.bz2
+fi
+
+if [ ! -f zita-resampler-${ZITA_RESAMPLER_VERSION}/build-done ]; then
+ cd zita-resampler-${ZITA_RESAMPLER_VERSION}
+ if [ ! -f patched ]; then
+ patch -p1 -i ../zita-resampler-static-build.patch
+ touch patched
+ fi
+ make ${MAKE_ARGS} -C source
+ mkdir ${PREFIX}/include/zita-resampler
+ cp source/*.a ${PREFIX}/lib/
+ cp source/zita-resampler/*.h ${PREFIX}/include/zita-resampler/
+ touch build-done
+ cd ..
+fi
+
+# ---------------------------------------------------------------------------------------------------------------------
+echo ==== Package drumgizmo ====
+
+if [ ! -f ${DOWNLOADS}/drumgizmo-${DRUMGIZMO_VERSION}.tar.gz ]; then
+ pushd ${DOWNLOADS}
+ curl -O https://www.drumgizmo.org/releases/drumgizmo-${DRUMGIZMO_VERSION}/drumgizmo-${DRUMGIZMO_VERSION}.tar.gz
+ popd
+fi
+
+if [ ! -d drumgizmo-${DRUMGIZMO_VERSION} ]; then
+ tar -xf ${DOWNLOADS}/drumgizmo-${DRUMGIZMO_VERSION}.tar.gz
+fi
+
+if [ ! -f drumgizmo-${DRUMGIZMO_VERSION}/build-done ]; then
+ PATH=/usr/local/opt/gettext/bin:$PATH
+ cd drumgizmo-${DRUMGIZMO_VERSION}
+ ./configure --prefix=${PREFIX} \
+ --disable-input-midifile \
+ --disable-input-jackmidi \
+ --disable-output-jackaudio \
+ --disable-input-alsamidi \
+ --disable-output-alsa \
+ --enable-cli \
+ --without-debug \
+ --with-test \
+ --disable-lv2 \
+ --enable-vst \
+ --with-vst-sources=$HOME/VST3_SDK
+ make ${MAKE_ARGS}
+ make install
+ touch build-done
+ cd ..
+fi
+
+# ---------------------------------------------------------------------------------------------------------------------
+
+echo Make macOS package:
+
+otool -L ${PREFIX}/lib/vst/drumgizmo_vst.so
+
+if [ ! -f drumgizmo.vst.tar.gz ]; then
+ exit "Missing VST package template: drumgizmo.vst.tar.gz "
+fi
+
+if [ ! -d ${DRUMGIZMO_VERSION}/drumgizmo.vst ]; then
+ mkdir -p ${DRUMGIZMO_VERSION}
+ pushd ${DRUMGIZMO_VERSION}
+ tar -xvzf ../drumgizmo.vst.tar.gz
+ popd
+fi
+
+cp -a ${PREFIX}/lib/vst/drumgizmo_vst.so ${DRUMGIZMO_VERSION}/drumgizmo.vst/Contents/MacOS/drumgizmo
+sed -e "s/@VERSION@/${DRUMGIZMO_VERSION}/g" -i .bak ${DRUMGIZMO_VERSION}/drumgizmo.vst/Contents/Info.plist
+rm -f ${DRUMGIZMO_VERSION}/drumgizmo.vst/Contents/Info.plist.bak
+
+pushd ${DRUMGIZMO_VERSION}
+tar cvzf ../drumgizmo_vst-osx-${DRUMGIZMO_VERSION}.tar.gz drumgizmo.vst/
+popd
+
+echo Package is now ready in drumgizmo_vst-osx-${DRUMGIZMO_VERSION}.tar.gz
diff --git a/tools/macos/drumgizmo.vst.tar.gz b/tools/macos/drumgizmo.vst.tar.gz
new file mode 100644
index 0000000..0db45db
--- /dev/null
+++ b/tools/macos/drumgizmo.vst.tar.gz
Binary files differ
diff --git a/tools/macos/zita-resampler-static-build.patch b/tools/macos/zita-resampler-static-build.patch
new file mode 100644
index 0000000..5b894e1
--- /dev/null
+++ b/tools/macos/zita-resampler-static-build.patch
@@ -0,0 +1,28 @@
+--- zita-resampler-static-1.6.2.orig/source/Makefile
++++ zita-resampler-static-1.6.2/source/Makefile
+@@ -32,12 +32,12 @@ DISTDIR = zita-resampler-$(VERSION)
+
+
+ CPPFLAGS += -I. -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
+-CXXFLAGS += -Wall -fPIC -O2 -ffast-math
+-CXXFLAGS += -march=native
++CXXFLAGS += -Wall -fPIC -O3 -ffast-math
+ LDFLAGS +=
+ LDLIBS +=
+
+
++ZITA-RESAMPLER_A = libzita-resampler.a
+ ZITA-RESAMPLER_SO = libzita-resampler.so
+ ZITA-RESAMPLER_MAJ = $(ZITA-RESAMPLER_SO).$(MAJVERS)
+ ZITA-RESAMPLER_MIN = $(ZITA-RESAMPLER_MAJ).$(MINVERS)
+@@ -47,6 +47,10 @@ ZITA-RESAMPLER_H = zita-resampler/resamp
+ zita-resampler/vresampler.h zita-resampler/cresampler.h
+
+
++$(ZITA-RESAMPLER_A): $(ZITA-RESAMPLER_O)
++ rm -f $@
++ ar cr $@ $^
++
+ $(ZITA-RESAMPLER_MIN): $(ZITA-RESAMPLER_O)
+ $(CXX) -shared $(LDFLAGS) -Wl,-soname,$(ZITA-RESAMPLER_MAJ) -o $(ZITA-RESAMPLER_MIN) $(ZITA-RESAMPLER_O) $(ZITA-RESAMPLER_DEP)
+