### this file is sourced not run
PKGBUILD=1
PKGARCH=x86_64

# source: BLFS 11.3
PKGVER=0.24.3
MD5SUM=6aa2991ca8411f9ebf9961e8b873e884
TARBALL=cbindgen-$PKGVER.tar.gz
SRC_URL=https://github.com/eqrion/cbindgen/archive/v0.24.3/$TARBALL

# BLFS note: As with most Rust packages, this needs a network connection
# to check the current versions of the required cargo crates, and to
# download them if they are not already present.
# James note: in other words, build not reproducible.

SLACKREQ=
SLACKDESC="cbindgen: cbindgen $PKGVER (C bindings for Rust)
cbindgen: 
cbindgen: Cbindgen can be used to generate C bindings for Rust code.
cbindgen: 
cbindgen: 
cbindgen: 
cbindgen: 
cbindgen: 
cbindgen: 
cbindgen: 
cbindgen: 
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/cbindgen* &&
	echo nameserver 8.8.8.8 > /etc/resolv.conf &&

	. /etc/profile.d/rustc.sh &&
	cargo build --release &&
	install -Dm755 target/release/cbindgen /usr/bin/ &&

	# clean up the crap that rust downloaded
	rm -rf /root/.cargo && # this is 133MB over head to compile 200 B souce code
	
	rm -f /etc/resolv.conf &&
	pkg_build_slackdesc
}


