• [gentoo-dev] [PATCH] eclass/ruby-fakegem.eclass: depend on virtual/pkgc

    From Hans de Graaff@21:1/5 to All on Fri May 20 09:20:01 2022
    Many C extensions depend on pkgconfig during their configure phase and
    this is easy to mis in the ebuild. Handle this in the eclass instead
    even though the dependency will not be needed for all extensions.

    Closes: https://bugs.gentoo.org/845393
    Signed-off-by: Hans de Graaff <graaff@gentoo.org>
    ---
    eclass/ruby-fakegem.eclass | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
    index 358fff1be753..754b48f82fa9 100644
    --- a/eclass/ruby-fakegem.eclass
    +++ b/eclass/ruby-fakegem.eclass
    @@ -210,6 +210,11 @@ case ${EAPI} in
    ;;
    esac

    +# Many (but not all) extensions use pkgconfig in src_configure.
    +if [ ${#RUBY_FAKEGEM_EXTENSIONS[@]} -ge 1 ]; then
    + BDEPEND+=" virtual/pkgconfig "
    +fi
    +
    # @FUNCTION: ruby_fakegem_gemsdir
    # @RETURN: Returns the gem data directory
    # @DESCRIPTION:
    --
    2.35.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Florian Schmaus@21:1/5 to Hans de Graaff on Fri May 20 10:00:01 2022
    On 20.05.22 09:17, Hans de Graaff wrote:
    Many C extensions depend on pkgconfig during their configure phase and
    this is easy to mis in the ebuild. Handle this in the eclass instead
    even though the dependency will not be needed for all extensions.

    Closes: https://bugs.gentoo.org/845393
    Signed-off-by: Hans de Graaff <graaff@gentoo.org>
    ---
    eclass/ruby-fakegem.eclass | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
    index 358fff1be753..754b48f82fa9 100644
    --- a/eclass/ruby-fakegem.eclass
    +++ b/eclass/ruby-fakegem.eclass
    @@ -210,6 +210,11 @@ case ${EAPI} in
    ;;
    esac

    +# Many (but not all) extensions use pkgconfig in src_configure.
    +if [ ${#RUBY_FAKEGEM_EXTENSIONS[@]} -ge 1 ]; then
    + BDEPEND+=" virtual/pkgconfig "
    +fi
    +

    Not sure if we have a policy on this, but how about using bash's
    extended test syntax, i.e., [[ … ]] (which the eclass already uses in a
    few places).

    - Flow

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Bracht Laumann Jespersen@21:1/5 to All on Fri May 20 09:30:01 2022
    this is easy to mis in the ebuild. Handle this in the eclass instead

    small typo: mis -> miss

    +if [ ${#RUBY_FAKEGEM_EXTENSIONS[@]} -ge 1 ]; then

    shouldn't it be [[ ]] and not [ ] ? Also, just a suggestion, do "-gt 0" instead of "-ge 1"

    -- Thomas

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Fri May 20 11:20:01 2022
    On Fri, 20 May 2022, Florian Schmaus wrote:
    +if [ ${#RUBY_FAKEGEM_EXTENSIONS[@]} -ge 1 ]; then
    + BDEPEND+=" virtual/pkgconfig "
    +fi

    Not sure if we have a policy on this,

    We do. :)

    https://projects.gentoo.org/qa/policy-guide/ebuild-format.html#pg0101
    "Use bash conditions [[ ... ]] rather than POSIX-ish [ ... ] or test
    builtin."

    https://devmanual.gentoo.org/tools-reference/bash/index.html#single-versus-double-brackets-in-bash
    "Important: The [[ ]] form is generally safer than [ ] and should be
    used in all new code."

    but how about using bash's extended test syntax, i.e., [[ … ]] (which
    the eclass already uses in a few places).

    --=-=-Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmKHWtkPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uxe0H/1E3TQNVb24IC29b6zuXO/nt4nb/eE68Jub4 /U1x2ZBf1NvXz3VuxBpaSaTgA99F0QvLDZ+MOGEnSkMD34BISYomL/ChO3kRz9cx 7EhiuqaaPgL23EwmIy6SM9L43Rdn5RXbPDRtjXq44+yqWM21T+qmsa0VHQaITXUc S4wRE3ZCZQBxrn/S/hsyUIG3+xHEc3F7/8bkQgxV4DU+RgTn9RlmTFPlKdvvSdA6 381VCfBBciupRXT8SNDPFqsitMXHCqCoDF8F++f0Cc/Y8GP3Glf90oz1JqjKLaFR D5YzEKfZoLyZxhSfWAuO1Z/Aq2fyiBr//yLVn6yABgs521PH9WU=kbOL
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hans de Graaff@21:1/5 to All on Sun May 22 07:50:01 2022
    On Fri, 2022-05-20 at 09:28 +0200, Thomas Bracht Laumann Jespersen
    wrote:
    this is easy to mis in the ebuild. Handle this in the eclass
    instead

    small typo: mis -> miss

    Fixed.

    +if [ ${#RUBY_FAKEGEM_EXTENSIONS[@]} -ge 1 ]; then

    shouldn't it be [[ ]] and not [ ] ? Also, just a suggestion, do "-gt
    0" instead
    of "-ge 1"

    Yes, that probably indicates the intention a bit better (array not
    empty). Changed.

    Thanks!

    Hans

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEIggVRmJzp0YePtgn2zR/k4ZU+jQFAmKJzhMACgkQ2zR/k4ZU +jTHQgf/eDideFsPqEXYb8vMx/eiuifWZ+NNkV7vIJ5qWEbhAhoZNt9rjL+vGqGb o1Tyo8R3XDN2kGPAdlCsufXY3oisRRca8/yNubrj6QNoOwpxsK6buL5+j4kD+Cc/ deq8D9+cP+f90baNbD3N1G0NRAfibPxTeCtuwunprqsMx0EEnQ0KFjfoItb0r4kn vTWeFsjBPfTePGFSqLtfPPOjbW/gIatGGPYXynR6pinL92r+w7zKs1eDLKHfZIGo 2wkIlLnCDI3MgZaDTV9E87ypV1mczAaDtNd+pEM86VIHvo+Z1Ar/2z7rWKuOwuZn LcVFtlPkL6aNhEhlCjZv8B+p0+KKSA==
    =Obt9
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hans de Graaff@21:1/5 to Ulrich Mueller on Sun May 22 07:50:01 2022
    On Fri, 2022-05-20 at 11:09 +0200, Ulrich Mueller wrote:
    On Fri, 20 May 2022, Florian Schmaus wrote:
    +if [ ${#RUBY_FAKEGEM_EXTENSIONS[@]} -ge 1 ]; then +       BDEPEND+=" virtual/pkgconfig "
    +fi

    Not sure if we have a policy on this,

    We do. :)

    Policy followed in the committed version.

    Hans

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEIggVRmJzp0YePtgn2zR/k4ZU+jQFAmKJzkMACgkQ2zR/k4ZU +jQx/Qf/QKSZXeVY4PC8yaY3e5PzFxDdZz/kz0/xy+bv+FKJgtXS+ES/mjPcV2M0 4KvNGOgfEqO0SdhY0jXiObmUVyQQcLp88WO0+aj3Op1MLlmEZUhfbDIblwFbOj3U SmhRaRiE7Hwv8cH00z4SIgM6ziyUP/hAE1pnC18M/JxqauudbsaFSI7Ch/MgVtrm MIz2KN41rzxFqUPodIcb4BoQSKTt249nJyD73KYQSc8H8Vkzjeqypv59O7VqPPhu 9XTkr6W9uzyjknOwI+HJB9oDCme5/BzYG4eOvk229LEQMwzGeQ65rKAVVoR+NcDS Yqd4Y6SqO3aB/kU9G54aj7rIozhAPA==
    =UEBK
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)