summaryrefslogtreecommitdiff
path: root/leveldb/Pkgfile
blob: c2a3c906771126e3dd8cf115e17285a34136f71d (plain)
    1 # Description: A fast and lightweight key/value database library
    2 # URL: https://github.com/google/leveldb
    3 # Maintainer: Danny Rawlins, crux at romster dot me
    4 # Depends on: snappy cmake ninja
    5 
    6 name=leveldb
    7 version=1.23
    8 release=1
    9 source=(https://github.com/google/leveldb/archive/$version/$name-$version.tar.gz
   10 	0001-Allow-leveldbjni-build.patch
   11 	0002-Added-a-DB-SuspendCompations-and-DB-ResumeCompaction.patch
   12 	0003-allow-Get-calls-to-avoid-copies-into-std-string.patch
   13 	0004-bloom_test-failure-on-big-endian-archs.patch
   14 	0005-Restore-soname-versioning-with-CMake-build.patch
   15 	0006-revert-no-rtti.patch)
   16 
   17 build() {
   18 	patch -d $name-$version -p1 -i $SRC/0001-Allow-leveldbjni-build.patch
   19 	patch -d $name-$version -p1 -i $SRC/0002-Added-a-DB-SuspendCompations-and-DB-ResumeCompaction.patch
   20 	patch -d $name-$version -p1 -i $SRC/0003-allow-Get-calls-to-avoid-copies-into-std-string.patch
   21 	patch -d $name-$version -p1 -i $SRC/0004-bloom_test-failure-on-big-endian-archs.patch
   22 	patch -d $name-$version -p1 -i $SRC/0005-Restore-soname-versioning-with-CMake-build.patch
   23 	patch -d $name-$version -p1 -i $SRC/0006-revert-no-rtti.patch
   24 
   25 	cmake -S $name-$version -B build -G Ninja \
   26 		-D CMAKE_INSTALL_PREFIX=/usr \
   27 		-D CMAKE_INSTALL_LIBDIR=lib \
   28 		-D CMAKE_BUILD_TYPE=Release \
   29 		-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
   30 		-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
   31 		-D BUILD_SHARED_LIBS=ON \
   32 		-DLEVELDB_BUILD_TESTS=OFF \
   33 		-DLEVELDB_BUILD_BENCHMARKS=OFF \
   34 		-Wno-dev
   35 
   36 	cmake --build build
   37 	DESTDIR=$PKG cmake --install build
   38 
   39 cat <<- EOF > leveldb.pc
   40 prefix=/usr
   41 exec_prefix=\${prefix}
   42 includedir=\${prefix}/include
   43 libdir=\${exec_prefix}/lib
   44 
   45 Name: ${name}
   46 Description: A fast and lightweight key/value database library
   47 Version: ${version}
   48 Libs: -L\${libdir} -lleveldb
   49 EOF
   50 
   51 	install -Dm644 leveldb.pc $PKG/usr/lib/pkgconfig/leveldb.pc
   52 }

Generated by cgit