# Template file for 'rmlint'
pkgname=rmlint
version=2.2.0
revision=1
hostmakedepends="git scons pkg-config"
makedepends="glib-devel libblkid-devel elfutils-devel json-glib-devel"
short_desc="Extremely fast tool to remove duplicates"
maintainer="Andrea Brancaleoni <miwaxe@gmail.com>"
license="GPL-3"
homepage="http://rmlint.rtfd.org/"
distfiles="https://github.com/sahib/$pkgname/archive/v$version.tar.gz"
checksum=b684aa73ec80423e1cc5e9cee9ae466f0ed0c6a2e5a88482a07d3306465ee6f1

case "$XBPS_TARGET_MACHINE" in
	*-musl)	makedepends+=" musl-fts"
esac

pre_configure() {
	case "$XBPS_TARGET_MACHINE" in
	*-musl)	# Add musl-fts to the libs
		sed -i SConstruct -e "/conf\.check_sqlite3()/a conf.check_musl_fts()"
	esac
}

do_install() {
	sed -i '/native/d' SConstruct
	scons CC="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" install --prefix=${DESTDIR}/usr
	vlicense COPYING
}
