ports/devel/llvm-devel/files/gen-Makefile.snapshot.sh
Brooks Davis c2e280e965 Update to a new version (LLVM HEAD is now 9.0.0).
Remove clang headers conflicting with FreeBSD headers.  I'd throught
this was nolonger required, but it seems to still be necessicary in at
least some cases.

Submitted by:	Alfredo Dal'Ava Júnior
Differential Revision:	https://reviews.freebsd.org/D18879
2019-01-19 00:05:09 +00:00

31 lines
780 B
Bash

#!/bin/sh
#
# Simple script to fetch the latest commits via the github API. Requires
# curl and jq. Uses unauthenticated access which is ratelimited to 60
# queries per hour.
get_repo_sha()
{
curl https://api.github.com/repos/llvm-mirror/$1/branches/master | \
jq -r '.commit.sha'
}
cat <<EOF > Makefile.snapshot
# \$FreeBSD\$
#
# Generated file! Do not edit!
#
# Generated by: files/gen-Makefile.snapshot.sh.
#
LLVM_MAJOR= 9
LLVM_RELEASE= \${LLVM_MAJOR}.0.0
SNAPDATE= $(date +%Y%m%d)
LLVM_COMMIT= $(get_repo_sha llvm)
CLANG_COMMIT= $(get_repo_sha clang)
COMPILER_RT_COMMIT= $(get_repo_sha compiler-rt)
EXTRAS_COMMIT= $(get_repo_sha clang-tools-extra)
LLD_COMMIT= $(get_repo_sha lld)
LLDB_COMMIT= $(get_repo_sha lldb)
OPENMP_COMMIT= $(get_repo_sha openmp)
EOF