openocd-0.7.0-r1.ebuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Copyright 1999-2016 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
  5. # One ebuild to rule them all
  6. if [[ ${PV} == "9999" ]] ; then
  7. inherit autotools git-2
  8. KEYWORDS=""
  9. EGIT_REPO_URI="git://git.code.sf.net/p/${PN}/code"
  10. EGIT_PROJECT="${PN}"
  11. else
  12. KEYWORDS="~amd64 ~x86"
  13. SRC_URI="mirror://sourceforge/project/${PN}/${PN}/${PV}/${P}.tar.bz2"
  14. fi
  15. DESCRIPTION="OpenOCD - Open On-Chip Debugger"
  16. HOMEPAGE="http://openocd.sourceforge.net"
  17. LICENSE="GPL-2"
  18. SLOT="0"
  19. IUSE="blaster dummy ftd2xx ftdi minidriver parport presto segger stlink usb versaloon verbose-io"
  20. RESTRICT="strip" # includes non-native binaries
  21. # libftd2xx is the default because it is reported to work better.
  22. DEPEND=">=dev-lang/jimtcl-0.73
  23. usb? ( virtual/libusb:0 )
  24. presto? ( dev-embedded/libftd2xx )
  25. ftd2xx? ( dev-embedded/libftd2xx )
  26. ftdi? ( dev-embedded/libftdi:= )"
  27. RDEPEND="${DEPEND}"
  28. REQUIRED_USE="blaster? ( || ( ftdi ftd2xx ) ) ftdi? ( !ftd2xx )"
  29. src_prepare() {
  30. epatch_user
  31. if [[ ${PV} == "9999" ]] ; then
  32. sed -i -e "/@include version.texi/d" doc/${PN}.texi || die
  33. AT_NO_RECURSIVE=yes eautoreconf
  34. fi
  35. # Disable craptastic build settings.
  36. sed -i \
  37. -e 's:if test "[$]OCDxprefix" != "[$]ac_default_prefix":if false:' \
  38. configure || die
  39. if use ftdi ; then
  40. local pc="libftdi$(has_version dev-embedded/libftdi:1 && echo 1)"
  41. # Use libftdi-1 paths #460916
  42. local libs=$($(tc-getPKG_CONFIG) --libs ${pc})
  43. sed -i \
  44. -e "s:-lftdi -lusb:${libs}:" \
  45. configure src/Makefile.in || die
  46. append-cppflags $($(tc-getPKG_CONFIG) --cflags ${pc})
  47. fi
  48. }
  49. src_configure() {
  50. # Here are some defaults
  51. local myconf=(
  52. --enable-buspirate
  53. --enable-ioutil
  54. --disable-werror
  55. --disable-internal-jimtcl
  56. --enable-amtjtagaccel
  57. --enable-ep93xx
  58. --enable-at91rm9200
  59. --enable-gw16012
  60. --enable-oocd_trace
  61. --enable-ulink
  62. --enable-arm-jtag-ew
  63. --enable-ti-icdi
  64. --enable-osbdm
  65. --enable-opendous
  66. )
  67. if use usb; then
  68. myconf+=(
  69. --enable-usbprog
  70. --enable-jlink
  71. --enable-rlink
  72. --enable-vsllink
  73. --enable-arm-jtag-ew
  74. $(use_enable verbose-io verbose-usb-io)
  75. $(use_enable verbose-io verbose_usb_comms)
  76. )
  77. fi
  78. # add explicitely the path to libftd2xx
  79. use ftd2xx && append-ldflags -L/opt/$(get_libdir)
  80. if use blaster; then
  81. use ftdi && myconf+=( --enable-usb_blaster_libftdi )
  82. use ftd2xx && myconf+=( --enable-usb_blaster_ftd2xx )
  83. fi
  84. econf \
  85. $(use_enable dummy) \
  86. $(use_enable ftdi ft2232_libftdi) \
  87. $(use_enable ftdi) \
  88. $(use_enable ftd2xx ft2232_ftd2xx) \
  89. $(use_enable minidriver minidriver-dummy) \
  90. $(use_enable parport) \
  91. $(use_enable parport parport_ppdev) \
  92. $(use_enable parport parport_giveio) \
  93. $(use_enable presto presto_ftd2xx) \
  94. $(use_enable segger jlink) \
  95. $(use_enable stlink) \
  96. $(use_enable versaloon vsllink) \
  97. $(use_enable verbose-io verbose-jtag-io) \
  98. "${myconf[@]}"
  99. }
  100. src_install() {
  101. default
  102. env -uRESTRICT prepstrip "${ED}"/usr/bin "${ED}"/usr/$(get_libdir)
  103. }