Skip to content

Instantly share code, notes, and snippets.

@jeremywen
Last active January 30, 2018 15:08
Show Gist options
  • Save jeremywen/263d7d22790cebd08536be86b5968864 to your computer and use it in GitHub Desktop.
Save jeremywen/263d7d22790cebd08536be86b5968864 to your computer and use it in GitHub Desktop.
This script pulls down the VCV Rack community repo, finds source urls, pulls down source repos, and builds plugins.
#!/bin/bash
#################################################################################################################################
# community-builds-from-source.sh
# by Jeremy Wentworth
#
# This script pulls down the VCV Rack community repo, finds source urls, pulls down source repos, and builds plugins.
#
# This script requires:
# git - https://git-scm.com/
# VCV Rack dev env - https://github.com/VCVRack/Rack#setting-up-your-development-environment
#
# Copy this script into:
# Rack/plugins
#
# Run this in Rack/plugins:
# . community-builds-from-source.sh
#
#################################################################################################################################
# check for the community repo locally
if [ -d "community" ]; then
pushd community
# discard any changes
git reset HEAD --hard
# update the community repo if it exists
git pull
popd
else
# community repo does not exist so pull it down
git clone https://github.com/VCVRack/community
fi
# loop through the json in the community repo
for gitPlugin in $(cat community/plugins/*.json | grep \"source\" | awk -F'"' '{print $4}')
do
# get the folder name and see if we already haave it locally
pluginDirName=$(echo $gitPlugin | awk -F'/' '{print $5}')
if [ -d "$pluginDirName" ]; then
echo "$pluginDirName exists"
else
echo "$pluginDirName does not exists yet"
userNameUrlPart=$(echo $gitPlugin | awk -F'/' '{print $4}')
git clone $gitPlugin #NOTE: not all plugins are on github, sonus is on gitlab
fi
# change to the repo dir
pushd $pluginDirName
# Some devs don't have a .gitignore so you can't pull until you do something with the changed files.
git reset HEAD --hard #discards any changes - we could do `git stash` here instead
# pull down the latest code
git pull
# try to update submodules if there are any
git submodule update --init --recursive
# clean old builds (might not be needed but can prevent issues)
make clean
# finally, build the plugin
make
# go back to the last dir
popd
done
@Chaircrusher
Copy link

This little script checks out the last tag -- the thing is, that will get the tag most recently created, but who knows if it's the best tag to be building.

for x in *
do
if [[ -d $x ]]
then cd $x
echo -n "$x "
rev="$(git tag | tail -1)"
if [[ ! -z "${rev}" ]]
then
git checkout "${rev}"
fi
cd - > /dev/null 2>&1
fi
done

@Chaircrusher
Copy link

My version: https://gist.github.com/Chaircrusher/7174257d3cc9426e158ef8b29947bfb1
By the way, my notes on the current (as of Jan 9 2018) modules
Build failures with the master branch checked out: AudibleInstruments Autodafe Befaco Fundamental VCVRack-Simple RJModules trowaSoft-VCV

The following tags fix most of them. VCVRack-Simple probably builds with GCC version greater than 4.8.5

AudibleInstruments: v0.5.0
Autodafe: broke -- not compatible with Rack 0.5.1 API
Befaco: v0.5.0
Fundamental: v0.5.1
VCVRack-Simple: can't compile with gcc 4.8.5
RJModules: 0.5.0
trowasoft-VCV: v0.5.5

Copy link

ghost commented Jan 11, 2018

LOL ... "MSM v0.3.2" ..this isnt my latest version.. its 0.5.5

@Chaircrusher
Copy link

Sure@Phal-anx -- my understanding of how this all works is evolving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment