diff options
-rw-r--r-- | dev-libs/libbson/Manifest | 1 | ||||
-rw-r--r-- | dev-libs/libbson/libbson-1.3.6.ebuild | 51 | ||||
-rw-r--r-- | eclass/perl-functions.eclass | 225 | ||||
-rw-r--r-- | eclass/perl-module.eclass | 4 | ||||
-rw-r--r-- | sci-libs/flann/flann-1.9.1.ebuild | 17 |
5 files changed, 288 insertions, 10 deletions
diff --git a/dev-libs/libbson/Manifest b/dev-libs/libbson/Manifest index 965056479561..0fc1c0e8914f 100644 --- a/dev-libs/libbson/Manifest +++ b/dev-libs/libbson/Manifest @@ -2,3 +2,4 @@ DIST libbson-0.98.0.tar.gz 4451923 SHA256 5e792a3c4d296a8b9e4316f1c58e94819223c4 DIST libbson-1.1.10.tar.gz 4431658 SHA256 211a62a7a6f93ba21b85afc1522c3a367a264be09626ea15f7be3a0fbe084a70 SHA512 636178bafb19e7b103b5192866dbda0c70b8d7173560b0466f88b3a85cce3292a7caac9521808fa8c09d187f8c96564dcd9fb787e855d1619610f813583379bc WHIRLPOOL 8b29882ce3ebe0da4b0ce952d2b79fff2ce4c211047ff7c05e15f6263546258c134974fdf539ed6173f286c501085e575cebde806f6578ea9fb843f1b92da4f3 DIST libbson-1.1.2.tar.gz 4492014 SHA256 acd8026d4e5bf5034b699af136236a8a38c06613d1800fdf54721fe66280b6ae SHA512 03e2ee337445286c14b846cd7545707959b1d351fa466c6292379a85e48ea1a171dae37dd7aff092212239ad59aac6f1ab216ee5de74ef00a8a2a124559e34da WHIRLPOOL 10a4fee34bcc12a730899553d62405784673ee5beecf63a624fb1527c9dddd0403d855a7557f6a35167bffee2b2ebb9f7d3b7ddc64d2e12cc39d95afe89e0db6 DIST libbson-1.3.5.tar.gz 4547720 SHA256 d380cfc30bbb598e64bc5e4b0851f9e8343071292a9e0a101f49ec06211a1b23 SHA512 b55ae1d424f786aabed6567a77cd09aa26c74ab0a09392e88faef8c156b1650c026f86f245bc8431a0ebcf404c4f80eb1b22e978a24289d32692c84375a66596 WHIRLPOOL fb0d2f05e0a8c60da2d3277ec1413799b8e45c23e408fdd136b3ebe4f6e74ed7d58d767792f1d6454bb6e61785f7ae624ff655b94f39ef6007e1f248caf7cad5 +DIST libbson-1.3.6.tar.gz 4546329 SHA256 77b4f41154457d56e5b837a1a770800e96f3c30a67f6e5a439bf336a2124fbb4 SHA512 a7da914ed0f03212d4fb01879543f0b2c7629923e33200fe30335a9a90a1082ffa2566c7a556b90a6c7ffbef5665a45ec67f87ffff2a5fcb89830769b1df5130 WHIRLPOOL b86efef2e3841b66ef425c022c1e60a32d6fd02d3cbc0af22c28ac5f6e6eeabb709aa06a353f2e0ed8af0ebf65da6d660edb09523ec196ac0a5f7006be4d998b diff --git a/dev-libs/libbson/libbson-1.3.6.ebuild b/dev-libs/libbson/libbson-1.3.6.ebuild new file mode 100644 index 000000000000..e326a2d1a2bd --- /dev/null +++ b/dev-libs/libbson/libbson-1.3.6.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools + +DESCRIPTION="A BSON utility library" +HOMEPAGE="https://github.com/mongodb/libbson" +SRC_URI="https://github.com/mongodb/${PN}/releases/download/${PV}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~hppa ~x86" +IUSE="debug examples static-libs" + +DOCS=( AUTHORS NEWS README ) + +src_prepare() { + default_src_prepare + # https://github.com/mongodb/mongo-c-driver/issues/54 + sed -i -e "s/PTHREAD_LIBS/PTHREAD_CFLAGS/g" src/bson/Makefile.am \ + tests/Makefile.am || die + eautoreconf +} + +src_configure() { + econf --disable-hardening \ + --disable-optimizations \ + $(use_enable debug) \ + $(use_enable static-libs static) +} + +src_install() { + default + + if [[ -f "${D}usr/share/doc/${P}/COPYING" ]] ; then + rm "${D}usr/share/doc/${P}/COPYING" || die + fi + + # Installing all the manuals conflicts with man-pages + doman doc/man/bson_*.3 + use static-libs || find "${D}" -name '*.la' -delete + + if use examples; then + insinto /usr/share/${PF}/examples + doins examples/*.c + fi + + einstalldocs +} diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass index 81dcc0066dbd..94883601fc01 100644 --- a/eclass/perl-functions.eclass +++ b/eclass/perl-functions.eclass @@ -318,3 +318,228 @@ perl_doexamples() { # is there a way to undo "docinto" ? } + +# @FUNCTION: perl_has_module +# @USAGE: perl_has_module "Test::Tester" +# @DESCRIPTION: +# Query the installed system Perl to see if a given module is installed. +# This does **not** load the module in question, only anticipates if it *might* load. +# +# This is primarily for the purposes of dependency weakening so that conditional +# behaviour can be triggered without adding dependencies to portage which would confuse +# a dependency resolver. +# +# returns 'true' if the module is available, returns error if the module is not available + +perl_has_module() { + debug-print-function $FUNCNAME "$@" + + [[ $# -gt 0 ]] || die "${FUNCNAME}: No module name provided" + [[ $# -lt 2 ]] || die "${FUNCNAME}: Too many parameters ($#)" + + perl -we 'my $mn = $ARGV[0]; + $mn =~ s{(::|\x{27})}{/}g; + for(@INC){ + next if ref $_; + exit 0 if -r $_ . q[/] . $mn . q[.pm] + } + exit 1' "$@"; +} + +# @FUNCTION: perl_has_module_version +# @USAGE: perl_has_module_version "Test::Tester" "0.017" +# @DESCRIPTION: +# Query the installed system Perl to see if a given module is installed +# and is at least a given version. +# +# This requires more caution to use than perl_has_module as it requires +# loading the module in question to determine version compatibility, +# which can be SLOW, and can have side effects (ie: compilation fails in +# require due to some dependency, resulting in a "Fail") +# +# Also take care to note the module version is a *minimum*, *must* be +# written in upstream versions format and should be a a legal upstream version +# +# returns a true exit code if the module is both available and is at least +# the specified version + +perl_has_module_version() { + debug-print-function $FUNCNAME "$@" + + [[ $# -gt 0 ]] || die "${FUNCNAME}: No module name provided" + [[ $# -gt 1 ]] || die "${FUNCNAME}: No module version provided" + [[ $# -lt 3 ]] || die "${FUNCNAME}: Too many parameters ($#)" + + perl -we 'my $mn = $ARGV[0]; + $mn =~ s{(::|\x{27})}{/}g; + exit ( eval { + require qq[${mn}.pm]; + $ARGV[0]->VERSION($ARGV[1]); + 1 + } ? 0 : 1 )' "$@" +} + +# @FUNCTION: perl_get_module_version +# @USAGE: MODVER=$(perl_get_module_version "Test::Simple") +# @DESCRIPTION: +# Query the installed system perl to report the version of the installed +# module. +# +# Note this should be strictly for diagnostic purposes to the end user, +# and may be of selective use in pkg_info to enhance +# emerge --info reports. +# +# Anything that does version comparisons **must not** use the return value +# from this function +# +# Also note that this **must** at least attempt load the module in +# question as part of its operation, and is subsequently prone to SLOWness. +# +# Return codes return error in both compilation-failure and not-installed cases. + +perl_get_module_version() { + debug-print-function $FUNCNAME "$@" + + [[ $# -gt 0 ]] || die "${FUNCNAME}: No module name provided" + [[ $# -lt 2 ]] || die "${FUNCNAME}: Too many parameters ($#)" + + if ! perl_has_module "$@" ; then + echo "(Not Installed)"; + return 1; + fi + + # Todo: What do we do if require fails? spew to stderr + # or stay silent? + + perl -we 'my $mn = $ARGV[0]; + $mn =~ s{(::|\x{27})}{/}g; + local $@; + eval { require qq[${mn}.pm]; 1 } or do { + print q[(Compilation failed in require)]; + exit 1; + }; + my $stash = \%{ $ARGV[0] . q[::] }; + if ( not exists $stash->{VERSION} ) { + print q[(No VERSION property)]; + exit 0; + } + if ( not defined ${$stash->{VERSION}} ) { + print q[(undef)]; + exit 0; + } + print ${$stash->{VERSION}}; + exit 0; ' "$@" +} + +# @FUNCTION: perl_get_raw_vendorlib +# @USAGE: perl_get_raw_vendorlib +# @DESCRIPTION: +# Convenience function to optimise for a common case without double-handling +# variables everywhere. +# +# Note: Will include EPREFIX where relevant +perl_get_raw_vendorlib() { + debug-print-function $FUNCNAME "$@" + + [[ $# -lt 1 ]] || die "${FUNCNAME}: Too many parameters ($#)" + + perl -MConfig \ + -e'exists $Config{$ARGV[0]} || die qq{No such Config key "$ARGV[0]"}; + print $Config{$ARGV[0]}; + exit 0' -- "installvendorlib" || die "Can't extract installvendorlib from Perl Configuration" +} + +# @FUNCTION: perl_get_vendorlib +# @USAGE: perl_get_vendorlib +# @DESCRIPTION: +# +# Convenience helper for returning Perls' vendor install root +# without EPREFIXing. +perl_get_vendorlib() { + debug-print-function $FUNCNAME "$@" + + [[ $# -lt 1 ]] || die "${FUNCNAME}: Too many parameters ($#)" + + # Requires perl 5.14 for /r attribute of s/// + # Just in case somebody out there is stuck in a time warp: upgrade perl first + perl -M5.014 -MConfig \ + -e'exists $Config{$ARGV[0]} || die qq{No such Config key "$ARGV[0]"}; + print $Config{$ARGV[0]} =~ s{\A\Q$ARGV[1]\E}{}r; + exit 0' -- "installvendorlib" "$EPREFIX" || die "Can't extract installvendorlib from Perl Configuration" +} + +# @FUNCTION: perl_domodule +# @USAGE: perl_domodule [options] <files> +# @DESCRIPTION: +# Installs files in paths where they can be found in the default +# Perl runtime. +# +# Note: Should only be used in src_install or pkg_preinst +# anywhere else will do the wrong thing or die. +# +# The contents of the <files> list are copied into Perls Vendor library path +# as follows: +# @CODE +# # install perl/File.pm as Samba::File +# pushd perl/ +# perl_domodule -C Samba File.pm +# +# # install perl/ recursively under VENDORLIB/Samba/ +# pushd perl/ +# perl_domodule -C Samba -r . +# @CODE +# +# @CODE +# options: +# -C Target/Name +# The subdirectory relative to the Perl VENDOR_LIB +# to install into. +# +# defaults to "" +# -r +# Install directories recursively ( see doins ) +# files: +# list of .pm files to install to VENDORLIB +# @CODE + +perl_domodule() { + local target_prefix="" + local files=() + local doins_opts=() + + local recursive="false" + local target + local file + + while [[ $# -gt 0 ]] ; do + case $1 in + -C|--target-prefix) + [[ -z "${2}" || "${2:0:1}" == "-" ]] && die "${FUNCNAME}: -C|--target-prefix expects an argument, got \"$2\"!" + target_prefix="${2}"; + shift 2;; + -r) + recursive="true" + shift;; + *) + [[ -z "${1}" || "${1:0:1}" == "-" ]] && die "${FUNCNAME}: Unknown argument \"${1}\"!" + files+=( "${1}" ) + shift 1;; + esac + done + + if [[ "true" == $recursive ]]; then + doins_opts+=( "-r" ) + fi + for file in "${files[@]}"; do + [[ -e "${file}" ]] || die "$FUNCNAME: Argument \"${file}\" is not an existing file" + [[ "false" == ${recursive} && -d "${file}" ]] && die "$FUNCNAME: Argument \"${file}\" is a directory ( needs -r parameter )" + done + + target="$(perl_get_vendorlib)" + + # Extend target if target_prefix is set + [[ -z "${target_prefix}" ]] || target="${target%/}/${target_prefix#/}" + + insinto "/${target#/}" + doins "${doins_opts[@]}" "${files[@]}" +} diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass index af5a0c9e3446..a012b16dce92 100644 --- a/eclass/perl-module.eclass +++ b/eclass/perl-module.eclass @@ -85,8 +85,8 @@ case ${EAPI:-0} in ;; esac - if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT}" ]]; then - eerror "GENTOO_DEPEND_ON_PERL_SUBSLOT is banned in EAPI=6. If you don't want a slot operator" + if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" != "yes" ]]; then + eerror "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned in EAPI=6. If you don't want a slot operator" die "set GENTOO_DEPEND_ON_PERL=noslotop instead." fi diff --git a/sci-libs/flann/flann-1.9.1.ebuild b/sci-libs/flann/flann-1.9.1.ebuild index a625b8cdeed0..cc7583379a9b 100644 --- a/sci-libs/flann/flann-1.9.1.ebuild +++ b/sci-libs/flann/flann-1.9.1.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 -inherit cmake-utils cuda toolchain-funcs +inherit cmake-utils cuda flag-o-matic toolchain-funcs DESCRIPTION="Fast approximate nearest neighbor searches in high dimensional spaces" HOMEPAGE="http://www.cs.ubc.ca/research/flann/" @@ -29,13 +29,12 @@ DEPEND="${RDEPEND} # readd dependencies for test suite, # requires multiple ruby dependencies +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp +} + pkg_setup() { - if use openmp; then - if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp ; then - ewarn "OpenMP is not available in your current selected gcc" - die "need openmp capable gcc" - fi - fi + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp } src_prepare() { @@ -56,6 +55,8 @@ src_prepare() { } src_configure() { + append-cxxflags -std=c++11 + # python bindings are split # off into dev-python/pyflann local mycmakeargs=( |