Skip to content

Commit

Permalink
devel/libbson: Rework port
Browse files Browse the repository at this point in the history
* Use upstream release archive as recommended by Porters Handbook
* Use framework helpers when possible
* Rearrange Makefile to better follow Porters Handbook and easier
  readability
* Don't install unnecessary files in share directory

PR:		269624
Reviewed by:	Krzysztof <ports@bsdserwis.com> (maintainer)
  • Loading branch information
Daniel Engberg authored and Daniel Engberg committed Feb 20, 2023
1 parent e6a7a2d commit 8747537
Show file tree
Hide file tree
Showing 4 changed files with 287 additions and 298 deletions.
41 changes: 21 additions & 20 deletions devel/libbson/Makefile
@@ -1,7 +1,9 @@
PORTNAME= libbson
PORTVERSION= 1.23.2
PORTREVISION= 1
DISTVERSION= 1.23.2
PORTREVISION= 2
CATEGORIES= devel
MASTER_SITES= https://github.com/mongodb/mongo-c-driver/releases/download/${DISTVERSION}/
DISTNAME= mongo-c-driver-${DISTVERSION}

MAINTAINER= ports@bsdserwis.com
COMMENT= BSON utility library
Expand All @@ -10,34 +12,33 @@ WWW= https://github.com/mongodb/mongo-c-driver
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/COPYING

USES= cmake:noninja cpe pkgconfig
USE_GITHUB= yes
USES= cmake cpe pathfix python:env pkgconfig
CPE_VENDOR= mongodb
GH_ACCOUNT= mongodb
GH_PROJECT= mongo-c-driver
USE_LDCONFIG= yes

DOCS_VARS= BUILD_DEPENDS+=sphinx-build:textproc/py-sphinx

PATCH_STRIP= -p1
CFLAGS+= -D__BSD_VISIBLE=1
LDFLAGS+= -pthread
DOCSDIR= ${PREFIX}/share/doc/mongo-c-driver

CMAKE_OFF= BUILD_TESTING \
ENABLE_EXAMPLES \
ENABLE_ICU \
ENABLE_MONGOC \
ENABLE_TESTS \
ENABLE_UNINSTALL \
ENABLE_ZLIB \
ENABLE_ZSTD
CMAKE_ARGS= -DBSON_HAVE_STRINGS_H=0

OPTIONS_DEFINE= DOCS
OPTIONS_DEFAULT=
OPTIONS_SUB= yes

CMAKE_ON= ENABLE_EXAMPLES
CMAKE_OFF= ENABLE_TESTS ENABLE_UNINSTALL
DOCS_CMAKE_ON= -DENABLE_HTML_DOCS=ON -DENABLE_MAN_PAGES=ON
CMAKE_ARGS= -DENABLE_MONGOC=OFF -DENABLE_BSON=ON
CMAKE_ARGS+= -DENABLE_ZLIB=ON -DENABLE_ZSTD=ON
CMAKE_ARGS+= -DBSON_HAVE_STRINGS_H=0
DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>0:textproc/py-sphinx@${PY_FLAVOR}
DOCS_CMAKE_ON= -DENABLE_HTML_DOCS=ON -DENABLE_MAN_PAGES=ON

post-extract:
${ECHO} "${PORTVERSION}" > ${WRKSRC}/VERSION_CURRENT
${ECHO} "${DISTVERSION}" > ${WRKSRC}/VERSION_CURRENT

post-install:
${MV} ${STAGEDIR}${PREFIX}/share/mongo-c-driver \
${STAGEDIR}${PREFIX}/share/libbson
${RM} -r ${STAGEDIR}${PREFIX}/share/mongo-c-driver

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions devel/libbson/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1673237141
SHA256 (mongodb-mongo-c-driver-1.23.2_GH0.tar.gz) = a0f944ba659586d3a0751cdb544876ddf1ae2796efabba02a6af75efd8c61b1a
SIZE (mongodb-mongo-c-driver-1.23.2_GH0.tar.gz) = 6498979
TIMESTAMP = 1676631041
SHA256 (mongo-c-driver-1.23.2.tar.gz) = 123c358827eea07cd76a31c40281bb1c81b6744f6587c96d0cf217be8b1234e3
SIZE (mongo-c-driver-1.23.2.tar.gz) = 7781649
6 changes: 2 additions & 4 deletions devel/libbson/files/patch-CMakeLists.txt
@@ -1,7 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index caaf53499..2dd8cc398 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
--- CMakeLists.txt.orig 2023-01-03 15:52:56 UTC
+++ CMakeLists.txt
@@ -249,7 +249,7 @@ cmake_policy (SET CMP0042 NEW)
# Both _BSD_SOURCE and _DEFAULT_SOURCE are defined for backwards-compatibility with glibc 2.19 and earlier.
# _BSD_SOURCE and _DEFAULT_SOURCE are required by `getpagesize`, `h_errno`, etc.
Expand Down

0 comments on commit 8747537

Please sign in to comment.