roacn-packages/gn/Makefile
github-actions[bot] a566d93191 🎁 Sync 2024-11-23 09:17
2024-11-23 09:17:17 +08:00

71 lines
1.7 KiB
Makefile

# SPDX-License-Identifier: GPL-3.0-only
#
# Copyright (C) 2022 ImmortalWrt.org
include $(TOPDIR)/rules.mk
PKG_NAME:=gn
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gn.googlesource.com/gn.git
PKG_SOURCE_DATE:=2024-11-19
PKG_SOURCE_VERSION:=24e92acb847233a9c0753c12cb82c98fc084e3db
PKG_MIRROR_HASH:=d5b18b91286f0029e262fc548e4d9636c195a45d41c211f321b126040e246d1d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.xz
PKG_LICENSE:=BSD 3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_HOST_ONLY:=1
HOST_BUILD_PARALLEL:=1
ifeq ($(strip $(NINJA)),)
ifneq ($(wildcard $(TOPDIR)/feeds/packages/devel/ninja/ninja.mk),)
HOST_BUILD_DEPENDS:=ninja/host
NINJA = \
MAKEFLAGS="$(MAKE_JOBSERVER)" \
$(STAGING_DIR_HOSTPKG)/bin/ninja \
$(if $(findstring c,$(OPENWRT_VERBOSE)),-v) \
$(if $(MAKE_JOBSERVER),,-j1)
endif
endif
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/gn
SECTION:=devel
CATEGORY:=Development
TITLE:=A meta-build system that generates build files for Ninja
URL:=https://gn.googlesource.com/gn/
BUILDONLY:=1
endef
define Package/gn/description
GN can generate Ninja build files for C, C++, Rust, Objective C,
and Swift source on most popular platforms.
endef
define Host/Configure
$(PYTHON) $(HOST_BUILD_DIR)/build/gen.py \
--no-last-commit-position
endef
define Host/Compile
+$(NINJA) -C $(HOST_BUILD_DIR)/out
endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
$(INSTALL_BIN) $(HOST_BUILD_DIR)/out/gn $(STAGING_DIR_HOSTPKG)/bin/
endef
define Host/Clean
$(RM) $(STAGING_DIR_HOSTPKG)/bin/gn
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,gn))