diff options
author | bartus | 2021-07-17 19:10:38 +0200 |
---|---|---|
committer | bartus | 2021-07-17 19:10:38 +0200 |
commit | b3ea8a9fafe8757d5d97d6133c3e8ed04c4f84db (patch) | |
tree | 72fcd00c93609f9ebe54ad678e5be95ff4e2254b | |
parent | 0f14991ffce17b082b7c4e11b78d90881c357735 (diff) | |
download | aur-b3ea8a9fafe8757d5d97d6133c3e8ed04c4f84db.tar.gz |
Switch to cmake/ninja pipeline
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 59 |
2 files changed, 45 insertions, 32 deletions
@@ -5,19 +5,27 @@ pkgbase = autofdo-git url = https://github.com/google/autofdo arch = x86_64 license = Apache + makedepends = cmake + makedepends = ninja makedepends = git - makedepends = automake - makedepends = libtool makedepends = llvm + makedepends = clang + depends = google-glog + depends = protobuf + depends = libelf + depends = openssl optdepends = llvm: for LLVM support provides = autofdo conflicts = autofdo source = autofdo::git+https://github.com/google/autofdo - source = git://github.com/google/perf_data_converter - source = git://github.com/google/protobuf + source = abseil-cpp::git+https://github.com/abseil/abseil-cpp + source = perf_data_converter::git+https://github.com/google/perf_data_converter + source = glog::git+https://github.com/google/glog + source = googletest::git+https://github.com/google/googletest + md5sums = SKIP + md5sums = SKIP md5sums = SKIP md5sums = SKIP md5sums = SKIP pkgname = autofdo-git - @@ -9,25 +9,30 @@ pkgdesc="a tool to convert perf.data profile to AutoFDO profile that can be used arch=('x86_64') url="https://github.com/google/autofdo" license=('Apache') -depends=() -makedepends=('git' 'automake' 'libtool' 'llvm') +depends=('google-glog' 'protobuf') # common dependencies +depends+=('libelf' 'openssl') # required by GCC variant +makedepends=('cmake' 'ninja' 'git' 'llvm' 'clang') optdepends=('llvm: for LLVM support') provides=("${_pkgname}") conflicts=("${_pkgname}") source=("$_pkgname::git+$url" - "git://github.com/google/perf_data_converter" - "git://github.com/google/protobuf") -md5sums=('SKIP' 'SKIP' 'SKIP') + "abseil-cpp::git+https://github.com/abseil/abseil-cpp" + "perf_data_converter::git+https://github.com/google/perf_data_converter" + "glog::git+https://github.com/google/glog" + "googletest::git+https://github.com/google/googletest" +) +md5sums=('SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP') prepare() { - cd "$srcdir/${_pkgname}" - git submodule init - git config submodule.third_party/perf_data_converter.url $srcdir/perf_data_converter - git config submodule.third_party/protobuf.url $srcdir/protobuf - - # Upstream kept empty directory when they they switched to submodules - rm -rf third_party/perf_data_converter/* - git submodule update --progress + git -C "$srcdir/autofdo" config submodule.third_party/abseil.url "$srcdir/abseil-cpp" + git -C "$srcdir/autofdo" config submodule.third_party/perf_data_converter.url "$srcdir/perf_data_converter" + git -C "$srcdir/autofdo" config submodule.third_party/glog.url "$srcdir/glog" + git -C "$srcdir/autofdo" config submodule.third_party/googletest.url "$srcdir/googletest" + git -C "$srcdir/autofdo" submodule update --init --progress --recursive } pkgver() { @@ -36,21 +41,21 @@ pkgver() { } build() { - cd "$srcdir/${_pkgname}" - - aclocal -I . - autoheader - autoconf - automake --add-missing -c - - ./configure \ - --prefix=/usr \ - --with-llvm=/usr/lib - make +# Note: "-DCMAKE_INSTALL_PREFIX=." must be used, because there is a bug in the basil cmakelist. (check: README.rst) +# Build LLVM variant + cmake -G Ninja -S "$srcdir/${_pkgname}" -B build_with_llvm \ + -DCMAKE_INSTALL_PREFIX=. \ + -DLLVM_PATH=/usr \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ + ninja -C build_with_llvm +# Build GCC variant + cmake -G Ninja -S "$srcdir/${_pkgname}" -B build_without_llvm \ + -DCMAKE_INSTALL_PREFIX=. + ninja -C build_without_llvm } package() { - cd "$srcdir/${_pkgname}" - make DESTDIR="$pkgdir/" install + install -Dm755 -t "$pkgdir"/usr/bin build_with_llvm/{create_llvm_prof,profile_diff,profile_merger,sample_merger} + install -Dm755 -t "$pkgdir"/usr/bin build_without_llvm/{create_gcov,dump_gcov} } - |