Skip to content

Instantly share code, notes, and snippets.

@Celeborn2BeAlive
Created May 20, 2020 17:39
Show Gist options
  • Save Celeborn2BeAlive/f6a475e863726d767a6a0669c692e90e to your computer and use it in GitHub Desktop.
Save Celeborn2BeAlive/f6a475e863726d767a6a0669c692e90e to your computer and use it in GitHub Desktop.
Shell script to build a wheel of OpenTimelineIO 0.12.1
#!/bin/bash
# This script generate a wheel for OpenTimelineIO in dist folder
# We need it has a patch to install otio 0.12.1 in Windows Blender because it requires compilation
# This wheel should be distributed with code that depends on otio 0.12.1 and installed using Blender's python -m pip
# You need python (3.7.*) and Visual Studio 2017+
CURRENT_DIR=`dirname $0`
ROOT_DIR=$CURRENT_DIR/
mkdir -p $ROOT_DIR/dist/build_otio
pushd $ROOT_DIR/dist/build_otio
python -m venv .otio_venv
source .otio_venv/Scripts/activate
pip install wheel opentimelineio==0.12.1 --no-cache-dir -v
pip wheel opentimelineio
WHEEL_NAME=`ls Open*`
python -m zipfile -e $WHEEL_NAME _unzipped
# Put dlls at root of opentimelineio package
cp .otio_venv/Lib/site-packages/opentimelineio/cxx-libs/bin/*.dll _unzipped/opentimelineio/
rm $WHEEL_NAME
python -m zipfile -c $WHEEL_NAME _unzipped/*
mv $WHEEL_NAME ..
popd
rm -rf $ROOT_DIR/dist/build_otio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment