Re: [gentoo-dev] [TINDERBOX] A round with dev-lang/python-exec[-native-symlinks]

2021-01-31 Thread Michał Górny
On Sun, 2021-01-31 at 20:09 +0200, Mart Raudsepp wrote:
> Ühel kenal päeval, T, 29.12.2020 kell 13:33, kirjutas Agostino Sarubbo:
> > On martedì 29 dicembre 2020 13:03:07 CET Michał Górny wrote:
> > > @ago, could you make sure that the tinderbox tells people to read
> > > up
> > > on the tracker?
> > 
> > I added the note.
> > 
> > However the first thing I would to do in reports like this is at
> > least click 
> > on the tracker bug
> 
> It seems like right now I will get a bug about this every time I make
> some sort of a version bump, as that triggers it on the tinderbox.
> 
> That's because most of the packages I touch use meson and have the
> post-install hook written in python with a python3 shebang, while the
> ebuild usually doesn't even inherit any python eclasses, as this is all
> considered handled by meson, and having to go and add python-any-r1
> inherits and python_fix_shebang all over the place would be rather
> awful.

You don't have to add python_fix_shebang.

-- 
Best regards,
Michał Górny





Re: [gentoo-dev] [TINDERBOX] A round with dev-lang/python-exec[-native-symlinks]

2021-01-31 Thread Mart Raudsepp
Ühel kenal päeval, T, 29.12.2020 kell 13:33, kirjutas Agostino Sarubbo:
> On martedì 29 dicembre 2020 13:03:07 CET Michał Górny wrote:
> > @ago, could you make sure that the tinderbox tells people to read
> > up
> > on the tracker?
> 
> I added the note.
> 
> However the first thing I would to do in reports like this is at
> least click 
> on the tracker bug

It seems like right now I will get a bug about this every time I make
some sort of a version bump, as that triggers it on the tinderbox.

That's because most of the packages I touch use meson and have the
post-install hook written in python with a python3 shebang, while the
ebuild usually doesn't even inherit any python eclasses, as this is all
considered handled by meson, and having to go and add python-any-r1
inherits and python_fix_shebang all over the place would be rather
awful.


Mart


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] [RFC] Moving subslot-only virtuals to a separate category to reduce confusion

2021-01-31 Thread Ulrich Mueller
> On Sat, 30 Jan 2021, Michael Orlitzky wrote:

> On Sat, 2021-01-30 at 18:35 +0100, Michał Górny wrote:
>> 
>> To make this SOVERSION-virtual concept more visible and easily
>> distinguishable from regular virtuals, I'd like to propose that we
>> start
>> moving them into a dedicated category.  For example, 'lib-sover'
>> comes
>> to my mind.  While this ofc doesn't guarantee that people will do
>> things
>> right, it will at least make it clear that these packages are
>> somewhat
>> different from regular virtuals and hopefully avoid making wrong
>> assumptions.

> I would go all the way and move (say) the libjpeg provider to media-
> libs/libjpeg.

Either that, or the opposite of it, i.e. move it to something like
virtual/libjpeg-soname to make the intention clear. Whatever we would
choose, I don't think that we need a new category for this.

Also, moving these virtuals out of virtual/ would require updating
several tools. For example, tools must handle empty HOMEPAGE and
LICENSE.

Ulrich


signature.asc
Description: PGP signature


[gentoo-dev] [PATCH] dev-ruby/msgpack: use new extension support

2021-01-31 Thread Hans de Graaff
--- msgpack-1.3.3.ebuild2020-06-13 08:28:00.023541920 +0200
+++ msgpack-1.3.3-r1.ebuild 2021-01-31 09:51:25.856505887 +0100
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -8,7 +8,10 @@
 RUBY_FAKEGEM_RECIPE_TEST="rspec3"
 RUBY_FAKEGEM_EXTRADOC="README.rdoc"
 
-inherit multilib ruby-fakegem
+RUBY_FAKEGEM_EXTENSIONS=(ext/msgpack/extconf.rb)
+RUBY_FAKEGEM_EXTENSION_LIBDIR="lib/msgpack"
+
+inherit ruby-fakegem
 
 DESCRIPTION="Binary-based efficient data interchange format for ruby
binding"
 HOMEPAGE="https://msgpack.org/;
@@ -26,16 +29,3 @@
 
sed -i -e '/git ls-files/d' msgpack.gemspec || die
 }
-
-each_ruby_configure() {
-   ${RUBY} -Cext/${PN} extconf.rb || die "Configuration of
extension failed."
-
-   # rb_num2int is not inlined on 32 bit arches but also not
explicitly
-   # defined, bug 582968
-   sed -i -e 's:-Wl,--no-undefined::' ext/${PN}/Makefile || die
-}
-
-each_ruby_compile() {
-   emake V=1 -Cext/${PN}
-   cp ext/${PN}/msgpack$(get_modname) lib/${PN} || die "Unable to
install msgpack library."
-}


signature.asc
Description: This is a digitally signed message part


[gentoo-dev] [PATCH] ruby-fakegem.eclass: add support for compiled extensions

2021-01-31 Thread Hans de Graaff
Up to now handling of extensions was done in each ebuild that
contained them. This means that handling is often
inconsistent (e.g. not taking multilib's get_modname into account) and
there is a lot of duplicated code in ebuilds.

Furthermore, this also does not install extensions into the special
extensions directory. rubygems itself has been doing this for some
time, and now bundler 2.2.x has started to explicitly check for the
extensions in this directory, making it incompatibly with our previous
way of installing gems.

The new RUBY_FAKEGEM_EXTENSIONS array and
RUBY_FAKEGEM_EXTENSION_LIBDIR options provide support for installing
extensions automatically based on these settings, taking into account
that the extensions also must be part of testing and that it must be
installed properly.

diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index 8ab448765946..f3b3ee02085c 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: ruby-fakegem.eclass
@@ -113,6 +113,20 @@ RUBY_FAKEGEM_BINDIR="${RUBY_FAKEGEM_BINDIR-bin}"
 # get installed. Some gems provide extra files such as version
information,
 # Rails generators, or data that needs to be installed as well.
 
+# @ECLASS-VARIABLE: RUBY_FAKEGEM_EXTENSIONS
+# @DEFAULT_UNSET
+# @DESCRIPTION
+# List of extensions supported by this gem. Each extension is listed
as
+# the configuration script that needs to be run to generate the
+# extension.
+
+# @ECLASS-VARIABLE: RUBY_FAKEGEM_EXTENSION_LIBDIR
+# @DESCRIPTION:
+# The lib directory where extensions are copied directly after they
have
+# been compiled. This is needed to run tests on the code and was the
+# legacy way to install extensions for a long time.
+RUBY_FAKEGEM_EXTENSION_LIBDIR="${RUBY_FAKEGEM_EXTENSION_LIBDIR-lib}"
+
 case "${EAPI:-0}" in
0|1|2|3)
die "Unsupported EAPI=${EAPI} (too old) for ruby-
fakegem.eclass" ;;
@@ -387,6 +401,22 @@ EOF
) || die "Unable to create fakegem wrapper"
 }
 
+# @FUNCTION: each_fakegem_configure
+# @DESCRIPTION:
+# Configure extensions defined in RUBY_FAKEGEM_EXTENSIONS, if any.
+each_fakegem_configure() {
+   for extension in "${RUBY_FAKEGEM_EXTENSIONS[@]}" ; do
+   ${RUBY} -C ${extension%/*} ${extension##*/} || die
+   done
+}
+
+# @FUNCTION: each_ruby_configure
+# @DESCRIPTION:
+# Run each_fakegem_configure for each ruby target
+each_ruby_configure() {
+   each_fakegem_configure
+}
+
 # @FUNCTION: all_fakegem_compile
 # @DESCRIPTION:
 # Build documentation for the package if indicated by the doc USE flag
@@ -408,6 +438,23 @@ all_fakegem_compile() {
fi
 }
 
+# @FUNCTION: each_fakegem_compile
+# @DESCRIPTION:
+# Compile extensions defined in RUBY_FAKEGEM_EXTENSIONS, if any.
+each_fakegem_compile() {
+   for extension in "${RUBY_FAKEGEM_EXTENSIONS[@]}" ; do
+   emake V=1 -C ${extension%/*}
+   cp "${extension%/*}"/*$(get_modname)
"${RUBY_FAKEGEM_EXTENSION_LIBDIR}" || die "Copy of extension into
${RUBY_FAKEGEM_EXTENSION_LIBDIR} failed"
+   done
+}
+
+# @FUNCTION: each_ruby_compile
+# @DESCRIPTION:
+# Run each_fakegem_compile for each ruby target
+each_ruby_compile() {
+   each_fakegem_compile
+}
+
 # @FUNCTION: all_ruby_unpack
 # @DESCRIPTION:
 # Unpack the source archive, including support for unpacking gems.
@@ -506,6 +553,18 @@ each_fakegem_install() {
 
[[ -n ${_gemlibdirs} ]] && \
ruby_fakegem_doins -r ${_gemlibdirs}
+
+   if [[ -n ${RUBY_FAKEGEM_EXTENSIONS} ]] && [
${#RUBY_FAKEGEM_EXTENSIONS[@]} -ge 0 ]; then
+   einfo "installing extensions"
+   local
_extensionsdir="$(ruby_fakegem_gemsdir)/extensions/$(ruby_rbconfig_valu
e 'arch')/$(ruby_rbconfig_value 'ruby_version')/${RUBY_FAKEGEM_NAME}-
${RUBY_FAKEGEM_VERSION}"
+
+   for extension in ${RUBY_FAKEGEM_EXTENSIONS[@]} ; do
+   emake V=1 sitearchdir="${D}/${_extensionsdir}"
-C ${extension%/*} install
+   done
+
+   # Add the marker to indicate that the extensions are
installed
+   touch "${D}${_extensionsdir}/gem.build_complete" || die
+   fi
 }
 
 # @FUNCTION: each_ruby_install


signature.asc
Description: This is a digitally signed message part