pkgname=uuu
pkgver=1.3
pkgrel=0
pkgdesc="Purism fork of the Universal Update Utility: Freescale/NXP I.MX Chip image deploy tools"
url="https://source.puri.sm/Librem5/mfgtools"
arch="x86_64"
license="BSD"
depends="libusb-compat"
makedepends="libzip-dev libusb-compat-dev libusb-dev bzip2-dev cmake"
_commit="8bb3f0169778e5ae9ed498ba5652d65eccc77cff"
source="$pkgname-$_commit.tar.gz::https://source.puri.sm/Librem5/mfgtools/-/archive/${_commit}.tar.gz"
options="!check"

builddir="$srcdir"/mfgtools-"$_commit"
build() {
	cd "$builddir"
	cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .
	mkdir -p "$builddir"/libuuu/gen
	echo "#define GIT_VERSION \"lib${pkgver}\"" > "$builddir"/libuuu/gen/gitversion.h.tmp
	make
}

package() {
	cd "$builddir"
        echo "#define GIT_VERSION \"lib${pkgver}\"" > "$builddir"/libuuu/gen/gitversion.h.tmp
	make PREFIX=/usr DESTDIR="$pkgdir"/ install
}

sha512sums="f3c004d4e712123d3c2ae2e4a08e3dfd64ed9b065edb05aa0e4d7c6a5d9b1b6ea7d5190b6709c522ba7a5a3e9c978aefc3865a2e16c5696b8024a9584e3ab2a5  uuu-8bb3f0169778e5ae9ed498ba5652d65eccc77cff.tar.gz"
