Bug 269506 - [NEW PORT] databases/libmongocrypt
Summary: [NEW PORT] databases/libmongocrypt
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Daniel Engberg
URL: https://github.com/mongodb/libmongocr...
Keywords:
Depends on: 269756
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-12 03:41 UTC by Hiroo Ono
Modified: 2023-03-13 10:06 UTC (History)
1 user (show)

See Also:


Attachments
libmongocrypt 1.6.2 (3.88 KB, patch)
2023-02-12 03:41 UTC, Hiroo Ono
no flags Details | Diff
libmongocrypt 1.7.2 (3.56 KB, patch)
2023-02-22 12:15 UTC, Hiroo Ono
no flags Details | Diff
Patch for libmongocrypt (3.25 KB, patch)
2023-03-01 13:21 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hiroo Ono 2023-02-12 03:41:26 UTC
Created attachment 240101 [details]
libmongocrypt 1.6.2

libmongocrypt is "the companion C library for client side encryption in drivers" used by MongoDB compass https://www.mongodb.com/en-us/products/compass, which will follow this port.
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2023-02-17 17:20:02 UTC
Hi,

Sorry for the delayed review

Why are we importing a rather old version? Upstream is at 1.7.2 [1]

Please try to follow Porters Handbook when it comes to naming variables
PORTVERSION --> DISTVERSION
https://docs.freebsd.org/en/books/porters-handbook/book/#makefile-master_sites-github

Why is cmake:noninja used, does it fail using ninja?

OPTIONS needs to be moved below CMAKE_ARGS

Why is PATCH_STRIP defined?

Add option for SASL or either hardcode it being disabled or enabled

You probably also want to disable BUILD_TESTING if you disable everything else related to testing. Disable ENABLE_ICU to avoid it being pulled in an unclean environment (for people using ports). (looking at 1.7.2)

[1] https://github.com/mongodb/libmongocrypt/releases/tag/1.7.2

Does it pass a run in Poudriere and portlint?

Best regards,
Daniel
Comment 2 Hiroo Ono 2023-02-22 12:15:46 UTC
Created attachment 240326 [details]
libmongocrypt 1.7.2

Sorry to be late. Updated the patch.

changed PORTVERSION to DISTVERSION and updated to 1.7.2. (Upstream released new versions while I was lingering on other ports.)
I could not build with MONGOCRYPT_ENABLE_DECIMAL128 on (FetchContent_something should work but in fact not).
There is no reason for cmake:noninja and PATCH_STRIP, so I changed to cmake and removed PATCH_STRIP.

I cannot find any SASL and ICU dependency in the software. Tried adding LIB_DEPENDS to cyrus-sasl2 and icu, but the resulting libraries did not link them. What links to sasl2 and icu is devel/mongo-c-driver it depends on.
devel/mongo-c-driver needs to add option ICU, so I will file a bug later.

I ignored some warnings from portlint (sorry for that), but it always passes poudriere testport.
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2023-03-01 13:21:03 UTC
Created attachment 240502 [details]
Patch for libmongocrypt

Patch for libmongocrypt
Comment 4 Daniel Engberg freebsd_committer freebsd_triage 2023-03-01 13:21:54 UTC
A bit cleaned up version, passes Poudriere on 12.3 (amd64), 13.1 (i386). Please have a look.
Comment 5 Hiroo Ono 2023-03-05 13:14:27 UTC
(In reply to Daniel Engberg from comment #4)
Thank you. It looks good.
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-03-13 10:03:48 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ba881f8887605215142fbe417bc15a78c823007b

commit ba881f8887605215142fbe417bc15a78c823007b
Author:     Hiroo Ono <hiroo.ono+freebsd@gmail.com>
AuthorDate: 2023-03-13 09:34:06 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-03-13 10:02:55 +0000

    databases/libmongocrypt: New Port: MongoDB companion C library for client side encryption

    MongoDB companion C library for client side encryption

    PR:             269506

 databases/Makefile                      |  1 +
 databases/libmongocrypt/Makefile (new)  | 26 ++++++++++++++++++++++
 databases/libmongocrypt/distinfo (new)  |  3 +++
 databases/libmongocrypt/pkg-descr (new) |  1 +
 databases/libmongocrypt/pkg-plist (new) | 39 +++++++++++++++++++++++++++++++++
 5 files changed, 70 insertions(+)
Comment 7 Daniel Engberg freebsd_committer freebsd_triage 2023-03-13 10:06:42 UTC
Committed, thanks!