--------- BUILDING on MAC or LINUX -------------------

To do this you will need stuff: the Steinberg VST "SDK" (software development kit) and whatever compiler support they say you'll want for your platform.  On Macintosh that will mean Xcode and Cmake.  On linux, the standard c and c++ compilers plus Cmake.  On Windows nobody knows.

For any platform you will need the Pd source from May 24 2025 or later, as well
as this pureVST source.  You will first have to compile "libpd" from the Pd
sources, then pureVST.  PureVST requires a special version of libpd
that calls an additional extra function "vst_cleanser()" to help existing Pd
externs run in pureVST's threaded environment.  The function is provided in the
pureVST source, and so the makefile for libpd has to be told to include the
extra source file.  You can use the Makefile in [...path-to...]/pd/libpd, with
this command line:

In what follows I'll assume you have a copy of Pd in a directory called PD and
these sources in another one, PUREVST, and we'll use BUILD as our build
directory.  For example:

    export PD=~/bis/var/build/pd_for_purevst
    export BUILD=~/bis/var/build/purevst
    export PUREVST=~/work/vst/purevst

First try to get the Steinberg SDK working, perhaps building one of their
example plug-ins.  Stash a copy of the vst3sdk sources in $BUILD/vst3sdk .

Second, build a special version of "libpd" from the Pd sources - there is some
funny code added to help non-thread-savvy Pd externs load into PureVST which is
often run on multiple threads from DAWs.  To do this I clone Pd into a new
directory, $PD, and then:

    (cd $PD/libpd; make MORECFLAGS=-DVST_CLEANSER \
        MORESRC=$PUREVST/source/vst_cleanser.c)

Then to build PureVST:

    cd $BUILD
    cmake -DCMAKE_BUILD_TYPE=Release -DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=FALSE \
        -DSMTG_ENABLE_VST3_HOSTING_EXAMPLES=FALSE -DHOME=$HOME $PUREVST
    cmake --build .

On linux this will put the VST in a subdirectory:
    $BUILD/VST3/Release/PureVST.vst3/
and put a symbolic link in the official linux VST3 location, ~/.vst3
(usually rendered invisible.)  On the Mac PureVST lands in:
    ~/Library/Audio/Plug-Ins/VST3/PureVST.vst3

PureVST comes with a very generic GUI that shows 10 parameters named
"parameter1", etc.  You can replace this with your own GUI by using Steinberg's
own GUI editor.  To compile the VST with the Steinberg "uidesc" editor included:

    cmake -DCMAKE_BUILD_TYPE=Debug -DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=FALSE \ 
    -DSMTG_ENABLE_VST3_HOSTING_EXAMPLES=FALSE -DHOME=$HOME $SRC

If you want to run PureVST on a different Mac from the one you compiled on you
might have to un-quarantine it, like this:

codesign --force --sign - ~/Library/Audio/Plug-Ins/VST3/pdv/PureVST.vst3
xattr -d -r com.apple.quarantine ~/Library/Audio/Plug-Ins/VST3/pdv/PureVST.vst3

--------------- release commands ---------------

Here are the rough steps I take to release PureVST, later to be automated into
a script:

(edit version number in source/pdentry.cpp: )
VERSION=0.9
cd ~/work/vst/purevst
rm -rf /tmp/PureVST-$VERSION
mkdir /tmp/PureVST-$VERSION
cp -a CMakeLists.txt README.md INSTALL.txt resource source \
    /tmp/PureVST-$VERSION/
(cd /tmp/; tar czf PureVST-$VERSION.src.tgz PureVST-$VERSION)
ls -l /tmp/PureVST-$VERSION.src.tgz
cp /tmp/PureVST-$VERSION.src.tgz ~/bis/lib/public_html/tools/purevst/
pandoc -s -o ~/bis/lib/public_html/tools/purevst/README.htm README.md 

(on Mac:
    cd to work/vst/release
    mv PureVST.vst3 PUREVST-$VERSION.vst3
    tar czf PUREVST-$VERSION.mac.tgz PUREVST-$VERSION.vst3
)

cd ~/bis/lib/public_html/tools/purevst/
scp mac:work/vst/release/PureVST-$VERSION.mac.tgz .
htmldir.perl .
mv -i filelist.html index.htm
