2012-12-05 01:47:56 +01:00
|
|
|
# Created by: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
|
2011-10-28 12:54:30 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= leveldb
|
2013-12-11 19:49:13 +01:00
|
|
|
PORTVERSION= 1.15.0
|
2011-10-28 12:54:30 +02:00
|
|
|
CATEGORIES= databases
|
2012-06-16 22:21:57 +02:00
|
|
|
MASTER_SITES= GOOGLE_CODE
|
2011-10-28 12:54:30 +02:00
|
|
|
|
|
|
|
MAINTAINER= sunpoet@FreeBSD.org
|
2013-08-21 19:17:25 +02:00
|
|
|
COMMENT= Fast and lightweight key/value database library by Google
|
2011-10-28 12:54:30 +02:00
|
|
|
|
2013-12-13 01:56:22 +01:00
|
|
|
LICENSE= BSD3CLAUSE
|
2013-11-18 17:51:16 +01:00
|
|
|
|
2012-06-19 15:00:47 +02:00
|
|
|
OPTIONS_DEFINE= GPERFTOOLS SNAPPY
|
|
|
|
OPTIONS_DEFAULT=SNAPPY
|
2011-10-28 12:54:30 +02:00
|
|
|
|
2011-10-28 16:18:06 +02:00
|
|
|
LDFLAGS+= -L${LOCALBASE}/lib
|
2011-10-28 12:54:30 +02:00
|
|
|
USE_LDCONFIG= yes
|
2013-08-21 14:03:51 +02:00
|
|
|
USES= gmake
|
2012-06-16 22:21:57 +02:00
|
|
|
|
|
|
|
PLIST_SUB= SHLIB_MAJOR=${SHLIB_MAJOR} \
|
|
|
|
SHLIB_MINOR=${SHLIB_MINOR}
|
|
|
|
|
|
|
|
NOT_FOR_ARCHS= powerpc
|
|
|
|
NOT_FOR_ARCHS_REASON= not yet ported to this platform
|
|
|
|
|
|
|
|
SHLIB_MAJOR= ${PORTVERSION:R:R}
|
|
|
|
SHLIB_MINOR= ${PORTVERSION:R:E}
|
2011-10-28 12:54:30 +02:00
|
|
|
|
2013-11-18 17:51:16 +01:00
|
|
|
GPERFTOOLS_LIB_DEPENDS= libtcmalloc.so:${PORTSDIR}/devel/google-perftools
|
|
|
|
SNAPPY_LIB_DEPENDS= libsnappy.so:${PORTSDIR}/archivers/snappy
|
2011-10-28 12:54:30 +02:00
|
|
|
|
2013-11-18 17:51:16 +01:00
|
|
|
.include <bsd.port.options.mk>
|
2011-10-28 12:54:30 +02:00
|
|
|
|
2012-06-19 15:00:47 +02:00
|
|
|
.if ${PORT_OPTIONS:MSNAPPY}
|
2012-06-16 22:21:57 +02:00
|
|
|
SNAPPY= 1
|
|
|
|
.else
|
|
|
|
SNAPPY= 0
|
2011-10-28 12:54:30 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
post-patch:
|
2013-08-25 18:03:32 +02:00
|
|
|
@${REINPLACE_CMD} -e 's|-lpthread|-pthread|' ${WRKSRC}/build_detect_platform
|
|
|
|
.if !${PORT_OPTIONS:MGPERFTOOLS}
|
2012-06-16 22:21:57 +02:00
|
|
|
@${REINPLACE_CMD} -e 's| -ltcmalloc||' ${WRKSRC}/build_detect_platform
|
2011-10-28 12:54:30 +02:00
|
|
|
.endif
|
2013-08-25 18:03:32 +02:00
|
|
|
.if !${PORT_OPTIONS:MSNAPPY}
|
2012-06-16 22:21:57 +02:00
|
|
|
@${REINPLACE_CMD} -e 's| -DSNAPPY||; s| -lsnappy||' ${WRKSRC}/build_detect_platform
|
2011-10-28 12:54:30 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
do-install:
|
2013-10-01 18:33:52 +02:00
|
|
|
${MKDIR} ${STAGEDIR}${PREFIX}/include/leveldb/ ${STAGEDIR}${PREFIX}/include/memenv/ ${STAGEDIR}${DATADIR}/
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/include/leveldb/* ${STAGEDIR}${PREFIX}/include/leveldb/
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/helpers/memenv/memenv.h ${STAGEDIR}${PREFIX}/include/memenv/
|
|
|
|
${INSTALL_LIB} ${WRKSRC}/libleveldb.a ${STAGEDIR}${PREFIX}/lib/
|
|
|
|
${INSTALL_LIB} ${WRKSRC}/libleveldb.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${STAGEDIR}${PREFIX}/lib/
|
|
|
|
${INSTALL_LIB} ${WRKSRC}/libmemenv.a ${STAGEDIR}${PREFIX}/lib/
|
|
|
|
${INSTALL_LIB} ${WRKSRC}/libmemenv.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${STAGEDIR}${PREFIX}/lib/
|
2013-12-11 19:49:13 +01:00
|
|
|
${LN} -fs libleveldb.so.${SHLIB_MAJOR} ${STAGEDIR}${PREFIX}/lib/libleveldb.so
|
|
|
|
${LN} -fs libleveldb.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${STAGEDIR}${PREFIX}/lib/libleveldb.so.${SHLIB_MAJOR}
|
|
|
|
${LN} -fs libmemenv.so.${SHLIB_MAJOR} ${STAGEDIR}${PREFIX}/lib/libmemenv.so
|
|
|
|
${LN} -fs libmemenv.so.${SHLIB_MAJOR}.${SHLIB_MINOR} ${STAGEDIR}${PREFIX}/lib/libmemenv.so.${SHLIB_MAJOR}
|
2012-06-16 22:21:57 +02:00
|
|
|
# backward compatibility
|
|
|
|
${ECHO} "SNAPPY=${SNAPPY}" >> ${WRKSRC}/build_config.mk
|
|
|
|
${GREP} '^PLATFORM_CXXFLAGS=' ${WRKSRC}/build_config.mk | ${SED} 's|PLATFORM_CXXFLAGS|PORT_CFLAGS|' >> ${WRKSRC}/build_config.mk
|
|
|
|
${GREP} '^PLATFORM_CXXFLAGS=' ${WRKSRC}/build_config.mk | ${SED} 's|PLATFORM_CXXFLAGS|PLATFORM_CFLAGS|' >> ${WRKSRC}/build_config.mk
|
2013-10-01 18:33:52 +02:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/build_config.mk ${STAGEDIR}${DATADIR}/
|
2011-10-28 12:54:30 +02:00
|
|
|
|
|
|
|
.include <bsd.port.mk>
|