mirror of
				https://gitlab.alpinelinux.org/alpine/aports.git
				synced 2025-10-31 00:12:05 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			91 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			91 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| # Contributor: Russ Webber <russ@rw.id.au>
 | |
| # Maintainer: Russ Webber <russ@rw.id.au>
 | |
| pkgname=mongo-cxx-driver
 | |
| pkgver=3.7.0
 | |
| pkgrel=0
 | |
| pkgdesc="C++ driver for MongoDB"
 | |
| url="http://mongocxx.org/"
 | |
| arch="all"
 | |
| license="Apache-2.0"
 | |
| makedepends="
 | |
| 	cmake
 | |
| 	libbson-dev
 | |
| 	mongo-c-driver-dev
 | |
| 	mongo-c-driver-static
 | |
| 	openssl-dev
 | |
| 	python3
 | |
| 	samurai
 | |
| 	snappy-dev
 | |
| 	zstd-dev
 | |
| 	"
 | |
| subpackages="$pkgname-dev:_dev libbsoncxx libbsoncxx-dev"
 | |
| source="mongo-cxx-driver-$pkgver.tar.gz::https://github.com/mongodb/mongo-cxx-driver/archive/r$pkgver.tar.gz
 | |
| 	no-mongo-tests.patch
 | |
| 	"
 | |
| builddir="$srcdir/mongo-cxx-driver-r$pkgver"
 | |
| 
 | |
| build() {
 | |
| 	if [ "$CBUILD" != "$CHOST" ]; then
 | |
| 		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
 | |
| 	fi
 | |
| 	cmake -B build -G Ninja \
 | |
| 		-DCMAKE_INSTALL_PREFIX=/usr \
 | |
| 		-DCMAKE_INSTALL_LIBDIR=lib \
 | |
| 		-DBUILD_SHARED_LIBS=True \
 | |
| 		-DCMAKE_BUILD_TYPE=None \
 | |
| 		-DCMAKE_CXX_STANDARD=17 \
 | |
| 		-DBSONCXX_POLY_USE_STD=ON \
 | |
| 		-DBUILD_VERSION="$pkgver" \
 | |
| 		$CMAKE_CROSSOPTS
 | |
| 	cmake --build build
 | |
| }
 | |
| 
 | |
| check() {
 | |
| 	# mongo tests require a running server, so they are disabled.
 | |
| 	# libbsoncxx tests are still ran
 | |
| 	ctest --test-dir build --output-on-failure
 | |
| }
 | |
| 
 | |
| package() {
 | |
| 	# abuild can't trace this
 | |
| 	depends="libbsoncxx=$pkgver-r$pkgrel"
 | |
| 	DESTDIR="$pkgdir" cmake --install build
 | |
| 	rm -rf "$pkgdir"/usr/share/mongo-cxx-driver/
 | |
| }
 | |
| 
 | |
| libbsoncxx() {
 | |
| 	pkgdesc="Building, parsing, and iterating BSON documents using C++"
 | |
| 
 | |
| 	amove usr/lib/libbsoncxx.so.*
 | |
| }
 | |
| 
 | |
| _dev() {
 | |
| 	# This should be removed once abuild knows how to search for pkg-config
 | |
| 	# files that are in another subpackage that is also being created alongside
 | |
| 	# this one.
 | |
| 	depends_dev="libbsoncxx-dev=$pkgver-r$pkgrel"
 | |
| 
 | |
| 	default_dev
 | |
| 
 | |
| 	# libbsoncxx pkg-config files
 | |
| 	mkdir -p "$pkgdir"/usr/lib/pkgconfig
 | |
| 	mv "$subpkgdir"/usr/lib/pkgconfig/libbsoncxx.pc "$pkgdir"/usr/lib/pkgconfig
 | |
| 
 | |
| 	# libbsoncxx solink
 | |
| 	mkdir -p "$pkgdir"/usr/lib
 | |
| 	mv "$subpkgdir"/usr/lib/libbsoncxx.so "$pkgdir"/usr/lib
 | |
| 
 | |
| 	# libbsoncxx cmake file
 | |
| 	mkdir -p "$pkgdir"/usr/lib/cmake
 | |
| 	mv "$subpkgdir"/usr/lib/cmake/libbsoncxx-* "$pkgdir"/usr/lib/cmake
 | |
| 
 | |
| 	# libbsoncxx include files
 | |
| 	mkdir -p "$pkgdir"/usr/include
 | |
| 	mv "$subpkgdir"/usr/include/bsoncxx "$pkgdir"/usr/include
 | |
| }
 | |
| 
 | |
| sha512sums="
 | |
| d30404b0201bd211633b167d874406598481c69de85a00034dfde8b6bc38cced59f7b705327c239b16231f9570bfc2bf29659fef9bb18338fcb8af04403169e2  mongo-cxx-driver-3.7.0.tar.gz
 | |
| 18eaace179782c8e59d585def40da2cb941c767484f2739a6714dc1526c62cd8595bfe89545ddfa32e781a618a0f73a53ac3ee9ecdeb86c7b3250bd380b4d276  no-mongo-tests.patch
 | |
| "
 |