+# Copyright © 2020 Nick Bowler
+# License GPLv3+: GNU General Public License version 3 or any later version.
+# This is free software: you are free to change and redistribute it.
+# There is NO WARRANTY, to the extent permitted by law.
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Command-line program loader for Teensy"
+HOMEPAGE="https://www.pjrc.com/teensy/loader_cli.html"
+SRC_URI="https://github.com/PaulStoffregen/$PN/archive/$PV.tar.gz -> $P.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples"
+
+DEPEND="virtual/libusb:0"
+RDEPEND=$DEPEND
+
+src_compile () {
+ emake CC="$(tc-getCC)" CFLAGS="$LDFLAGS $CFLAGS"
+}
+
+src_install () {
+ dobin teensy_loader_cli
+
+ if use examples; then
+ docompress -x "/usr/share/doc/$PF/examples"
+ docinto examples
+ dodoc *.hex
+ fi
+}