libsigrok-0.3.0.ebuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils autotools
  5. if [[ ${PV} == "9999" ]]; then
  6. EGIT_REPO_URI="git://sigrok.org/${PN}"
  7. inherit git-r3 autotools
  8. else
  9. SRC_URI="http://sigrok.org/download/source/${PN}/${P}.tar.gz"
  10. KEYWORDS="amd64 x86"
  11. fi
  12. DESCRIPTION="basic hardware drivers for logic analyzers and input/output file format support"
  13. HOMEPAGE="http://sigrok.org/wiki/Libsigrok"
  14. LICENSE="GPL-3"
  15. SLOT="0"
  16. IUSE="ftdi serial static-libs test usb"
  17. # We also support librevisa, but that isn't in the tree ...
  18. LIB_DEPEND=">=dev-libs/glib-2.32.0[static-libs(+)]
  19. >=dev-libs/libzip-0.8:=[static-libs(+)]
  20. ftdi? ( >=dev-embedded/libftdi-0.16:=[static-libs(+)] )
  21. serial? ( >=dev-libs/libserialport-0.1.0[static-libs(+)] )
  22. usb? ( virtual/libusb:1[static-libs(+)] )"
  23. RDEPEND="!static-libs? ( ${LIB_DEPEND//\[static-libs(+)]} )
  24. static-libs? ( ${LIB_DEPEND} )"
  25. DEPEND="${LIB_DEPEND//\[static-libs(+)]}
  26. test? ( >=dev-libs/check-0.9.4 )
  27. virtual/pkgconfig"
  28. src_prepare() {
  29. epatch "${FILESDIR}"/${PN}-0.3.0-configure-flags.patch
  30. epatch "${FILESDIR}"/${PN}-0.3.0-no-check-linkage.patch
  31. eautoreconf
  32. # Deal with libftdi-0.x & libftdi-1.x changes.
  33. if has_version dev-embedded/libftdi:1 ; then
  34. sed -i 's:libftdi >= 0.16:libftdi1 >= 0.16:g' configure || die
  35. fi
  36. # Fix implicit decl w/usleep.
  37. sed -i '1i#include <unistd.h>' hardware/asix-sigma/asix-sigma.c || die
  38. }
  39. src_configure() {
  40. econf \
  41. $(use_enable ftdi libftdi) \
  42. $(use_enable serial libserialport) \
  43. $(use_enable usb libusb) \
  44. $(use_enable static-libs static)
  45. }
  46. src_test() {
  47. emake check
  48. }
  49. src_install() {
  50. default
  51. prune_libtool_files
  52. }