summaryrefslogtreecommitdiff
path: root/devel/gn/files/patch-build_gen.py
blob: 8175fefbfe23397eb6581a3da526b9b6380e6d16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- .git/ is missing in archive, so use version from environment

--- build/gen.py.orig	2021-12-21 20:25:21 UTC
+++ build/gen.py
@@ -213,25 +213,16 @@ def main(argv):
 
 
 def GenerateLastCommitPosition(host, header):
-  ROOT_TAG = 'initial-commit'
-  describe_output = subprocess.check_output(
-      ['git', 'describe', 'HEAD', '--match', ROOT_TAG], shell=host.is_windows(),
-      cwd=REPO_ROOT)
-  mo = re.match(ROOT_TAG + '-(\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 = ''
@@ -274,7 +265,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',