- .git/ is missing in archive, so use version from environment

--- build/gen.py.orig	2026-03-17 09:10:16 UTC
+++ build/gen.py
@@ -245,25 +245,16 @@ def GenerateLastCommitPosition(host, header):
   return ret.returncode == 0 and "#define __GNUC__" in ret.stdout and not "#define __clang__" in ret.stdout
 
 def GenerateLastCommitPosition(host, header):
-  ROOT_TAG = 'initial-commit'
-  describe_output = subprocess.check_output(
-      ['git', 'describe', 'HEAD', '--abbrev=12', '--match', ROOT_TAG],
-      shell=host.is_windows(), cwd=REPO_ROOT)
-  mo = re.match(ROOT_TAG + r'-(\d+)-g([0-9a-f]+)', describe_output.decode())
-  if not mo:
-    raise ValueError(
-        'Unexpected output from git describe when generating version header')
-
   contents = '''// Generated by build/gen.py.
 
 #ifndef OUT_LAST_COMMIT_POSITION_H_
 #define OUT_LAST_COMMIT_POSITION_H_
 
 #define LAST_COMMIT_POSITION_NUM %s
-#define LAST_COMMIT_POSITION "%s (%s)"
+#define LAST_COMMIT_POSITION "%s"
 
 #endif  // OUT_LAST_COMMIT_POSITION_H_
-''' % (mo.group(1), mo.group(1), mo.group(2))
+''' % (os.environ['GN_VERSION'], os.environ['GN_VERSION'])
 
   # Only write/touch this file if the commit position has changed.
   old_contents = ''
@@ -306,7 +297,7 @@ def WriteGenericNinja(path, static_libraries, executab
       'msys': 'build_linux.ninja.template',
       'darwin': 'build_mac.ninja.template',
       'linux': 'build_linux.ninja.template',
-      'freebsd': 'build_linux.ninja.template',
+      'freebsd': 'build_openbsd.ninja.template',
       'aix': 'build_aix.ninja.template',
       'openbsd': 'build_openbsd.ninja.template',
       'haiku': 'build_haiku.ninja.template',
