2019-07-30 16:42:24 +02:00
|
|
|
# Copyright 1999-2019 Gentoo Authors
|
2015-12-04 23:26:21 +01:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2019-07-30 16:42:24 +02:00
|
|
|
EAPI=7
|
|
|
|
|
|
|
|
inherit flag-o-matic multilib-minimal toolchain-funcs
|
2015-12-04 23:26:21 +01:00
|
|
|
|
2015-12-31 10:47:31 +01:00
|
|
|
if [[ ${PV} = "9999" ]] ; then
|
|
|
|
EGIT_REPO_URI="https://github.com/LMDB/lmdb.git"
|
|
|
|
inherit git-r3
|
|
|
|
KEYWORDS=""
|
|
|
|
else
|
2019-07-30 16:42:24 +02:00
|
|
|
SRC_URI="https://github.com/LMDB/lmdb/archive/${MY_P}.tar.gz"
|
|
|
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
|
2015-12-31 10:47:31 +01:00
|
|
|
fi
|
|
|
|
|
2015-12-04 23:26:21 +01:00
|
|
|
DESCRIPTION="An ultra-fast, ultra-compact key-value embedded data store"
|
2019-07-30 16:42:24 +02:00
|
|
|
HOMEPAGE="https://symas.com/lmdb/technical/"
|
2015-12-04 23:26:21 +01:00
|
|
|
|
|
|
|
LICENSE="OPENLDAP"
|
2019-07-30 16:42:24 +02:00
|
|
|
SLOT="0/0.9.24"
|
2015-12-04 23:26:21 +01:00
|
|
|
IUSE="static-libs"
|
|
|
|
|
|
|
|
DEPEND=""
|
2019-07-30 16:42:24 +02:00
|
|
|
RDEPEND=""
|
2015-12-04 23:26:21 +01:00
|
|
|
|
2015-12-31 10:47:31 +01:00
|
|
|
S="${WORKDIR}/${P}/libraries/liblmdb"
|
2015-12-04 23:26:21 +01:00
|
|
|
|
|
|
|
src_prepare() {
|
2019-07-30 16:42:24 +02:00
|
|
|
default
|
|
|
|
if [[ ${CHOST} == *-darwin* && ${CHOST#*-darwin} -lt 10 ]] ; then
|
|
|
|
# posix_memalign isn't available before 10.6, but on OSX
|
|
|
|
# malloc is always aligned for any addressable type
|
|
|
|
sed -i -e '/(__APPLE__)/a#define HAVE_MEMALIGN 1\n#define memalign(X,Y) malloc(X)' mdb.c || die
|
|
|
|
fi
|
|
|
|
multilib_copy_sources
|
|
|
|
}
|
|
|
|
|
|
|
|
multilib_src_configure() {
|
2017-01-25 19:09:23 +01:00
|
|
|
local soname="-Wl,-soname,liblmdb$(get_libname 0)"
|
|
|
|
[[ ${CHOST} == *-darwin* ]] && \
|
|
|
|
soname="-dynamiclib -install_name ${EPREFIX}/usr/$(get_libdir)/liblmdb$(get_libname 0)"
|
2016-11-12 17:23:40 +01:00
|
|
|
sed -i -e "s!^CC.*!CC = $(tc-getCC)!" \
|
|
|
|
-e "s!^CFLAGS.*!CFLAGS = ${CFLAGS}!" \
|
|
|
|
-e "s!^AR.*!AR = $(tc-getAR)!" \
|
2017-01-25 19:09:23 +01:00
|
|
|
-e "s!^SOEXT.*!SOEXT = $(get_libname)!" \
|
2016-11-12 17:23:40 +01:00
|
|
|
-e "/^prefix/s!/usr/local!${EPREFIX}/usr!" \
|
|
|
|
-e "/^libdir/s!lib\$!$(get_libdir)!" \
|
2017-01-25 19:09:23 +01:00
|
|
|
-e "s!shared!shared ${soname}!" \
|
2015-12-04 23:26:21 +01:00
|
|
|
"${S}/Makefile" || die
|
|
|
|
|
2017-12-21 15:11:32 +01:00
|
|
|
if [[ ${CHOST} == *-solaris* ]] ; then
|
|
|
|
# fdatasync lives in -lrt on Solaris 10
|
|
|
|
[[ ${CHOST#*-solaris2.} -le 10 ]] && append-ldflags -lrt
|
2017-01-25 15:11:23 +01:00
|
|
|
fi
|
2015-12-04 23:26:21 +01:00
|
|
|
}
|
|
|
|
|
2019-07-30 16:42:24 +02:00
|
|
|
multilib_src_compile() {
|
2016-11-12 17:23:40 +01:00
|
|
|
emake LDLIBS+=" -pthread"
|
2015-12-04 23:26:21 +01:00
|
|
|
}
|
|
|
|
|
2019-07-30 16:42:24 +02:00
|
|
|
multilib_src_install() {
|
2016-11-12 17:23:40 +01:00
|
|
|
emake DESTDIR="${D}" install
|
2015-12-04 23:26:21 +01:00
|
|
|
|
2019-07-30 16:42:24 +02:00
|
|
|
mv "${ED}"/usr/$(get_libdir)/liblmdb$(get_libname) \
|
|
|
|
"${ED}"/usr/$(get_libdir)/liblmdb$(get_libname 0) || die
|
2017-01-25 19:09:23 +01:00
|
|
|
dosym liblmdb$(get_libname 0) /usr/$(get_libdir)/liblmdb$(get_libname)
|
2015-12-04 23:26:21 +01:00
|
|
|
|
2019-07-30 16:42:24 +02:00
|
|
|
insinto /usr/$(get_libdir)/pkgconfig
|
|
|
|
doins "${FILESDIR}/lmdb.pc"
|
|
|
|
sed -i -e "s!@PACKAGE_VERSION@!${PV}!" \
|
|
|
|
-e "s!@prefix@!${EPREFIX}/usr!g" \
|
|
|
|
-e "s!@libdir@!$(get_libdir)!" \
|
|
|
|
"${ED}"/usr/$(get_libdir)/pkgconfig/lmdb.pc || die
|
|
|
|
|
|
|
|
if ! use static-libs; then
|
|
|
|
rm "${ED}"/usr/$(get_libdir)/liblmdb.a || die
|
|
|
|
fi
|
2015-12-04 23:26:21 +01:00
|
|
|
}
|