diff options
Diffstat (limited to 'sys-apps/paludis/paludis-scm.ebuild')
-rw-r--r-- | sys-apps/paludis/paludis-scm.ebuild | 216 |
1 files changed, 99 insertions, 117 deletions
diff --git a/sys-apps/paludis/paludis-scm.ebuild b/sys-apps/paludis/paludis-scm.ebuild index 6be2b84..211e913 100644 --- a/sys-apps/paludis/paludis-scm.ebuild +++ b/sys-apps/paludis/paludis-scm.ebuild @@ -1,171 +1,153 @@ -# Copyright 1999-2007 Ciaran McCreesh +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: $ +# $Id$ -EAPI="paludis-1" +EAPI=5 -SCM_REPOSITORY="git://git.exherbo.org/paludis/paludis.git" -SCM_CHECKOUT_TO="${DISTDIR}/git-src/paludis" -inherit scm-git bash-completion-r1 user +EGIT_REPO_URI='https://git.exherbo.org/paludis/paludis.git' +PYTHON_COMPAT=( python2_7 ) +# matching profile defaults for now +RUBY_VER=2.1 + +inherit autotools bash-completion-r1 eutils git-r3 python-single-r1 user DESCRIPTION="paludis, the other package mangler" HOMEPAGE="http://paludis.exherbo.org/" SRC_URI="" -RUBY_VERSIONS=( 1.9:ruby19 2.0:ruby20 2.1:ruby21 2.2:ruby22 ) - -IUSE="doc gemcutter portage pink python-bindings ruby-bindings search-index vim-syntax xml zsh-completion pbins ${RUBY_VERSIONS[*]/#*:/ruby_targets_}" -LICENSE="GPL-2 vim-syntax? ( vim )" +IUSE="doc pbins pink python ruby search-index test +xml" +LICENSE="GPL-2 vim" SLOT="0" -KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86" +KEYWORDS="" COMMON_DEPEND=" >=app-admin/eselect-1.2.13 - >=app-shells/bash-3.2 + >=app-shells/bash-3.2:0 dev-libs/libpcre[cxx] - ruby-bindings? ( $( - for ruby in ${RUBY_VERSIONS[@]}; do - echo "ruby_targets_${ruby#*:}? ( dev-lang/ruby:${ruby%:*} )" - done - ) ) - python-bindings? ( >=dev-lang/python-2.6:= >=dev-libs/boost-1.41.0[python] ) - gemcutter? ( >=dev-libs/jansson-1.3 ) - xml? ( >=dev-libs/libxml2-2.6 ) - search-index? ( dev-db/sqlite:3 ) - pbins? ( >=app-arch/libarchive-3.1.2[-xattr] )" + sys-apps/file + pbins? ( >=app-arch/libarchive-3.1.2 ) + python? ( + ${PYTHON_DEPS} + >=dev-libs/boost-1.41.0[python,${PYTHON_USEDEP}] ) + ruby? ( dev-lang/ruby:${RUBY_VER} ) + search-index? ( >=dev-db/sqlite-3 ) + xml? ( >=dev-libs/libxml2-2.6 )" DEPEND="${COMMON_DEPEND} >=app-text/asciidoc-8.6.3 + app-text/htmltidy app-text/xmlto - >=sys-devel/autoconf-2.65 - sys-devel/automake:1.11 + >=sys-devel/gcc-4.7 doc? ( - || ( >=app-doc/doxygen-1.5.3 <=app-doc/doxygen-1.5.1 ) - media-gfx/imagemagick - python-bindings? ( dev-python/sphinx ) - ruby-bindings? ( dev-ruby/syntax$( - for ruby in ${RUBY_VERSIONS[@]}; do - echo -n "[ruby_targets_${ruby#*:}?]" - done - ) ) + app-doc/doxygen + python? ( dev-python/sphinx[${PYTHON_USEDEP}] ) + ruby? ( dev-ruby/syntax[ruby_targets_ruby${RUBY_VER/./}] ) ) - virtual/pkgconfig" + virtual/pkgconfig + test? ( >=dev-cpp/gtest-1.6.0-r1 )" RDEPEND="${COMMON_DEPEND} sys-apps/sandbox" -# Keep syntax as a PDEPEND. It avoids issues when Paludis is used as the -# default virtual/portage provider. -PDEPEND=" - vim-syntax? ( >=app-editors/vim-core-7 ) - suggested: - app-eselect/eselect-package-manager - dev-vcs/bzr - dev-vcs/git - dev-vcs/mercurial - dev-vcs/subversion - >=net-misc/rsync-3 - net-misc/wget" - -check_ruby_targets() { - if useq ruby-bindings; then - local nruby=0 ruby - for ruby in ${RUBY_VERSIONS[@]}; do - useq ruby_targets_${ruby#*:} && (( ++nruby )) - done - [[ ${nruby} -eq 1 ]] || die "exactly one RUBY_TARGETS flag must be set if USE=ruby-bindings" +PDEPEND="app-eselect/eselect-package-manager" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" +RESTRICT="!test? ( test )" + +pkg_pretend() { + if [[ ${MERGE_TYPE} != buildonly ]]; then + if id paludisbuild >/dev/null 2>/dev/null ; then + if ! groups paludisbuild | grep --quiet '\<tty\>' ; then + eerror "The 'paludisbuild' user is now expected to be a member of the" + eerror "'tty' group. You should add the user to this group before" + eerror "upgrading Paludis." + die "Please add paludisbuild to tty group" + fi + fi fi } -create-paludis-user() { +pkg_setup() { enewgroup "paludisbuild" enewuser "paludisbuild" -1 -1 "/var/tmp/paludis" "paludisbuild,tty" -} -pkg_pretend() { - check_ruby_targets + use python && python-single-r1_pkg_setup } -pkg_setup() { - check_ruby_targets - create-paludis-user -} +src_prepare() { + # Fix the script shebang on Ruby scripts. + # https://bugs.gentoo.org/show_bug.cgi?id=439372#c2 + sed -i -e "1s/ruby/&${RUBY_VER/./}/" ruby/demos/*.rb || die -src_unpack() { - scm_src_unpack - cd "${S}" - ./autogen.bash || die "autogen.bash failed" + ./autotools_prepare.bash || die + eautoreconf + epatch_user } -src_compile() { - local repositories=`echo default unavailable unpackaged $(usev gemcutter ) | tr -s \ ,` - local environments=`echo default $(usev portage ) | tr -s \ ,` - econf \ - $(use_enable doc doxygen ) \ - $(use_enable pink ) \ - $(use_enable ruby-bindings ruby ) \ - $(useq ruby-bindings && for ruby in ${RUBY_VERSIONS[@]}; do - useq ruby_targets_${ruby#*:} && echo --with-ruby-version=${ruby%:*} - done ) \ - $(useq ruby-bindings && useq doc && echo --enable-ruby-doc ) \ - $(use_enable python-bindings python ) \ - $(useq python-bindings && useq doc && echo --enable-python-doc ) \ - $(use_enable vim-syntax vim ) \ - $(use_enable xml ) \ - $(use_enable search-index ) \ - $(use_enable pbins ) \ - --with-vim-install-dir=/usr/share/vim/vimfiles \ - --with-repositories=${repositories} \ - --with-environments=${environments} \ - --with-git-head="$(git rev-parse HEAD)" \ - || die "econf failed" - - emake || die "emake failed" +src_configure() { + local myconf=( + --htmldir=/usr/share/doc/${PF}/html + + $(use_enable doc doxygen) + $(use_enable test gtest) + $(use_enable pbins) + $(use_enable pink) + $(use_enable python) + $(use python && use_enable doc python-doc) + $(use_enable ruby) + $(use ruby && use_enable doc ruby-doc) + --with-ruby-version="${RUBY_VER}" + $(use_enable search-index) + $(use_enable xml) + + --enable-vim + --with-config-framework=eselect + --with-environments=default,portage + --with-vim-install-dir=/usr/share/vim/vimfiles + ) + + econf "${myconf[@]}" } src_install() { - emake DESTDIR="${D}" install || die "install failed" - dodoc AUTHORS README NEWS + default + prune_libtool_files - dobashcomp bash-completion/cave || die "dobashcomp failed" + dobashcomp bash-completion/cave - if use zsh-completion ; then - insinto /usr/share/zsh/site-functions - doins zsh-completion/_cave - doins zsh-completion/_paludis_packages - fi + insinto /usr/share/zsh/site-functions + doins zsh-completion/_cave } src_test() { # Work around Portage bugs - export PALUDIS_DO_NOTHING_SANDBOXY="portage sucks" - export BASH_ENV=/dev/null - -# if [[ `id -u` == 0 ]] ; then -# # hate -# export PALUDIS_REDUCED_UID=0 -# export PALUDIS_REDUCED_GID=0 -# fi - -# if ! emake check ; then -# eerror "Tests failed. Looking for files for you to add to your bug report..." -# find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do -# eerror " $a" -# done -# die "Make check failed" -# fi + local -x PALUDIS_DO_NOTHING_SANDBOXY="portage sucks" + local -x BASH_ENV=/dev/null + + if [[ ${EUID} == 0 ]] ; then + # hate + local -x PALUDIS_REDUCED_UID=0 + local -x PALUDIS_REDUCED_GID=0 + fi + + if ! nonfatal emake -k check ; then + eerror "Tests failed. Looking for files for you to add to your bug report..." + find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do + eerror " $a" + done + die "Make check failed" + fi } pkg_postinst() { - pm_is_paludis=false + local pm if [[ -f ${ROOT}/etc/env.d/50package-manager ]] ; then - pm_is_paludis=$( source ${ROOT}/etc/env.d/50package-manager ; [[ ${PACKAGE_MANAGER} == paludis ]] && echo true || echo false ) + pm=$( source "${ROOT}"/etc/env.d/50package-manager ; echo "${PACKAGE_MANAGER}" ) fi - if ! $pm_is_paludis ; then + if [[ ${pm} != paludis ]] ; then elog "If you are using paludis or cave as your primary package manager," elog "you should consider running:" elog " eselect package-manager set paludis" fi } - |