summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@dabbelt.com>2019-07-03 02:09:05 -0700
committerPalmer Dabbelt <palmer@dabbelt.com>2019-07-03 02:09:59 -0700
commit233999f73cf140ba9370f1e852359df59e919463 (patch)
treed2ef5d068063b2df309f76ff01202b3a58193c76
parentdev-embedded/yosys-0.8: New ebuild (diff)
downloadpalmer-233999f73cf140ba9370f1e852359df59e919463.tar.gz
palmer-233999f73cf140ba9370f1e852359df59e919463.tar.bz2
palmer-233999f73cf140ba9370f1e852359df59e919463.zip
Add Segger's JLink tool
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
-rw-r--r--dev-embedded/jlink/Manifest2
-rw-r--r--dev-embedded/jlink/jlink-6.46h.ebuild86
2 files changed, 88 insertions, 0 deletions
diff --git a/dev-embedded/jlink/Manifest b/dev-embedded/jlink/Manifest
new file mode 100644
index 0000000..e6a3f59
--- /dev/null
+++ b/dev-embedded/jlink/Manifest
@@ -0,0 +1,2 @@
+DIST JLink_Linux_V646h_i386.tgz 21755861 BLAKE2B c0af657e400c6aabfa6ffd00aad4c0b923f905816f291a8cdd888dffea6e55747fa2bfbb7c6985af25a204127b09b0986caaa826a3f7bd9edbf698836e341e19 SHA512 512ca78814020d53f81dfc1ebd3c6fd3fcd6ff1856669198221b0dcbc289c693826019275f9dc42424b3e74c9bf3c30d75b5dc445828e61d39f2384ea095f7b6
+DIST JLink_Linux_V646h_x86_64.tgz 30263339 BLAKE2B 71f0e816d46c6c1ca54baaf312f8378a1d3b6ed1bc347f48ed3e51542cf6e326016d9623ec3dd1bb317e22ad96ef3f3195be4d045d53eb160eb573c1bf0db510 SHA512 f449cd588eb3d997c8f16633b1cc72c44a378d49760d4635a75ef4adfc3abb2d5d1309868951c8c9d2e32efda55438db932f4d528ca6c658156583a3cae4428e
diff --git a/dev-embedded/jlink/jlink-6.46h.ebuild b/dev-embedded/jlink/jlink-6.46h.ebuild
new file mode 100644
index 0000000..84b98ed
--- /dev/null
+++ b/dev-embedded/jlink/jlink-6.46h.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit versionator
+inherit eutils
+
+INSTALLDIR="/opt/${PN}"
+
+DESCRIPTION="Tools for Segger J-Link JTAG adapters"
+HOMEPAGE="http://www.segger.com/jlink-software.html"
+SRC_URI="amd64? ( JLink_Linux_V${PV/\./}_x86_64.tgz )
+ x86? ( JLink_Linux_V${PV/\./}_i386.tgz )"
+LICENSE="J-Link Terms of Use"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+QA_PREBUILT="*"
+
+RESTRICT="fetch strip"
+DEPEND=""
+RDEPEND="${DEPEND}
+ dev-libs/libedit"
+
+pkg_setup() {
+ export S=${WORKDIR}/"JLink_Linux_V${PV/\./}_$(usex amd64 'x86_64' 'i386')"
+}
+
+pkg_nofetch() {
+ einfo "Segger requires you to download the needed files manually after"
+ einfo "entering the serial number of your debugging probe."
+ einfo
+ einfo "Download ${SRC_URI}"
+ einfo "from ${HOMEPAGE} and place it in ${DISTDIR}"
+}
+
+src_install() {
+ dodir ${INSTALLDIR} || die
+ dodir ${INSTALLDIR}/lib || die
+ dodir ${INSTALLDIR}/doc || die
+
+ local BINS="JFlashSPI_CL JLinkExe JLinkGDBServer JLinkLicenseManager JLinkRegistration
+ JLinkRemoteServer JLinkRTTClient JLinkRTTLogger JLinkSTM32 JLinkSWOViewer
+ JTAGLoadExe"
+ for wrapper in $BINS ; do
+ make_wrapper $wrapper ./$wrapper ${INSTALLDIR} lib
+ done
+
+ exeinto ${INSTALLDIR}
+ doexe $BINS || die
+
+ P_NUMBER=$(( $(printf "%d" "'$(get_version_component_range get_last_version_component_index)") - 96 ))
+ exeinto ${INSTALLDIR}
+
+ for SUFFIX in "" _x86; do
+ doexe "libjlinkarm${SUFFIX}.so.${PV/[a-z]/}.${P_NUMBER}" || die
+ dosym "libjlinkarm${SUFFIX}.so.${PV/[a-z]/}.${P_NUMBER}" "${INSTALLDIR}/libjlinkarm${SUFFIX}.so.$(get_major_version)" || die
+ dosym "libjlinkarm${SUFFIX}.so.$(get_major_version)" "${INSTALLDIR}/libjlinkarm${SUFFIX}.so" || die
+ done
+
+ doexe GDBServer/*
+
+ insinto ${INSTALLDIR}
+ doins -r x86 || die
+
+ insinto ${INSTALLDIR}/doc
+ pushd Doc
+ doins -r * || die
+ popd
+ doins README.txt
+
+ insinto ${INSTALLDIR}
+ doins -r Samples || die
+ doins -r Devices || die
+
+ insinto /lib/udev/rules.d/
+ doins 99-jlink.rules || die
+}
+
+pkg_postinst() {
+ enewgroup plugdev
+ elog "To be able to access the jlink usb adapter, you have to be"
+ elog "a member of the 'plugdev' group."
+}