Browse Source

Update AudibleInstruments. Remove build.py because it is replaced with rack-plugin-toolchain.

v1
Andrew Belt 4 years ago
parent
commit
b495eca537
3 changed files with 22 additions and 94 deletions
  1. +1
    -1
      repos/AudibleInstruments
  2. +0
    -73
      scripts/build.py
  3. +21
    -20
      scripts/update.py

+ 1
- 1
repos/AudibleInstruments

@@ -1 +1 @@
Subproject commit 44c516c29b1e88220887834e2078cb03c7fd70b9
Subproject commit d14a3e3833e0c7c4330b24eef3958c090d8815f9

+ 0
- 73
scripts/build.py View File

@@ -1,73 +0,0 @@
import os
import sys
import common


RACK_SDK = os.path.abspath("Rack-SDK")
STAGE_DIR = "stage"



def stage_package(plugin_dir):
common.system(f'mkdir -p {STAGE_DIR}')
common.system(f'mv {plugin_dir}/dist/*.zip {STAGE_DIR}/')


def delete_stage():
common.system(f'rm -rf {STAGE_DIR}')


def build_mac(plugin_dir):
print(f"Building {plugin_dir} for mac")
env = f'CC=x86_64-apple-darwin17-clang CXX=x86_64-apple-darwin17-clang++-libc++ STRIP=x86_64-apple-darwin17-strip RACK_DIR={RACK_SDK}'
make = f'{env} make -j$(nproc) -C {plugin_dir}'
common.system(f'{make} clean')
common.system(f'{make} cleandep')
common.system(f'{make} dep')
common.system(f'{make} dist')
stage_package(plugin_dir)
common.system(f'{make} clean')
print(f"Built {plugin_dir} for mac")


def build_win(plugin_dir):
print(f"Building {plugin_dir} for win")
env = f'CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ STRIP=x86_64-w64-mingw32-strip RACK_DIR={RACK_SDK}'
make = f'{env} make -j$(nproc) -C {plugin_dir}'
common.system(f'{make} clean')
common.system(f'{make} cleandep')
common.system(f'{make} dep')
common.system(f'{make} dist')
stage_package(plugin_dir)
common.system(f'{make} clean')
print(f"Built {plugin_dir} for win")


def build_lin(plugin_dir):
print(f"Building {plugin_dir} for lin")
make = f'make -j$(nproc)'
plugin_abs = os.path.abspath(plugin_dir)
# TODO Make this Docker image publicly available
# It's essentially just Ubuntu 16.04 with plugin build dependencies installed, the workdir, and a user account set up so it matches my own machine's UID to solve file permissions issues.
docker = f'docker run --rm -v {RACK_SDK}:/Rack-SDK -v {plugin_abs}:/workdir -w /workdir -u vortico -e RACK_DIR=/Rack-SDK rackplugin:1'
common.system(f'{docker} {make} clean')
common.system(f'{docker} {make} cleandep')
common.system(f'{docker} {make} dep')
common.system(f'{docker} {make} dist')
stage_package(plugin_dir)
common.system(f'{docker} {make} clean')
print(f"Built {plugin_dir} for lin")


def build(plugin_dir):
build_lin(plugin_dir)
build_mac(plugin_dir)
build_win(plugin_dir)


if __name__ == "__main__":
plugin_dir = sys.argv[1]
if not plugin_dir:
raise "No plugin_dir given"
build(plugin_dir)


+ 21
- 20
scripts/update.py View File

@@ -7,11 +7,11 @@ import zipfile
import re

import common
import build
import update_modulargrid
import update_cache


TOOLCHAIN_DIR = "../toolchain"
PACKAGES_DIR = "../packages"
SCREENSHOTS_DIR = "../screenshots"
MANIFESTS_DIR = "manifests"
@@ -24,19 +24,20 @@ common.system("git pull")
common.system("git submodule sync --quiet")
common.system("git submodule update --init --recursive")

plugin_filenames = sys.argv[1:]
plugin_paths = sys.argv[1:]

# Default to all repos, so all out-of-date repos are built
if not plugin_filenames:
plugin_filenames = glob.glob("repos/*")
if not plugin_paths:
plugin_paths = glob.glob("repos/*")

