From a1f8300492f0b091142252da3f22dcf3eb3b5840 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 13 Jun 2021 18:28:29 -0700 Subject: [PATCH 1/2] ninja: remove host build. There's tools/ninja now, with jobserver support. Signed-off-by: Rosen Penev --- devel/ninja/Makefile | 30 ++---------------------------- devel/ninja/ninja.mk | 19 ------------------- 2 files changed, 2 insertions(+), 47 deletions(-) delete mode 100644 devel/ninja/ninja.mk diff --git a/devel/ninja/Makefile b/devel/ninja/Makefile index 96181cb87..f2ea423fd 100644 --- a/devel/ninja/Makefile +++ b/devel/ninja/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ninja PKG_VERSION:=1.10.2 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ninja-build/ninja/tar.gz/v$(PKG_VERSION)? @@ -12,38 +12,13 @@ PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=COPYING -PKG_BUILD_DEPENDS:=ninja/host - -include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk -include ./ninja.mk CONFIGURE_ARGS:= ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) CONFIGURE_ARGS+=--verbose endif -define Host/Configure -endef - -define Host/Compile - cd $(HOST_BUILD_DIR) && \ - CXX="$(HOSTCXX)" \ - CXXFLAGS="$(HOST_CXXFLAGS) $(HOST_CPPFLAGS)" \ - LDFLAGS="$(HOST_LDFLAGS)" \ - $(STAGING_DIR_HOST)/bin/$(PYTHON) configure.py --bootstrap $(CONFIGURE_ARGS) -endef - -define Host/Install - $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin - $(INSTALL_BIN) $(HOST_BUILD_DIR)/ninja $(STAGING_DIR_HOSTPKG)/bin/ -endef - -define Host/Clean - $(call Host/Clean/Default) - rm -f $(STAGING_DIR_HOSTPKG)/bin/ninja -endef - define Package/ninja SECTION:=devel CATEGORY:=Development @@ -70,8 +45,7 @@ define Build/Configure endef define Build/Compile - $(call Ninja,-C $(PKG_BUILD_DIR),) + +$(NINJA) -C $(PKG_BUILD_DIR) $(1) endef -$(eval $(call HostBuild)) $(eval $(call BuildPackage,ninja)) diff --git a/devel/ninja/ninja.mk b/devel/ninja/ninja.mk deleted file mode 100644 index 3be870141..000000000 --- a/devel/ninja/ninja.mk +++ /dev/null @@ -1,19 +0,0 @@ -# To execute ninja from you package's Makefile: -# -# include ../../devel/ninja/ninja.mk -# -# define Build/Compile -# $(call Ninja,-C $(MY_NINJA_BUILD_DIR),$(MY_NINJA_ENV_VARS)) -# endef - -HOST_BUILD_DEPENDS += ninja/host -PKG_BUILD_DEPENDS += ninja/host - -NINJA_ARGS:=$(filter -j%,$(filter-out -j,$(MAKEFLAGS))) -ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) - NINJA_ARGS+=-v -endif - -define Ninja - $(2) $(STAGING_DIR_HOSTPKG)/bin/ninja $(NINJA_ARGS) $(1) -endef From 0f790bb09dcb31bc402e70c12009a4dae4e2d9a2 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 13 Jun 2021 18:47:34 -0700 Subject: [PATCH 2/2] meson: use ninja from tools Signed-off-by: Rosen Penev --- devel/meson/Makefile | 2 -- devel/meson/meson.mk | 13 +++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/devel/meson/Makefile b/devel/meson/Makefile index 64b31436b..5a17af5d3 100644 --- a/devel/meson/Makefile +++ b/devel/meson/Makefile @@ -11,8 +11,6 @@ PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=COPYING -HOST_BUILD_DEPENDS:=ninja/host - include ../../lang/python/pypi.mk include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk diff --git a/devel/meson/meson.mk b/devel/meson/meson.mk index 400f2f193..c1fa78d75 100644 --- a/devel/meson/meson.mk +++ b/devel/meson/meson.mk @@ -24,7 +24,8 @@ # MESON_HOST_ARGS+=-Dfoo -Dbar=baz # MESON_HOST_VARS+=FOO=bar -include $(dir $(lastword $(MAKEFILE_LIST)))/../../devel/ninja/ninja.mk +PKG_BUILD_PARALLEL ?= 1 +HOST_BUILD_PARALLEL ?= 1 MESON_DIR:=$(STAGING_DIR_HOSTPKG)/lib/meson @@ -105,15 +106,15 @@ define Host/Configure/Meson endef define Host/Compile/Meson - $(call Ninja,-C $(MESON_HOST_BUILD_DIR),) + +$(NINJA) -C $(MESON_HOST_BUILD_DIR) $(1) endef define Host/Install/Meson - $(call Ninja,-C $(MESON_HOST_BUILD_DIR) install,) + +$(NINJA) -C $(MESON_HOST_BUILD_DIR) install endef define Host/Uninstall/Meson - -$(call Ninja,-C $(MESON_HOST_BUILD_DIR) uninstall,) + +$(NINJA) -C $(MESON_HOST_BUILD_DIR) uninstall endef define Build/Configure/Meson @@ -130,11 +131,11 @@ define Build/Configure/Meson endef define Build/Compile/Meson - $(call Ninja,-C $(MESON_BUILD_DIR),) + +$(NINJA) -C $(MESON_BUILD_DIR) $(1) endef define Build/Install/Meson - $(call Ninja,-C $(MESON_BUILD_DIR) install,DESTDIR="$(PKG_INSTALL_DIR)") + +DESTDIR="$(PKG_INSTALL_DIR)" $(NINJA) -C $(MESON_BUILD_DIR) install endef Host/Configure=$(call Host/Configure/Meson)