[crux-commits] ports/contrib (3.5): gn: initial commit, version 20200520

crux at crux.nu crux at crux.nu
Mon Jun 15 09:56:46 UTC 2020


commit ca9c0b1a37296a8c98babf40c3da8356eb5abb19
Author: Tim Biermann <tbier at posteo.de>
Date:   Mon Jun 15 09:25:35 2020 +0000

    gn: initial commit, version 20200520

diff --git a/gn/.footprint b/gn/.footprint
new file mode 100644
index 000000000..8d7cc4a3a
--- /dev/null
+++ b/gn/.footprint
@@ -0,0 +1,3 @@
+drwxr-xr-x	root/root	usr/
+drwxr-xr-x	root/root	usr/bin/
+-rwxr-xr-x	root/root	usr/bin/gn
diff --git a/gn/.signature b/gn/.signature
new file mode 100644
index 000000000..d7af0d891
--- /dev/null
+++ b/gn/.signature
@@ -0,0 +1,5 @@
+untrusted comment: verify with /etc/ports/contrib.pub
+RWSagIOpLGJF33mDRzMKsaxjc6Llm+OxT0QJoPnoL6zF7AZjKCs8bjzsMBNtUv9cY6/OF6D9GSysTUtPF7ur3UoGMGyS1K5YEAI=
+SHA256 (Pkgfile) = 3eedb437a0525d4c37c512e225e634bfa7acba8ac0ee388e50720189d8ebf8fa
+SHA256 (.footprint) = ebe24248910a2c4d544406fe7277892ed941f4a93079fb8d0c5fb7b2036bba9e
+SHA256 (2c801de70b8ed3c8e404245d61d32a3d61b328d0.tar.gz) = 44d16881cd91276b3d3c57589d4fb7558ee6e2fe559401d389352b14e5fd4770
diff --git a/gn/Pkgfile b/gn/Pkgfile
new file mode 100644
index 000000000..69c1ec161
--- /dev/null
+++ b/gn/Pkgfile
@@ -0,0 +1,30 @@
+# Description: Meta-build system that generates build files for Ninja
+# URL: https://gn.googlesource.com/gn
+# Maintainer: Tim Biermann, tbier at posteo dot de
+# Depends on: python3 ninja clang
+
+name=gn
+version=20200520
+release=1
+source=(https://gn.googlesource.com/gn/+archive/2c801de70b8ed3c8e404245d61d32a3d61b328d0.tar.gz)
+
+build() {
+  #[[ -e /usr/bin/clang && -e /usr/bin/clang++ && -e /usr/bin/lld ]] && export CC=clang CXX=clang++ AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib LDFLAGS+=' -fuse-ld=lld' || echo "Please install clang first"
+  unset CFLAGS
+  #patch -Np1 -i gn-gen-r4.patch
+  #patch -Np1 -i lastcommit.patch
+
+  python3 build/gen.py --no-last-commit-position --no-strip --no-static-libstdc++
+  #python3 build/gen.py --no-last-commit-position --no-strip --no-static-libstdc++
+  export CXXFLAGS=+" -std=c++17"
+  cat >out/last_commit_position.h <<-EOF
+#ifndef OUT_LAST_COMMIT_POSITION_H_
+#define OUT_LAST_COMMIT_POSITION_H_
+#define LAST_COMMIT_POSITION_NUM ${version}
+#define LAST_COMMIT_POSITION "${version}"
+#endif  // OUT_LAST_COMMIT_POSITION_H_
+EOF
+
+  ninja -C out gn
+  install -D out/gn $PKG/usr/bin/gn
+}
diff --git a/gn/foo.patch b/gn/foo.patch
new file mode 100644
index 000000000..eac8883bb
--- /dev/null
+++ b/gn/foo.patch
@@ -0,0 +1,39 @@
+--- build/gen.py.orig	2019-10-24 18:38:23.121474871 +0200
++++ build/gen.py	2019-10-24 18:38:45.849743261 +0200
+@@ -125,35 +125,7 @@
+ 
+ 
+ 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 "%s (%s)"
+-
+-#endif  // OUT_LAST_COMMIT_POSITION_H_
+-''' % (mo.group(1), mo.group(2))
+-
+-  # Only write/touch this file if the commit position has changed.
+-  old_contents = ''
+-  if os.path.isfile(header):
+-    with open(header, 'r') as f:
+-      old_contents = f.read()
+-
+-  if old_contents != contents:
+-    with open(header, 'w') as f:
+-      f.write(contents)
+-
++  return 0
+ 
+ def WriteGenericNinja(path, static_libraries, executables,
+                       cc, cxx, ar, ld, platform, host, options,


More information about the crux-commits mailing list