summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD59
1 files changed, 32 insertions, 27 deletions
diff --git a/PKGBUILD b/PKGBUILD
index a68c4e5aa8c9..b87bf7699f0b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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}
}
-