Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mongo support #155

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ LEVELDB_VERSION="1c7564468b41610da4f498430e795ca4de0931ff"
LIBXML_VERSION="2.10.1" #2.10.2 requires automake 1.16.3, which isn't easily available on Ubuntu 20.04
LIBPNG_VERSION="1.6.38"
LIBJPEG_VERSION="9e"
LIBMONGOC_VERSION="1.23.2"
OPENSSL_VERSION="1.1.1s"
LIBZIP_VERSION="1.9.2"
SQLITE3_YEAR="2022"
Expand All @@ -24,6 +25,7 @@ EXT_IGBINARY_VERSION="3.2.12"
EXT_CRYPTO_VERSION="0.3.2"
EXT_RECURSIONGUARD_VERSION="0.1.0"
EXT_LIBDEFLATE_VERSION="0.1.0"
EXT_MONGODB_VERSION="1.15.0"
EXT_MORTON_VERSION="0.1.2"
EXT_XXHASH_VERSION="0.1.1"

Expand Down Expand Up @@ -657,6 +659,31 @@ function build_libjpeg {
}


function build_libmongoc {
if [ "$DO_STATIC" == "yes" ]; then
local EXTRA_FLAGS="--enable-shared=no --enable-static=yes"
else
local EXTRA_FLAGS="--enable-shared=yes --enable-static=no"
fi
#libpng
echo -n "[libmongoc] downloading $LIBMONGOC_VERSION..."
download_file "https://github.com/mongodb/mongo-c-driver/releases/download/$LIBMONGOC_VERSION/mongo-c-driver-$LIBMONGOC_VERSION.tar.gz" | tar -zx >> "$DIR/install.log" 2>&1
mv mongo-c-driver-$LIBMONGOC_VERSION libmongoc
echo -n " checking..."
cd libmongoc
cmake . \
-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \
-DCMAKE_PREFIX_PATH="$INSTALL_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
-DCMAKE_INSTALL_LIBDIR=lib >> "$DIR/install.log" 2>&1
echo -n " compiling..."
make -j $THREADS >> "$DIR/install.log" 2>&1
echo -n " installing..."
make install >> "$DIR/install.log" 2>&1
cd ..
echo " done!"
}

function build_libxml2 {
#libxml2
echo -n "[libxml] downloading $LIBXML_VERSION... "
Expand Down Expand Up @@ -789,6 +816,7 @@ else
HAS_LIBJPEG=""
fi

build_libmongoc
build_libxml2
build_libzip
build_sqlite3
Expand Down Expand Up @@ -848,6 +876,8 @@ get_github_extension "chunkutils2" "$EXT_CHUNKUTILS2_VERSION" "pmmp" "ext-chunku

get_github_extension "libdeflate" "$EXT_LIBDEFLATE_VERSION" "pmmp" "ext-libdeflate"

get_pecl_extension "mongodb" "$EXT_MONGODB_VERSION"

get_github_extension "morton" "$EXT_MORTON_VERSION" "pmmp" "ext-morton"

get_github_extension "xxhash" "$EXT_XXHASH_VERSION" "pmmp" "ext-xxhash"
Expand Down Expand Up @@ -937,6 +967,7 @@ RANLIB=$RANLIB CFLAGS="$CFLAGS $FLAGS_LTO" CXXFLAGS="$CXXFLAGS $FLAGS_LTO" LDFLA
--with-openssl \
--with-zip \
--with-libdeflate="$INSTALL_DIR" \
--enable-mongodb \
$HAS_LIBJPEG \
$HAS_GD \
--with-leveldb="$INSTALL_DIR" \
Expand Down