Skip to content

Instantly share code, notes, and snippets.

@tin2tin
Forked from Celeborn2BeAlive/build_otio_wheel.sh
Created November 26, 2020 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tin2tin/4f502f9e39857f057e1292747c5e3781 to your computer and use it in GitHub Desktop.
Save tin2tin/4f502f9e39857f057e1292747c5e3781 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