duc-9999.ebuild 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools
  5. if [[ "${PV}" == "9999" ]]; then
  6. inherit git-r3
  7. EGIT_REPO_URI="https://github.com/zevv/duc.git"
  8. KEYWORDS=""
  9. else
  10. KEYWORDS="~amd64 ~x86"
  11. SRC_URI="https://github.com/zevv/${PN}/releases/download/${PV}/${P}.tar.gz"
  12. fi
  13. DESCRIPTION="A library and suite of tools for inspecting disk usage"
  14. HOMEPAGE="https://github.com/zevv/duc"
  15. LICENSE="GPL-2"
  16. SLOT="0"
  17. IUSE="cairo gui -leveldb ncurses -sqlite +tokyocabinet X"
  18. REQUIRED_USE="
  19. ^^ ( tokyocabinet leveldb sqlite )
  20. X? ( cairo gui )
  21. "
  22. DEPEND="
  23. cairo? ( x11-libs/cairo x11-libs/pango )
  24. gui? (
  25. X? (
  26. x11-libs/cairo[X]
  27. x11-libs/libX11
  28. x11-libs/pango[X]
  29. )
  30. !X? ( >=media-libs/glfw-3.0 )
  31. )
  32. leveldb? ( dev-libs/leveldb )
  33. ncurses? ( sys-libs/ncurses:= )
  34. sqlite? ( dev-db/sqlite:3 )
  35. tokyocabinet? ( dev-db/tokyocabinet )
  36. "
  37. RDEPEND="${DEPEND}"
  38. src_unpack() {
  39. if [[ "${PV}" == "9999" ]]; then
  40. git-r3_src_unpack
  41. else
  42. unpack ${A}
  43. fi
  44. }
  45. src_prepare() {
  46. sed -i -e "/ldconfig/d" -e "/install-exec-hook/d" Makefile.am || die
  47. default
  48. eautoreconf
  49. }
  50. src_configure() {
  51. local myconf=( $(use_enable ncurses ui) )
  52. if use tokyocabinet; then
  53. myconf+=( --with-db-backend=tokyocabinet )
  54. elif use leveldb; then
  55. myconf+=( --with-db-backend=leveldb )
  56. else
  57. myconf+=( --with-db-backend=sqlite3 )
  58. fi
  59. # Necessary logic for cairo
  60. if use gui && use X; then
  61. # X backend GUI
  62. myconf+=( --enable-x11 --disable-opengl --enable-cairo )
  63. elif use gui; then
  64. # OpenGL backend GUI
  65. myconf+=( --disable-x11 --enable-opengl $(use_enable cairo) )
  66. else
  67. # No GUI
  68. myconf+=( $(use_enable cairo) --disable-x11 --disable-opengl )
  69. fi
  70. econf ${myconf[@]}
  71. }