Skip to content

Commit

Permalink
package/re2: switch to generic-package make build
Browse files Browse the repository at this point in the history
The cmake build appears to be missing features, such as pkg-config
generation support which is needed for some packages to find re2, like
qt5webengine.

Upstream is not keen on fixing the CMake-based buildsystem [0]

Instead of patching it on our side, and then have to carry the patch
forever, we switch to the Makefile-based generic buildsystem.

Note that previously some packages like grpc failed when the generic
Makefile was used, because they would not find the cmake-equivalent
of pkg-config, but this is now fixed [1].

[0] google/re2#349
[1] grpc/grpc@45e413d

Signed-off-by: James Hilliard <[email protected]>
[Peter: Reword commit message as suggested by Yann]
Signed-off-by: Peter Korsgaard <[email protected]>
  • Loading branch information
jameshilliard authored and jacmet committed Feb 13, 2022
1 parent 9f22134 commit 9ecf705
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions package/re2/re2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,32 @@ 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) $(if $(BR2_STATIC_LIBS),static)
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) \
$(if $(BR2_STATIC_LIBS),static-install,install)
endef

define RE2_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
DESTDIR="$(TARGET_DIR)" prefix=/usr -C $(@D) \
$(if $(BR2_STATIC_LIBS),static-install,install)
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))

0 comments on commit 9ecf705

Please sign in to comment.