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