# Template file for 'rust'
pkgname=rust
version=0.12.0
revision=1
lib32disabled=yes
build_style=configure
only_for_archs="x86_64 i686"
configure_args="--prefix=/usr --disable-docs"
hostmakedepends="which pkg-config perl curl python chrpath"
short_desc="A safe, concurrent, practical language"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://www.rust-lang.org/"
license="MIT, Apache-2.0"
update_site="${homepage}install.html"
distfiles="http://static.rust-lang.org/dist/rust-${version}.tar.gz"
checksum=883e66b24d90d9957c5c538469fcde6f0668e5fb6448beecfc60884060e769b7

if [ "$XBPS_MACHINE" = "x86_64" ]; then
	configure_args+=" --build=$(gcc -dumpmachine)"
fi

post_install() {
	vlicense COPYRIGHT LICENSE

	vmkdir usr/share/vim/vimfiles
	cp -a src/etc/vim ${DESTDIR}/usr/share/vim/vimfiles
	find ${DESTDIR}/usr/share/vim -type f -exec chmod 644 {} +
	find ${DESTDIR}/usr/share/vim -type d -exec chmod 755 {} +

	vinstall src/etc/zsh/_rust 644 usr/share/zsh/site-functions
	vinstall src/etc/kate/rust.xml 644 usr/share/apps/katepart/syntax
	vinstall src/etc/gedit/share/mime/packages/rust.xml 644 usr/share/mime/packages
	vinstall src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang \
		644 usr/share/gtksourceview-3.0/language-specs

}