pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Import gn
Module Name: pkgsrc-wip
Committed By: kikadf <kikadf.01%gmail.com@localhost>
Pushed By: kikadf
Date: Tue Nov 10 15:34:50 2026 +0100
Changeset: 7fd5fac46185c97e675d667ddc195ff3a6fda70f
Modified Files:
Makefile
Added Files:
gn/DESCR
gn/Makefile
gn/PLIST
gn/distinfo
gn/patches/patch-build_gen.py
gn/patches/patch-src_util_sys__info.cc
Log Message:
Import gn
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=7fd5fac46185c97e675d667ddc195ff3a6fda70f
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 1 +
gn/DESCR | 6 +++++
gn/Makefile | 40 +++++++++++++++++++++++++++++++++
gn/PLIST | 2 ++
gn/distinfo | 7 ++++++
gn/patches/patch-build_gen.py | 17 ++++++++++++++
gn/patches/patch-src_util_sys__info.cc | 41 ++++++++++++++++++++++++++++++++++
7 files changed, 114 insertions(+)
diffs:
diff --git a/Makefile b/Makefile
index a257179c5f..aba172b318 100644
--- a/Makefile
+++ b/Makefile
@@ -1347,6 +1347,7 @@ SUBDIR+= gmpc-lyricsplugin
SUBDIR+= gmrender-resurrect-git
SUBDIR+= gmrun
SUBDIR+= gmsh
+SUBDIR+= gn
SUBDIR+= gn-git
SUBDIR+= gnocchi
SUBDIR+= gnokii
diff --git a/gn/DESCR b/gn/DESCR
new file mode 100644
index 0000000000..d867bb7a4a
--- /dev/null
+++ b/gn/DESCR
@@ -0,0 +1,6 @@
+GN is currently used as the build system for Chromium, Fuchsia,
+and related projects. GN can generate Ninja build files for C, C++,
+Rust, Objective C, and Swift source on most popular platforms.
+Other languages can be compiled using the general action rules
+which are executed by Python or another scripting language
+(Google does this to compile Java and Go).
diff --git a/gn/Makefile b/gn/Makefile
new file mode 100644
index 0000000000..8336f29788
--- /dev/null
+++ b/gn/Makefile
@@ -0,0 +1,40 @@
+# $NetBSD: Makefile,v 1.1 2025/08/31 12:03:34 ryoon Exp $
+
+DISTNAME= gn-20261110
+CATEGORIES= devel
+MASTER_SITES= https://gn.googlesource.com/gn.git/+archive/
+GN_REVISION= 4df39f484f1f49f5c7f6264adc88d27811cb7b00
+DIST_SUBDIR= gn
+DISTFILES= ${GN_REVISION}${EXTRACT_SUFX}
+
+MAINTAINER= kikadf%NetBSD.org@localhost
+HOMEPAGE= https://gn.googlesource.com/gn/
+COMMENT= Meta-build system that generates build files for Ninja
+LICENSE= modified-bsd
+
+REPLACE_PYTHON= build/gen.py
+
+TOOL_DEPENDS+= ninja-build-[0-9]*:../../devel/ninja-build
+
+USE_LANGUAGES= c c++
+
+HAS_CONFIGURE= yes
+CONFIG_SHELL= ${PYTHONBIN}
+CONFIGURE_SCRIPT= build/gen.py
+CONFIGURE_ARGS= --no-last-commit-position
+CONFIGURE_ARGS+= --allow-warnings
+CONFIGURE_ENV+= GN_VERSION=${PKGVERSION_NOREV}
+CONFIGURE_ENV+= GN_REVISION=${GN_REVISION}
+
+EXTRACT_DIR= ${WRKDIR}/${DISTNAME}
+INSTALLATION_DIRS+= bin
+
+do-build:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ninja -j ${_MAKE_JOBS_N} -C out gn
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/out/gn ${DESTDIR}${PREFIX}/bin
+
+
+.include "../../lang/python/tool.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/gn/PLIST b/gn/PLIST
new file mode 100644
index 0000000000..1014c5c89b
--- /dev/null
+++ b/gn/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD$
+bin/gn
diff --git a/gn/distinfo b/gn/distinfo
new file mode 100644
index 0000000000..2912b4ad83
--- /dev/null
+++ b/gn/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2025/08/31 12:03:35 ryoon Exp $
+
+BLAKE2s (gn/4df39f484f1f49f5c7f6264adc88d27811cb7b00.tar.gz) = 102ec5c48dc63e4e98bb244aad203bc4008537687e468b3700b31c17941018ac
+SHA512 (gn/4df39f484f1f49f5c7f6264adc88d27811cb7b00.tar.gz) = 2e45d05cdc9bbf3ccb7646544621e8dc287cee1bd4a78ce41af058fcbf30db656e628bc32aa91ff58bbfd1a0e35477e61f425c297f0456698552d4270d0f803d
+Size (gn/4df39f484f1f49f5c7f6264adc88d27811cb7b00.tar.gz) = 1428089 bytes
+SHA1 (patch-build_gen.py) = 1bc49434134cd41cd0089fe06e244cc3e5e61d1a
+SHA1 (patch-src_util_sys__info.cc) = 878b74aea48d8c95d52b9d0326d83132b7d67a38
diff --git a/gn/patches/patch-build_gen.py b/gn/patches/patch-build_gen.py
new file mode 100644
index 0000000000..0b9b218ebf
--- /dev/null
+++ b/gn/patches/patch-build_gen.py
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* GenerateLastCommitPosition from env
+
+--- build/gen.py.orig 2026-11-10 13:27:31.231719577 +0000
++++ build/gen.py
+@@ -190,8 +190,8 @@ def GenerateLastCommitPosition(host, hea
+ num = mo.group(1)
+ commit_id = mo.group(2)
+ else:
+- num = 0
+- commit_id = "UNKNOWN"
++ num = os.environ['GN_VERSION']
++ commit_id = os.environ['GN_REVISION']
+
+ contents = '''// Generated by build/gen.py.
+
diff --git a/gn/patches/patch-src_util_sys__info.cc b/gn/patches/patch-src_util_sys__info.cc
new file mode 100644
index 0000000000..734dac6c6c
--- /dev/null
+++ b/gn/patches/patch-src_util_sys__info.cc
@@ -0,0 +1,41 @@
+$NetBSD$
+
+* Set the expected arch on NetBSD
+
+--- src/util/sys_info.cc.orig 2026-11-10 09:12:19.540943504 +0000
++++ src/util/sys_info.cc
+@@ -12,6 +12,10 @@
+ #include <unistd.h>
+ #endif
+
++#if defined(OS_NETBSD)
++#include <sys/sysctl.h>
++#endif
++
+ #if defined(OS_MACOSX)
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
+@@ -71,6 +75,23 @@ std::string OperatingSystemArchitecture(
+ }
+ std::string arch(info.machine);
+ std::string os(info.sysname);
++#if defined(OS_NETBSD)
++ char machine_arch[SYS_NMLN];
++ int mib[2] = { CTL_HW, HW_MACHINE_ARCH };
++ size_t len = sizeof(machine_arch);
++ if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), machine_arch, &len, NULL, 0) == 0) {
++ arch = machine_arch;
++ }
++ if (arch.compare(0, 4, "earm") == 0) {
++ arch = "arm";
++ } else if (arch == "aarch64eb") {
++ arch = "aarch64";
++ } else if (arch.compare(0, 6, "mips64") == 0) {
++ arch = "mips64";
++ } else if (arch.compare(0, 5, "mipse") == 0) {
++ arch = "mips";
++ }
++#endif
+ if (arch == "i386" || arch == "i486" || arch == "i586" || arch == "i686") {
+ arch = "x86";
+ } else if (arch == "i86pc") {
Home |
Main Index |
Thread Index |
Old Index