. "${GRIMOIRE}/FUNCTIONS"
           SPELL="cbindgen"
if [[ "${CBINDGEN_BRANCH}" == "scm" ]]; then
         VERSION="$(get_scm_version)"
          SOURCE="${SPELL}-git.tar.bz2"
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-git"
      SOURCE_URL="git_http://github.com/eqrion/${SPELL}:${SPELL}-git"
   SOURCE_IGNORE="volatile"
  FORCE_DOWNLOAD="on"
else
# The sources consist of the upstream tarball and a cargo tarball which is the
# result of running
# CARGO_HOME=$PWD/.cargo cargo fetch
# tar -czf $(basename $PWD)-cargo.tar.gz .cargo Cargo.lock
# in the cbindgen source directory.
#
# With the non-scm branch, we want offline builds.
#
         VERSION="0.29.1"
          SOURCE="${SPELL}-${VERSION}.tar.gz"
         SOURCE2="${SPELL}-0.24.3-cargo.tar.gz"
     SOURCE_HASH="sha512:7154cba9b5f0e48dbab9c425d4997155db33c9e801611cb039c5812291229464b31f61631b0f82bdee43f6dd751f36f6c85e340eb704acda1e4f0d0c1d5118ed"
    SOURCE2_HASH="sha512:e769047bd25ff892e54abbcc06a0ed158cc85f92a8d068e92d75750557856f15a7f5b71e1079ea99b7d6878d2ee6b5a4384f9cd4c691a0a236840c4d1e56993c"
   SOURCE_URL[0]="https://github.com/eqrion/${SPELL}/archive/v${VERSION}.tar.gz"
   SOURCE2_URL[0]="https://smgl.bandrate.org/${SOURCE2}"
# Watch: https://github.com/mozilla/cbindgen/tags/ tags/([0-9.]+)[.]tar
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
fi
        WEB_SITE="https://docs.rs/cbindgen"
      LICENSE[0]="MPL"
         ENTERED="20181022"
           SHORT="a tool to generate C bindings for Rust code"
cat << EOF
This project can be used to generate C bindings for Rust code. It is currently
being developed to support creating bindings for WebRender, but has been
designed to support any project.

Features

  * Builds bindings for a crate, its mods, its dependent crates, and their mods
  * Only the necessary types for exposed functions are given bindings
  * Can specify annotations for controlling some aspects of binding
  * Support for generic structs and unions
  * Support for exporting constants and statics
  * Customizable formatting, can be used in C or C++ projects
  * Support for generating `#ifdef`'s for `#[cfg]` attributes
  * Support for `#[repr(sized)]` tagged enum's
EOF
