paludis-3.0.0_pre20170219.ebuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 )
  5. RUBY_VER=2.3
  6. inherit bash-completion-r1 cmake-utils python-single-r1 user vcs-snapshot
  7. DESCRIPTION="paludis, the other package mangler"
  8. HOMEPAGE="http://paludis.exherbo.org/"
  9. SRC_URI="https://git.exherbo.org/paludis/paludis.git/snapshot/paludis-1bbd4440fe4fb82a9ebd61d3f17b9ffa259eb17f.tar.xz
  10. -> ${P}.tar.xz"
  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:0
  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-arch/xz-utils
  29. >=app-text/asciidoc-8.6.3
  30. app-text/htmltidy
  31. app-text/xmlto
  32. >=sys-devel/gcc-4.7
  33. doc? (
  34. app-doc/doxygen
  35. python? ( dev-python/sphinx[${PYTHON_USEDEP}] )
  36. ruby? ( dev-ruby/syntax[ruby_targets_ruby${RUBY_VER/./}] )
  37. )
  38. virtual/pkgconfig
  39. test? ( >=dev-cpp/gtest-1.6.0-r1 )"
  40. RDEPEND="${COMMON_DEPEND}
  41. sys-apps/sandbox"
  42. PDEPEND="app-eselect/eselect-package-manager"
  43. REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
  44. RESTRICT="!test? ( test )"
  45. pkg_pretend() {
  46. if [[ ${MERGE_TYPE} != buildonly ]]; then
  47. if id paludisbuild >/dev/null 2>/dev/null ; then
  48. if ! groups paludisbuild | grep --quiet '\<tty\>' ; then
  49. eerror "The 'paludisbuild' user is now expected to be a member of the"
  50. eerror "'tty' group. You should add the user to this group before"
  51. eerror "upgrading Paludis."
  52. die "Please add paludisbuild to tty group"
  53. fi
  54. fi
  55. fi
  56. }
  57. pkg_setup() {
  58. enewgroup "paludisbuild"
  59. enewuser "paludisbuild" -1 -1 "/var/tmp/paludis" "paludisbuild,tty"
  60. use python && python-single-r1_pkg_setup
  61. }
  62. src_prepare() {
  63. # Fix the script shebang on Ruby scripts.
  64. # https://bugs.gentoo.org/show_bug.cgi?id=439372#c2
  65. sed -i -e "1s/ruby/&${RUBY_VER/./}/" ruby/demos/*.rb || die
  66. eapply_user
  67. }
  68. src_configure() {
  69. local mycmakeargs=(
  70. -DENABLE_DOXYGEN=$(usex doc)
  71. -DENABLE_GTEST=$(usex test)
  72. -DENABLE_PBINS=$(usex pbins)
  73. -DENABLE_PYTHON=$(usex python)
  74. -DENABLE_PYTHON_DOCS=$(usex doc) # USE=python implicit
  75. -DENABLE_RUBY=$(usex ruby)
  76. -DENABLE_RUBY_DOCS=$(usex doc) # USE=ruby implicit
  77. -DENABLE_SEARCH_INDEX=$(usex search-index)
  78. -DENABLE_VIM=ON
  79. -DENABLE_XML=$(usex xml)
  80. -DPALUDIS_COLOUR_PINK=$(usex pink)
  81. -DRUBY_VERSION=${RUBY_VER}
  82. -DPALUDIS_ENVIRONMENTS=all
  83. -DPALUDIS_DEFAULT_DISTRIBUTION=gentoo
  84. -DPALUDIS_CLIENTS=all
  85. -DCONFIG_FRAMEWORK=eselect
  86. # GNUInstallDirs
  87. -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
  88. )
  89. cmake-utils_src_configure
  90. }
  91. src_install() {
  92. cmake-utils_src_install
  93. dobashcomp bash-completion/cave
  94. insinto /usr/share/zsh/site-functions
  95. doins zsh-completion/_cave
  96. }
  97. src_test() {
  98. # Work around Portage bugs
  99. local -x PALUDIS_DO_NOTHING_SANDBOXY="portage sucks"
  100. local -x BASH_ENV=/dev/null
  101. if [[ ${EUID} == 0 ]] ; then
  102. # hate
  103. local -x PALUDIS_REDUCED_UID=0
  104. local -x PALUDIS_REDUCED_GID=0
  105. fi
  106. cmake-utils_src_test
  107. }
  108. pkg_postinst() {
  109. local pm
  110. if [[ -f ${ROOT}/etc/env.d/50package-manager ]] ; then
  111. pm=$( source "${ROOT}"/etc/env.d/50package-manager ; echo "${PACKAGE_MANAGER}" )
  112. fi
  113. if [[ ${pm} != paludis ]] ; then
  114. elog "If you are using paludis or cave as your primary package manager,"
  115. elog "you should consider running:"
  116. elog " eselect package-manager set paludis"
  117. fi
  118. }