#!/bin/bash
# This script compiles a Python file using Cython (.pyx)
# and patches the resulting binding file to include custom build tags (coprocess, python)
INPUT=$1
echo "cython: $INPUT"
cd tyk/
rm $INPUT.c
echo "Cython compilation..."
cythonize $INPUT.pyx
echo "Appending build tags!"
echo -e "// +build coprocess\n// +build python\n\n$(cat $INPUT.c)" > $INPUT.c
echo "Done"
