. "${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://github.com/egrion/${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.18.0"
          SOURCE="${SPELL}-${VERSION}.tar.gz"
         SOURCE2="${SPELL}-${VERSION}-cargo.tar.gz"
     SOURCE_HASH="sha512:b9d66388a41e398ac9ad47702297bc3a1edc330ede52250197faa430e72db72db0b6551ba4e176a218e098b36e1c1c3c7f3fae8b727cd99f485e846ce3ba0803"
    SOURCE2_HASH="sha512:c73539301c29ecc2dccf2d5bd96afc18d04ee6f5ef8b8df3c0217bf514c857a1e8ca6dbf00175bdbd0c63ad939b618472a3893e2d3d025ab47071844432d0b20"
   SOURCE_URL[0]="https://github.com/eqrion/${SPELL}/archive/v${VERSION}.tar.gz"
   SOURCE2_URL[0]="https://smgl.bandrate.org/${SOURCE2}"
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
