Browse Source

lmdb: add new package

Signed-off-by: Jan Pavlinec <jan.pavlinec@nic.cz>
lilik-openwrt-22.03
Jan Pavlinec 5 years ago
parent
commit
f311ec0161
No known key found for this signature in database GPG Key ID: 60244CCEFB39E584
3 changed files with 132 additions and 0 deletions
  1. +97
    -0
      libs/lmdb/Makefile
  2. +23
    -0
      libs/lmdb/patches/010-fix-makefile.patch
  3. +12
    -0
      libs/lmdb/src/liblmdb.pc

+ 97
- 0
libs/lmdb/Makefile View File

@ -0,0 +1,97 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=lmdb
PKG_VERSION:=0.9.23
PKG_RELEASE:=1
PKG_SOURCE:=LMDB_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/LMDB/lmdb/tar.gz/LMDB_$(PKG_VERSION)?
PKG_HASH:=abf42e91f046787ed642d9eb21812a5c473f3ba5854124484d16eadbe0aa9c81
PKG_BUILD_DIR:=$(BUILD_DIR)/lmdb-LMDB_$(PKG_VERSION)
PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec@nic.cz>
PKG_LICENSE:=OLDAP-2.8
PKG_LICENSE_FILES:=LICENSE
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
MAKE_PATH:=libraries/liblmdb
define Package/lmdb/Default
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Lightning Memory-Mapped Database
URL:=https://symas.com/lmdb/
endef
define Package/lmdb
$(call Package/lmdb/Default)
TITLE+= shared library
endef
define Package/lmdb/description
LMDB is an ultra-fast, ultra-compact key-value
embedded data store developed for the OpenLDAP Project.
endef
define Package/lmdb-utils
$(call Package/lmdb/Default)
TITLE+= utils
MDEPENDS+= lmdb
endef
define Package/lmdb-utils/description
LMDB environment status and copy tool
endef
define Package/lmdb-test
$(call Package/lmdb/Default)
TITLE+= test
MDEPENDS+= lmdb
endef
define Package/lmdb-test/description
LMDB test application
endef
define Build/Prepare
$(call Build/Prepare/Default)
$(SED) 's,%%PKG_VERSION%%,$(PKG_VERSION),g' $(PKG_BUILD_DIR)/liblmdb.pc
endef
define Build/Compile
$(MAKE) -C "$(PKG_BUILD_DIR)/$(MAKE_PATH)/" \
CC="$(TARGET_CC)" \
CFLAGS+="$(TARGET_CFLAGS)" \
LDFLAGS+="$(TARGET_LDFLAGS)" \
FPIC="$(FPIC)"
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/$(MAKE_PATH)/lmdb.h $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/$(MAKE_PATH)/liblmdb.{a,so} $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
$(CP) $(PKG_BUILD_DIR)/liblmdb.pc $(1)/usr/lib/pkgconfig/lmdb.pc
endef
define Package/lmdb/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/local/lib/*.so $(1)/usr/lib
endef
define Package/lmdb-utils/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/mdb_{stat,copy,dump,load} $(1)/usr/bin
endef
define Package/lmdb-test/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(MAKE_PATH)/mtest $(1)/usr/bin
endef
$(eval $(call BuildPackage,lmdb))
$(eval $(call BuildPackage,lmdb-utils))
$(eval $(call BuildPackage,lmdb-test))

+ 23
- 0
libs/lmdb/patches/010-fix-makefile.patch View File

@ -0,0 +1,23 @@
--- a/libraries/liblmdb/Makefile
+++ b/libraries/liblmdb/Makefile
@@ -34,6 +34,7 @@ libdir = $(exec_prefix)/lib
includedir = $(prefix)/include
datarootdir = $(prefix)/share
mandir = $(datarootdir)/man
+FPIC ?= -fPIC
########################################################################
@@ -86,10 +87,10 @@ midl.o: midl.c midl.h
$(CC) $(CFLAGS) $(CPPFLAGS) -c midl.c
mdb.lo: mdb.c lmdb.h midl.h
- $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -c mdb.c -o $@
+ $(CC) $(CFLAGS) $(FPIC) $(CPPFLAGS) -c mdb.c -o $@
midl.lo: midl.c midl.h
- $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -c midl.c -o $@
+ $(CC) $(CFLAGS) $(FPIC) $(CPPFLAGS) -c midl.c -o $@
%: %.o
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@

+ 12
- 0
libs/lmdb/src/liblmdb.pc View File

@ -0,0 +1,12 @@
prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: Lightning Memory-Mapped Database
Description: Lightning Memory-Mapped Database
Version: %%PKG_VERSION%%
Requires:
Libs: -L${libdir} -llmdb
Cflags: -I${includedir}

Loading…
Cancel
Save