diff options
Diffstat (limited to 'gn/MAKEPKG')
| -rw-r--r-- | gn/MAKEPKG | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/gn/MAKEPKG b/gn/MAKEPKG new file mode 100644 index 0000000..ce82d41 --- /dev/null +++ b/gn/MAKEPKG | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | #!/bin/mkpkg | ||
| 2 | # description: GN meta-build system | ||
| 3 | # url: https://gn.googlesource.com/gn | ||
| 4 | # Depends on: python3 ninja clang | ||
| 5 | name=gn | ||
| 6 | version=0.2324 | ||
| 7 | _commit=304bbef6c7e9a86630c12986b99c8654eb7fe648 | ||
| 8 | release=1 | ||
| 9 | source=(https://gn.googlesource.com/gn/+archive/${_commit}.tar.gz) | ||
| 10 | sha256sums=( | ||
| 11 | "63785159210399064a164aaabf2adcaf4289e068c68976cd7bffa3aa9fd14e6b" | ||
| 12 | ) | ||
| 13 | |||
| 14 | build() { | ||
| 15 | cd "$SRC" | ||
| 16 | export CC=clang | ||
| 17 | export CXX=clang++ | ||
| 18 | export AR=llvm-ar | ||
| 19 | export LDFLAGS="-fuse-ld=lld" | ||
| 20 | |||
| 21 | # Gentoo gn-gen-r8: comment out hardcoded -O3/-g, remove -pipe | ||
| 22 | sed -i "/cflags.append('-O3')/s/^/#/; | ||
| 23 | /cflags.append('-g')/s/^/#/; | ||
| 24 | /ldflags.append('-O3')/s/^/#/; | ||
| 25 | /options.no_strip/s/^/#/; | ||
| 26 | /'-pipe',/d; | ||
| 27 | /'-Wno-format',/d; | ||
| 28 | /'-Wno-strict-aliasing',/d" build/gen.py | ||
| 29 | |||
| 30 | # Fix ninja regen loop: the +archive tarball gives all files | ||
| 31 | # identical timestamps. Set them all to the past so gen.py | ||
| 32 | # outputs (build.ninja) will be strictly newer. | ||
| 33 | find . -type f -exec touch -t 200001010000 {} + | ||
| 34 | |||
| 35 | python3 build/gen.py \ | ||
| 36 | --no-last-commit-position \ | ||
| 37 | --no-static-libstdc++ \ | ||
| 38 | --no-strip \ | ||
| 39 | --allow-warnings | ||
| 40 | printf '%s\n' \ | ||
| 41 | '#ifndef OUT_LAST_COMMIT_POSITION_H_' \ | ||
| 42 | '#define OUT_LAST_COMMIT_POSITION_H_' \ | ||
| 43 | '#define LAST_COMMIT_POSITION_NUM 2324' \ | ||
| 44 | "#define LAST_COMMIT_POSITION \"2324 (${_commit})\"" \ | ||
| 45 | '#endif' \ | ||
| 46 | > out/last_commit_position.h | ||
| 47 | |||
| 48 | ninja -C out gn | ||
| 49 | install -Dm755 out/gn "$PKG/usr/bin/gn" | ||
| 50 | } | ||
| 51 | signify() { | ||
| 52 | untrusted comment: public key | ||
| 53 | RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3 | ||
| 54 | } | ||
| 55 | |||
| 56 | # vim: filetype=sh | ||