Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Peter Seiderer <ps.report@gmx.net>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	buildroot <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 1/1] package/re2: switch to generic-package make build
Date: Fri, 21 Jan 2022 07:58:50 +0100	[thread overview]
Message-ID: <20220121065850.GF3252931@scaer> (raw)
In-Reply-To: <CADvTj4rXQO8Kbe0sMA5YJdj6A2R98OELOB5sPD_xriZ_npkaFQ@mail.gmail.com>

James, All,

On 2022-01-20 16:57 -0700, James Hilliard spake thusly:
> On Thu, Jan 20, 2022 at 2:29 PM Peter Seiderer <ps.report@gmx.net> wrote:
> > Or keep the cmake build and do the following to install re2.pc (taken from #349, [1]):
> >
> > --- a/package/re2/re2.mk
> > +++ b/package/re2/re2.mk
> > @@ -9,9 +9,20 @@ RE2_SITE = $(call github,google,re2,$(RE2_VERSION))
> >  RE2_LICENSE = BSD-3-Clause
> >  RE2_LICENSE_FILES = LICENSE
> >  RE2_INSTALL_STAGING = YES
> > +# keep original Makefile (for re2.pc install)
> > +RE2_SUPPORTS_IN_SOURCE_BUILD = NO
> >
> >  RE2_CONF_OPTS += -DRE2_BUILD_TESTING=OFF
> >  HOST_RE2_CONF_OPTS += -DRE2_BUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON
> >
> > +# install re2.pc
> > +define RE2_INSTALL_PKG_CONFIG
> > +       $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR) \
> > +               libdir=/usr/lib includedir=/usr/include \
> > +               common-install
> > +endef
> > +
> > +RE2_POST_INSTALL_STAGING_HOOKS += RE2_INSTALL_PKG_CONFIG
> > +
> >  $(eval $(cmake-package))
> >  $(eval $(host-cmake-package))
> >
> > Regards,
> > Peter
> >
> > [1] https://github.com/macports/macports-ports/pull/9836#issuecomment-807868854
> 
> There's a problem with this approach, the makefile with common-install
> gets overwritten
> by the one generated by cmake if cmake is used.

It currently gets overwritten, because the build is done in-tree, but
What Peter suggests is doing the build out-of-tree, with:
    RE2_SUPPORTS_IN_SOURCE_BUILD = NO

However, I can't say that I am very fond of this option either. Misinx
the two buildsystems looks icky... What bothers me a bit, is that
common-install also installs the headers, not just the re2.pc, so this
could, even if unlikely, conflict with what the cmake-side would do.

But when looking at the various bugs about this issue:

    https://github.com/google/re2/issues/349
     -> https://github.com/google/re2/issues/304#issuecomment-808219200
         -> https://github.com/macports/macports-ports/pull/9836

    re2: change to cmake build to support gprc, which currently needs a
    cmake version of re2 to build. Try to make it work like the previous
    autotools build worked.

So, that last issue, against homebrew, is interesting: it seems that
using the Makefile-based buildsystem is not enough, because it does not
isntall the cmake equivalent of re2.pc, which breaks grpc.

So, whether we keep the cmake build, or switch to the Makefile build, we
would eventually still miss some pieces...

Damn, back to square-one...

So, I think that Peter's proposal is not so un-appealing, in then end.
But then in such situation, I think it would be simpler for us to just
apply something like:

    define RE2_INSTALL_PC
        $(INTALL) -d -m 0644 $(@D)/re2.pc \
            $(STAGING_DIR)/usr/lib/pkgconfig/re2.pc
        $(SED) 's,@includedir@,/usr/include,; s,@libdir@,/usr/lib,' \
            $(STAGING_DIR)/usr/lib/pkgconfig/re2.pc
    endef
    RE2_POST_STAGING_INSTALL_HOOKS += RE2_INSTALL_PC

And be done with it: minimal change to the re2 package, no dual-buildsystem
situation and thus no install conflict on the headers, usual and simple
post-install hook.

Thoughts?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-01-21  6:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19  8:45 [Buildroot] [PATCH 1/1] package/re2: switch to generic-package make build James Hilliard
2022-01-19 20:45 ` Yann E. MORIN
2022-01-20  0:42   ` James Hilliard
2022-01-20 21:29     ` Peter Seiderer
2022-01-20 23:57       ` James Hilliard
2022-01-21  6:58         ` Yann E. MORIN [this message]
2022-01-21  7:41           ` Thomas Petazzoni
2022-01-21  7:59             ` Yann E. MORIN
2022-01-21 13:26               ` Thomas Petazzoni
2022-01-21 21:16                 ` James Hilliard
2022-01-21  9:17           ` James Hilliard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220121065850.GF3252931@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=james.hilliard1@gmail.com \
    --cc=ps.report@gmx.net \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox