paludis-9999.ebuild 3.6 KB

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