From 3d100f43e4a111709b55c3f7e50515fa34cbee5e Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Mon, 2 Sep 2019 16:42:45 +0200 Subject: [PATCH] Fix conflicts and relro issues. --- .SRCINFO | 3 ++- PKGBUILD | 16 +++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index 2eda560..84f5e2e 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,12 +1,13 @@ pkgbase = bloaty pkgdesc = a size profiler for binaries pkgver = 1.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/google/bloaty arch = x86_64 license = Apache makedepends = cmake depends = gcc-libs + options = !emptydirs source = https://github.com/google/bloaty/releases/download/v1.0/bloaty-1.0.tar.bz2 sha256sums = e1cf9830ba6c455218fdb50e7a8554ff256da749878acfaf77c032140d7ddde0 diff --git a/PKGBUILD b/PKGBUILD index 5c88705..38f84a2 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,19 +1,23 @@ # Maintainer: Bert Peters pkgname=bloaty pkgver=1.0 -pkgrel=1 +pkgrel=2 pkgdesc="a size profiler for binaries" arch=(x86_64) url="https://github.com/google/bloaty" license=('Apache') -depends=(gcc-libs zlib) +depends=(gcc-libs) makedepends=(cmake) +options=(!emptydirs) source=("https://github.com/google/bloaty/releases/download/v$pkgver/bloaty-$pkgver.tar.bz2") sha256sums=('e1cf9830ba6c455218fdb50e7a8554ff256da749878acfaf77c032140d7ddde0') build() { cd "$pkgname-$pkgver" - cmake -DCMAKE_INSTALL_PREFIX=/usr . + # Bloaty doesn't allow using an empty build type. + # Unfortunately, this breaks RELRO, so we need to fix that + cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_EXE_LINKER_FLAGS_RELEASE="$LDFLAGS" -Wno-dev . make } @@ -26,9 +30,7 @@ build() { package() { cd "$pkgname-$pkgver" make DESTDIR="$pkgdir/" install - # Prevent a conflict with regular protobuf - rm "$pkgdir/usr/bin/protoc"* - # Don't cause conflicts with our static libraries - rm -rf "$pkgdir/usr/"{include,lib64} "$pkgdir/usr/lib/libre2.a" + # Prevent package conflicts + rm -r "$pkgdir/usr/"{include,bin/protoc*,lib64,lib/*.a,lib/pkgconfig/protobuf*,lib/cmake/protobuf} }