updated_slugs = set()

for plugin_filename in plugin_filenames:
(plugin_basename, plugin_ext) = os.path.splitext(os.path.basename(plugin_filename))
for plugin_path in plugin_paths:
plugin_path = os.path.abspath(plugin_path)
(plugin_basename, plugin_ext) = os.path.splitext(os.path.basename(plugin_path))
# Extract manifest from plugin dir or package
if os.path.isdir(plugin_filename):
manifest_filename = os.path.join(plugin_filename, "plugin.json")
if os.path.isdir(plugin_path):
manifest_filename = os.path.join(plugin_path, "plugin.json")
try:
# Read manifest
with open(manifest_filename, "r") as f:
@@ -52,7 +53,7 @@ for plugin_filename in plugin_filenames:
version = m[2]
arch = m[3]
# Open ZIP
z = zipfile.ZipFile(plugin_filename)
z = zipfile.ZipFile(plugin_path)
# Unzip manifest
manifest_filename = f"{slug}/plugin.json"
with z.open(manifest_filename) as f:
@@ -62,12 +63,12 @@ for plugin_filename in plugin_filenames:
if manifest['version'] != version:
raise Exception(f"Manifest slug does not match filename slug {slug}")
else:
raise Exception(f"Plugin {plugin_filename} is not a valid format")
raise Exception(f"Plugin {plugin_path} is not a valid format")

# Get library manifest
library_manifest_filename = os.path.join(MANIFESTS_DIR, f"{slug}.json")

if os.path.isdir(plugin_filename):
if os.path.isdir(plugin_path):
# Check if the library manifest is up to date
try:
with open(library_manifest_filename, "r") as f:
@@ -81,17 +82,17 @@ for plugin_filename in plugin_filenames:
print()
print(f"Building {slug}")
try:
build.delete_stage()
build.build(plugin_filename)
common.system(f'cp -vi stage/* "{PACKAGES_DIR}"')
common.system(f'cp -vi stage/*-lin.zip "{RACK_USER_PLUGIN_DIR}"')
common.system(f'cd "{TOOLCHAIN_DIR}" && make plugin-build-clean')
common.system(f'cd "{TOOLCHAIN_DIR}" && make -j$(nproc) plugin-build PLUGIN_DIR={plugin_path}')
common.system(f'cp -vi "{TOOLCHAIN_DIR}"/plugin-build/* "{PACKAGES_DIR}"/')
common.system(f'cp -vi "{TOOLCHAIN_DIR}"/plugin-build/*-lin.zip "{RACK_USER_PLUGIN_DIR}"')
except Exception as e:
print(e)
print(f"{slug} build failed")
input()
continue
finally:
build.delete_stage()
common.system(f'cd "{TOOLCHAIN_DIR}" && make plugin-build-clean')

# Open plugin issue thread
os.system(f"xdg-open 'https://github.com/VCVRack/library/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+in%3Atitle+{slug}' &")
@@ -103,11 +104,11 @@ for plugin_filename in plugin_filenames:
input()

# Copy package
package_dest = os.path.join(PACKAGES_DIR, os.path.basename(plugin_filename))
common.system(f'cp "{plugin_filename}" "{package_dest}"')
package_dest = os.path.join(PACKAGES_DIR, os.path.basename(plugin_path))
common.system(f'cp "{plugin_path}" "{package_dest}"')
common.system(f'touch "{package_dest}"')
if arch == 'lin':
common.system(f'cp "{plugin_filename}" "{RACK_USER_PLUGIN_DIR}"')
common.system(f'cp "{plugin_path}" "{RACK_USER_PLUGIN_DIR}"')

# Copy manifest
with open(library_manifest_filename, "w") as f:
@@ -135,7 +136,7 @@ print()
print(f"Press enter to launch Rack and test the following packages: {built_slugs_str}")
input()
common.system(f"cd {RACK_SYSTEM_DIR} && ./Rack")
# common.system(f"cd {RACK_USER_DIR} && grep 'warn' log.txt")
common.system(f"cd {RACK_USER_DIR} && grep 'warn' log.txt || true")
print(f"Press enter to generate screenshots, upload packages, upload screenshots, and commit/push the library repo.")
input()



Loading…
Cancel
Save