#!/usr/bin/env bash
# From sage-spkg.
# For type=script packages, the build rule in build/make/Makefile sources
# sage-env but not sage-dist-helpers.
lib="$SAGE_ROOT/build/bin/sage-dist-helpers"
source "$lib"
if [ $? -ne 0 ]; then
    echo >&2 "Error: failed to source $lib"
    echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?"
    exit 1
fi
# We build the wheel directly with "setup.py bdist_wheel", not with "pip wheel",
# because pip does not handle our symlinks correctly.
cd src && sdh_setup_bdist_wheel && sdh_store_and_pip_install_wheel .
