lshw-02.17b-r2.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PLOCALES='fr'
  5. inherit flag-o-matic eutils toolchain-funcs l10n
  6. MAJ_PV=${PV:0:${#PV}-1}
  7. MIN_PVE=${PV:0-1}
  8. MIN_PV=${MIN_PVE/b/B}
  9. MY_P="$PN-$MIN_PV.$MAJ_PV"
  10. DESCRIPTION="Hardware Lister"
  11. HOMEPAGE="http://ezix.org/project/wiki/HardwareLiSter"
  12. SRC_URI="http://ezix.org/software/files/${MY_P}.tar.gz"
  13. LICENSE="GPL-2"
  14. SLOT="0"
  15. KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
  16. IUSE="gtk sqlite static"
  17. REQUIRED_USE="static? ( !gtk )"
  18. RDEPEND="gtk? ( x11-libs/gtk+:2 )
  19. sqlite? ( dev-db/sqlite:3 )"
  20. DEPEND="${RDEPEND}
  21. gtk? ( virtual/pkgconfig )
  22. sqlite? ( virtual/pkgconfig )"
  23. RDEPEND="${RDEPEND}
  24. sys-apps/hwids"
  25. S=${WORKDIR}/${MY_P}
  26. src_prepare() {
  27. epatch \
  28. "${FILESDIR}"/${P}-gentoo.patch \
  29. "${FILESDIR}"/${P}-fat.patch \
  30. "${FILESDIR}"/${P}-musl.patch
  31. l10n_find_plocales_changes "src/po" "" ".po" || die
  32. sed -i \
  33. -e "/^LANGUAGES =/ s/=.*/= $(l10n_get_locales)/" \
  34. src/po/Makefile || die
  35. sed -i \
  36. -e 's:\<pkg-config\>:${PKG_CONFIG}:' \
  37. src/Makefile src/gui/Makefile || die
  38. }
  39. src_compile() {
  40. tc-export CC CXX AR PKG_CONFIG
  41. use static && append-ldflags -static
  42. # Need two sep make statements to avoid parallel build issues. #588174
  43. local sqlite=$(usex sqlite 1 0)
  44. emake SQLITE=${sqlite} all
  45. use gtk && emake SQLITE=${sqlite} gui
  46. }
  47. src_install() {
  48. emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install $(usex gtk 'install-gui' '')
  49. dodoc README docs/*
  50. if use gtk ; then
  51. make_desktop_entry /usr/sbin/gtk-lshw "Hardware Lister" "/usr/share/lshw/artwork/logo.svg"
  52. fi
  53. }