forked from ports/contrib
31 lines
1.1 KiB
Plaintext
31 lines
1.1 KiB
Plaintext
# 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
|
|
}
|