contrib/gn/Pkgfile

30 lines
1010 B
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://nullvoid.de/crux/distfiles/$name-$version.tar.gz)
# because this ALWAYS changes it's signature! -.-
#https://gn.googlesource.com/gn/+archive/2c801de70b8ed3c8e404245d61d32a3d61b328d0.tar.gz)
build() {
[[ -e /usr/bin/clang && -e /usr/bin/clang++ ]] && export CC=clang CXX=clang++ AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib
unset CFLAGS
/usr/bin/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
}