openwrt_helloworld/gn/Makefile
zxlhhyccc 980a48dbe3 gn: bump to latest git HEAD
The wrong escaping mode is used in a few contexts, which results in
failed builds. This is happening in particular to folks whose sources
are inside a directory with a space in it, and whose builds are not
contained within that directory.

Such builds encode the surrounding filesystem structure into the ninja
files, which is unfortunate but unavoidable in some environments. Fix
the escaping mode in this case.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-03-20 19:07:28 +08:00

62 lines
1.4 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:=2023-02-17
PKG_SOURCE_VERSION:=b25a2f8c2d33f02082f0f258350f5e22c0973108
PKG_MIRROR_HASH:=28dcd0c0fe6fe8c459096acd0ff9ff4a982284ca680ff6edc1222dc88dac0b23
PKG_LICENSE:=BSD 3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
ifneq ($(wildcard $(TOPDIR)/feeds/packages/devel/ninja/ninja.mk),)
PKG_BUILD_DEPENDS+= ninja/host
endif
PKG_HOST_ONLY:=1
HOST_BUILD_PARALLEL:=1
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))