paludis-2.4.0-r1.ebuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. # matching profile defaults for now
  6. RUBY_VER=2.1
  7. inherit bash-completion-r1 eutils python-single-r1 user
  8. DESCRIPTION="paludis, the other package mangler"
  9. HOMEPAGE="http://paludis.exherbo.org/"
  10. SRC_URI="http://paludis.exherbo.org/download/${P}.tar.bz2"
  11. IUSE="doc pbins pink python ruby search-index test +xml"
  12. LICENSE="GPL-2 vim"
  13. SLOT="0"
  14. KEYWORDS="~alpha amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86"
  15. COMMON_DEPEND="
  16. >=app-admin/eselect-1.2.13
  17. >=app-shells/bash-3.2
  18. dev-libs/libpcre[cxx]
  19. sys-apps/file
  20. pbins? ( >=app-arch/libarchive-3.1.2 )
  21. python? (
  22. ${PYTHON_DEPS}
  23. >=dev-libs/boost-1.41.0[python,${PYTHON_USEDEP}] )
  24. ruby? ( dev-lang/ruby:${RUBY_VER} )
  25. search-index? ( >=dev-db/sqlite-3 )
  26. xml? ( >=dev-libs/libxml2-2.6 )"
  27. DEPEND="${COMMON_DEPEND}
  28. >=app-text/asciidoc-8.6.3
  29. app-text/htmltidy
  30. app-text/xmlto
  31. >=sys-devel/gcc-4.7
  32. doc? (
  33. || (
  34. >=app-doc/doxygen-1.5.3
  35. <=app-doc/doxygen-1.5.1 )
  36. python? (
  37. dev-python/sphinx[${PYTHON_USEDEP}] )
  38. ruby? ( dev-ruby/syntax[ruby_targets_ruby${RUBY_VER/./}] )
  39. )
  40. virtual/pkgconfig
  41. test? ( >=dev-cpp/gtest-1.6.0-r1 )"
  42. RDEPEND="${COMMON_DEPEND}
  43. sys-apps/sandbox"
  44. PDEPEND="app-eselect/eselect-package-manager"
  45. REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
  46. RESTRICT="!test? ( test )"
  47. pkg_pretend() {
  48. if [[ ${MERGE_TYPE} != buildonly ]]; then
  49. if id paludisbuild >/dev/null 2>/dev/null ; then
  50. if ! groups paludisbuild | grep --quiet '\<tty\>' ; then
  51. eerror "The 'paludisbuild' user is now expected to be a member of the"
  52. eerror "'tty' group. You should add the user to this group before"
  53. eerror "upgrading Paludis."
  54. die "Please add paludisbuild to tty group"
  55. fi
  56. fi
  57. fi
  58. if [[ ${MERGE_TYPE} != binary ]]; then
  59. if [[ $(gcc-major-version) -lt 4
  60. || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ) ]]
  61. then
  62. eerror "Paludis requires at least gcc 4.7 to build. Please switch the active"
  63. eerror "gcc version using gcc-config."
  64. die "Paludis requires at least gcc 4.7"
  65. fi
  66. fi
  67. }
  68. pkg_setup() {
  69. enewgroup "paludisbuild"
  70. enewuser "paludisbuild" -1 -1 "/var/tmp/paludis" "paludisbuild,tty"
  71. use python && python-single-r1_pkg_setup
  72. }
  73. src_prepare() {
  74. # Fix the script shebang on Ruby scripts.
  75. # https://bugs.gentoo.org/show_bug.cgi?id=439372#c2
  76. sed -i -e "1s/ruby/&${RUBY_VER/./}/" ruby/demos/*.rb || die
  77. epatch_user
  78. }
  79. src_configure() {
  80. local myconf=(
  81. --htmldir=/usr/share/doc/${PF}/html
  82. $(use_enable doc doxygen)
  83. $(use_enable test gtest)
  84. $(use_enable pbins)
  85. $(use_enable pink)
  86. $(use_enable python)
  87. $(use python && use_enable doc python-doc)
  88. $(use_enable ruby)
  89. $(use ruby && use_enable doc ruby-doc)
  90. --with-ruby-version="${RUBY_VER}"
  91. $(use_enable search-index)
  92. $(use_enable xml)
  93. --enable-vim
  94. --with-config-framework=eselect
  95. --with-environments=default,portage
  96. --with-vim-install-dir=/usr/share/vim/vimfiles
  97. )
  98. econf "${myconf[@]}"
  99. }
  100. src_install() {
  101. default
  102. prune_libtool_files
  103. dobashcomp bash-completion/cave
  104. insinto /usr/share/zsh/site-functions
  105. doins zsh-completion/_cave
  106. }
  107. src_test() {
  108. # Work around Portage bugs
  109. local -x PALUDIS_DO_NOTHING_SANDBOXY="portage sucks"
  110. local -x BASH_ENV=/dev/null
  111. if [[ ${EUID} == 0 ]] ; then
  112. # hate
  113. local -x PALUDIS_REDUCED_UID=0
  114. local -x PALUDIS_REDUCED_GID=0
  115. fi
  116. if ! nonfatal emake -k check ; then
  117. eerror "Tests failed. Looking for files for you to add to your bug report..."
  118. find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do
  119. eerror " $a"
  120. done
  121. die "Make check failed"
  122. fi
  123. }
  124. pkg_postinst() {
  125. local pm
  126. if [[ -f ${ROOT}/etc/env.d/50package-manager ]] ; then
  127. pm=$( source "${ROOT}"/etc/env.d/50package-manager ; echo "${PACKAGE_MANAGER}" )
  128. fi
  129. if [[ ${pm} != paludis ]] ; then
  130. elog "If you are using paludis or cave as your primary package manager,"
  131. elog "you should consider running:"
  132. elog " eselect package-manager set paludis"
  133. fi
  134. }