From 5116055a56adb2603549f94bf1cbf1295b0b4599 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 23 Jul 2012 10:36:26 -0400 Subject: [PATCH 1/1] Add dev-embedded/teensy-loader-cli (PJRC's microcontroller programmer). --- ChangeLog | 12 +++++++ Manifest | 5 +++ files/49-teensy.rules | 7 ++++ metadata.xml | 9 +++++ teensy-loader-cli-2.0.ebuild | 66 ++++++++++++++++++++++++++++++++++++ 5 files changed, 99 insertions(+) create mode 100644 ChangeLog create mode 100644 Manifest create mode 100644 files/49-teensy.rules create mode 100644 metadata.xml create mode 100644 teensy-loader-cli-2.0.ebuild diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..214f243 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,12 @@ +# ChangeLog for dev-embedded/teensy-loader-cli +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + +*teensy-loader-cli-2.0 (23 Jul 2012) + 23 Jul 2012; W. Trevor King teensy-loader-cli-2.0.ebuild: + - Added initial ChangeLog which should be updated whenever the + package is updated in any way. This changelog is targetted to + users. This means that the comments should well explained and + written in clean English. The details about writing correct + changelogs are explained in the skel.ChangeLog file which you can + find in the root directory of the portage repository. diff --git a/Manifest b/Manifest new file mode 100644 index 0000000..10123db --- /dev/null +++ b/Manifest @@ -0,0 +1,5 @@ +AUX 49-teensy.rules 351 RMD160 698918dc4fbc18576648c301315ca8359c61f300 SHA1 7fa52c47195a86c328e712b6bce28220cdfacfb9 SHA256 fdf8636c1749a6dc26e1d6f37bf1894d047512d07fcbae36fa51da6455cb1ce9 +DIST teensy_loader_cli.2.0.tar.gz 27044 RMD160 11851edd9a46fc4b929177b8fef54edd5a1aac54 SHA1 2b49231dadc7cae63745ab0e0b0756ef895ccb5c SHA256 0ffd4d4b65fe3c2bce7ef73cf599b0b5279b3101fb843054cd79b0df6e067a96 +EBUILD teensy-loader-cli-2.0.ebuild 1416 RMD160 b274db1962920a562ece7eaadabe3945eca4db26 SHA1 04683f79240acb02637efd5e2adf3a0532062390 SHA256 93667c72726132b870c815ada893f6c6cb7a02999bcf03b220c4b68a3a28840e +MISC ChangeLog 626 RMD160 49e55e33ad18e22e7ba9899d210e95f449012fdb SHA1 613495d45b77448bc47554ecf7423b957d290c14 SHA256 46ee92e2364e65a163cb566acfdeff66228287b8b5035cbd7f4ae5ed8f665275 +MISC metadata.xml 247 RMD160 f6a3debfa8f70e039ec74fe92be0de687c8cec20 SHA1 30c46f34b3a777a6ff4f46dd4590b94677594948 SHA256 30b3270d8e655f6c190d3148f49b9364795beb41991502630e6631886ef107ea diff --git a/files/49-teensy.rules b/files/49-teensy.rules new file mode 100644 index 0000000..5f45978 --- /dev/null +++ b/files/49-teensy.rules @@ -0,0 +1,7 @@ +# UDEV Rules for Teensy boards, http://www.pjrc.com/teensy/ +# +# Based on the suggestions at: +# http://www.pjrc.com/teensy/49-teensy.rules + +SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789]?", GROUP:="teensy" +KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789]?", GROUP:="teensy", ENV{ID_MM_DEVICE_IGNORE}="1" diff --git a/metadata.xml b/metadata.xml new file mode 100644 index 0000000..7b35910 --- /dev/null +++ b/metadata.xml @@ -0,0 +1,9 @@ + + + + + + wking@tremily.us + W. Trevor King + + diff --git a/teensy-loader-cli-2.0.ebuild b/teensy-loader-cli-2.0.ebuild new file mode 100644 index 0000000..8570795 --- /dev/null +++ b/teensy-loader-cli-2.0.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="4" + +inherit eutils + +MY_PN="${PN//-/_}" +DESCRIPTION="Command line programmer for Teensy microcontrollers" +HOMEPAGE="http://pjrc.com/teensy/loader_cli.html" +SRC_URI="http://pjrc.com/teensy/${MY_PN}.${PV}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64" +IUSE="-examples +udev" + +DEPEND="dev-libs/libusb" +RDEPEND="$DEPEND" + +S="${WORKDIR}/${MY_PN}" + +pkg_setup() { + use udev && enewgroup teensy + #groupdel in pkg_postrm()? +} + +src_unpack() { + unpack ${A} + cd "${S}" + # Don't strip the binary (remove -s flag) + sed -i 's/$(CFLAGS) -s /$(CFLAGS) /' Makefile +} + +src_compile() { + emake OS=LINUX "CFLAGS=${CFLAGS}" "LDFLAGS=${LDFLAGS}" +} + +src_install() { + dobin teensy_loader_cli + if use examples; then + dodoc *.hex + fi + if use udev; then + insinto /lib/udev/rules.d + doins "${FILESDIR}/49-teensy.rules" + fi +} + +pkg_postinst() { + if use udev; then + elog "To be able to use Teensy devices, you need to be a" + elog "member of the group 'teensy' which has just been added" + elog "to your system. You can add your user to the group by" + elog "running the following command as root:" + elog + elog " usermod -a -G teensy youruser" + elog + elog "Please be aware that you need to either re-login or run" + elog + elog " newgrp - teensy" + elog + elog "for the group membership to take effect." + fi +} -- 2.26.2