From: Peter Seiderer <ps.report@gmx.net>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>,
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: Thu, 20 Jan 2022 22:29:36 +0100 [thread overview]
Message-ID: <20220120222936.6e7b5aba@gmx.net> (raw)
In-Reply-To: <CADvTj4q2AWnzpQbbQHFRUWnKki_uRCcDTOiT7pwRZ4-Ao0o3fw@mail.gmail.com>
Hello James, Yann,
On Wed, 19 Jan 2022 17:42:46 -0700, James Hilliard <james.hilliard1@gmail.com> wrote:
> On Wed, Jan 19, 2022 at 1:45 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> >
> > James, All,
> >
> > On 2022-01-19 01:45 -0700, James Hilliard spake thusly:
> > > The cmake build appears to be missing features such as pkg-config
> > > generation support, switch to the regular makefile based build
> > > which appears to work better.
> >
> > Can't we just fix the CMakeList.txt and submit a patch upstream,
> > instead?
>
> It looked like this had been brought up before and there was some issue that was
> making this difficult to fix with cmake.
> See:
> https://github.com/google/re2/issues/349
>
> >
> > Also, see below...
> >
> > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> > > ---
> > > package/re2/re2.mk | 30 ++++++++++++++++++++++++++----
> > > 1 file changed, 26 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/package/re2/re2.mk b/package/re2/re2.mk
> > > index b562d5d7ef..144c82339f 100644
> > > --- a/package/re2/re2.mk
> > > +++ b/package/re2/re2.mk
> > > @@ -10,8 +10,30 @@ RE2_LICENSE = BSD-3-Clause
> > > RE2_LICENSE_FILES = LICENSE
> > > RE2_INSTALL_STAGING = YES
> > >
> > > -RE2_CONF_OPTS += -DRE2_BUILD_TESTING=OFF
> > > -HOST_RE2_CONF_OPTS += -DRE2_BUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON
> > > +define RE2_BUILD_CMDS
> > > + $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
> > > + -C $(@D)
> > > +endef
> > >
> > > -$(eval $(cmake-package))
> > > -$(eval $(host-cmake-package))
> > > +define RE2_INSTALL_STAGING_CMDS
> > > + $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
> > > + DESTDIR="$(STAGING_DIR)" prefix=/usr -C $(@D) install
> > > +endef
> > > +
> > > +define RE2_INSTALL_TARGET_CMDS
> > > + $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
> > > + DESTDIR="$(TARGET_DIR)" prefix=/usr -C $(@D) install
> >
> > The 'install' target will forcibly build and install static and shared
> > libs:
> >
> > https://github.com/google/re2/blob/main/Makefile#L297
> >
> > 296: .PHONY: install
> > 297: install: static-install shared-install
> >
> > So, this is probably going to not play nicely for builds where a shared
> > build is not possible.
>
> Sent a v2 which should fix this:
> https://patchwork.ozlabs.org/project/buildroot/patch/20220120003827.395469-1-james.hilliard1@gmail.com/
>
> >
> > AFAICS, the cmake-based buildsystem got that one correct, though, so it
> > would be a bit of a shame to regress on that point...
> >
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
> > Regards,
> > Yann E. MORIN.
> >
> > > +endef
> > > +
> > > +define HOST_RE2_BUILD_CMDS
> > > + $(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) \
> > > + -C $(@D)
> > > +endef
> > > +
> > > +define HOST_RE2_INSTALL_CMDS
> > > + $(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) \
> > > + -C $(@D) DESTDIR="$(HOST_DIR)" prefix=/usr install
> > > +endef
> > > +
> > > +$(eval $(generic-package))
> > > +$(eval $(host-generic-package))
> > > --
> > > 2.25.1
> > >
> > > _______________________________________________
> > > buildroot mailing list
> > > buildroot@buildroot.org
> > > https://lists.buildroot.org/mailman/listinfo/buildroot
> >
> > --
> > .-----------------.--------------------.------------------.--------------------.
> > | 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
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-01-20 21:29 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 [this message]
2022-01-20 23:57 ` James Hilliard
2022-01-21 6:58 ` Yann E. MORIN
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=20220120222936.6e7b5aba@gmx.net \
--to=ps.report@gmx.net \
--cc=buildroot@buildroot.org \
--cc=james.hilliard1@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=yann.morin.1998@free.fr \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.