[arch-commits] Commit in leveldb/trunk (2 files)

Dave Reisner dreisner at archlinux.org
Mon Apr 1 22:30:00 UTC 2019


    Date: Monday, April 1, 2019 @ 22:29:59
  Author: dreisner
Revision: 349576

upgpkg: leveldb 1.21-1

- adapt build to use cmake
- backport upstream fix to maintain soname versioning

Added:
  leveldb/trunk/0001-Restore-soname-versioning-with-CMake-build.patch
Modified:
  leveldb/trunk/PKGBUILD

-------------------------------------------------------+
 0001-Restore-soname-versioning-with-CMake-build.patch |   39 +++++++++++++
 PKGBUILD                                              |   45 +++++++++-------
 2 files changed, 66 insertions(+), 18 deletions(-)

Added: 0001-Restore-soname-versioning-with-CMake-build.patch
===================================================================
--- 0001-Restore-soname-versioning-with-CMake-build.patch	                        (rev 0)
+++ 0001-Restore-soname-versioning-with-CMake-build.patch	2019-04-01 22:29:59 UTC (rev 349576)
@@ -0,0 +1,39 @@
+From 37300aa54b8256dd2edfd504942eb2bd20823647 Mon Sep 17 00:00:00 2001
+From: leveldb Team <no-reply at google.com>
+Date: Mon, 1 Apr 2019 08:59:17 -0700
+Subject: [PATCH] Restore soname versioning with CMake build
+
+Before:
+
+$ readelf -d build/libleveldb.so | grep soname
+ 0x000000000000000e (SONAME)             Library soname: [libleveldb.so]
+
+After:
+$ readelf -d build/libleveldb.so | grep soname
+ 0x000000000000000e (SONAME)             Library soname: [libleveldb.so.1]
+
+This matches the soname from v1.20.
+
+PiperOrigin-RevId: 241334113
+---
+ CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e471a2a..ceb5dd9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -233,6 +233,10 @@ if(BUILD_SHARED_LIBS)
+       # Used by include/export.h.
+       LEVELDB_SHARED_LIBRARY
+   )
++  set_target_properties(leveldb
++    PROPERTIES VERSION ${PROJECT_VERSION})
++  set_target_properties(leveldb
++    PROPERTIES SOVERSION 1)
+ endif(BUILD_SHARED_LIBS)
+ 
+ if(HAVE_CLANG_THREAD_SAFETY)
+-- 
+2.21.0
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-04-01 20:54:53 UTC (rev 349575)
+++ PKGBUILD	2019-04-01 22:29:59 UTC (rev 349576)
@@ -2,41 +2,50 @@
 # Contributor: feydaykyn <feydaykyn at yahoo.fr>
 
 pkgname=leveldb
-pkgver=1.20
-pkgrel=2
+pkgver=1.21
+pkgrel=1
 pkgdesc="A fast and lightweight key/value database library"
 arch=('x86_64')
 url="https://github.com/google/leveldb"
 license=('BSD')
 depends=('gperftools' 'snappy')
-makedepends=('git')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/google/leveldb/archive/v$pkgver.tar.gz")
-sha1sums=('df11440c30deed5987263730180225db98de9f57')
+makedepends=('cmake')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/google/leveldb/archive/$pkgver.tar.gz"
+        0001-Restore-soname-versioning-with-CMake-build.patch)
+sha1sums=('56c28f289c965f9ecccfc381b2830ef7fe84f853'
+          '59a4b71a362598c19d01350a79494dd3d59a5133')
 
+prepare() {
+  # upstream commit 37300aa54b8256dd2edfd504942eb2bd20823647
+  patch -Np1 -d $pkgname-$pkgver <0001-Restore-soname-versioning-with-CMake-build.patch
+}
+
 build() {
-  make -C "$pkgname-$pkgver"
+  mkdir "$pkgname-$pkgver/build"
+  cd "$pkgname-$pkgver/build"
+
+  cmake \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DCMAKE_INSTALL_LIBDIR=lib \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DBUILD_SHARED_LIBS=1 \
+    ..
+
+  make
 }
 
 check() {
-  make -C "$pkgname-$pkgver" check
+  make -C "$pkgname-$pkgver/build" test
 }
 
 package() {
   cd "$pkgname-$pkgver"
 
-  install -dm755 \
-      "$pkgdir"/usr/{include/leveldb,lib} \
-      "$pkgdir"/usr/share/doc/"$pkgname"
+  make -C build DESTDIR=$pkgdir install
 
-  # libraries
-  install -m644 -t "$pkgdir/usr/lib" "out-static/libleveldb.a"
-  cp -P out-shared/libleveldb.so* "$pkgdir/usr/lib"
-
-  # headers
-  install -m644 -t "$pkgdir/usr/include/leveldb" include/leveldb/*
-
   # documentation
-  cp -r doc/* "$pkgdir/usr/share/doc/$pkgname"
+  install -dm755 "$pkgdir"/usr/share/doc/"$pkgname"
+  cp -dr --no-preserve=ownership doc/* "$pkgdir/usr/share/doc/$pkgname"
 
   # license
   install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"



More information about the arch-commits mailing list