openocd-0.9.0.ebuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils multilib flag-o-matic toolchain-funcs udev user
  5. # One ebuild to rule them all
  6. if [[ ${PV} == "9999" ]] ; then
  7. inherit autotools git-2
  8. EGIT_REPO_URI="git://git.code.sf.net/p/${PN}/code"
  9. EGIT_PROJECT="${PN}"
  10. else
  11. MY_PV="${PV/_/-}"
  12. MY_P="${PN}-${MY_PV}"
  13. S="${WORKDIR}"/${MY_P}
  14. KEYWORDS="~amd64 ~arm ~x86"
  15. SRC_URI="mirror://sourceforge/project/${PN}/${PN}/${MY_PV}/${MY_P}.tar.gz"
  16. fi
  17. DESCRIPTION="OpenOCD - Open On-Chip Debugger"
  18. HOMEPAGE="http://openocd.sourceforge.net"
  19. LICENSE="GPL-2+"
  20. SLOT="0"
  21. IUSE="cmsis-dap dummy ftdi parport +usb verbose-io"
  22. RESTRICT="strip" # includes non-native binaries
  23. RDEPEND=">=dev-lang/jimtcl-0.76
  24. cmsis-dap? ( dev-libs/hidapi )
  25. usb? (
  26. virtual/libusb:0
  27. virtual/libusb:1
  28. )
  29. ftdi? ( dev-embedded/libftdi:= )"
  30. DEPEND="${RDEPEND}
  31. virtual/pkgconfig"
  32. pkg_setup() {
  33. enewgroup plugdev
  34. }
  35. src_prepare() {
  36. epatch_user
  37. if [[ ${PV} == "9999" ]] ; then
  38. AT_NO_RECURSIVE=yes eautoreconf
  39. fi
  40. }
  41. src_configure() {
  42. # Here are some defaults
  43. local myconf=(
  44. --enable-buspirate
  45. --disable-werror
  46. --disable-internal-jimtcl
  47. --enable-amtjtagaccel
  48. --enable-ep93xx
  49. --enable-at91rm9200
  50. --enable-gw16012
  51. --enable-oocd_trace
  52. --enable-arm-jtag-ew
  53. --enable-sysfsgpio
  54. --enable-bcm2835gpio
  55. )
  56. # Adapters requiring usb/libusb-1.X support
  57. if use usb; then
  58. myconf+=(
  59. --enable-aice
  60. --enable-usb-blaster-2
  61. --enable-ftdi
  62. --enable-ti-icdi
  63. --enable-ulink
  64. --enable-osbdm
  65. --enable-opendous
  66. --enable-usbprog
  67. --enable-jlink
  68. --enable-rlink
  69. --enable-stlink
  70. --enable-vsllink
  71. --enable-armjtagew
  72. $(use_enable verbose-io verbose-usb-io)
  73. $(use_enable verbose-io verbose_usb_comms)
  74. )
  75. else
  76. myconf+=(
  77. --disable-aice
  78. --disable-usb-blaster-2
  79. --disable-ftdi
  80. --disable-ti-icdi
  81. --disable-ulink
  82. --disable-osbdm
  83. --disable-opendous
  84. --disable-usbprog
  85. --disable-jlink
  86. --disable-rlink
  87. --disable-stlink
  88. --disable-vsllink
  89. --disable-armjtagew
  90. )
  91. fi
  92. if use ftdi; then
  93. myconf+=(
  94. --enable-usb_blaster_libftdi
  95. --enable-openjtag_ftdi
  96. --enable-presto_libftdi
  97. )
  98. else
  99. myconf+=(
  100. --disable-openjtag_ftdi
  101. --disable-presto_libftdi
  102. --disable-usb_blaster_libftdi
  103. )
  104. fi
  105. econf \
  106. $(use_enable dummy) \
  107. $(use_enable cmsis-dap) \
  108. $(use_enable parport) \
  109. $(use_enable parport parport_ppdev) \
  110. $(use_enable verbose-io verbose-jtag-io) \
  111. "${myconf[@]}"
  112. }
  113. src_install() {
  114. default
  115. env -uRESTRICT prepstrip "${ED}"/usr/bin
  116. udev_dorules "${D}"/usr/share/${PN}/contrib/*.rules
  117. }
  118. pkg_postinst() {
  119. elog "To access openocd devices as user you must be in the plugdev group"
  120. }