On Sat, Oct 31, 2026 at 09:19:01AM -0400, Kurt Mosiejczuk wrote:
> On Sat, Oct 31, 2026 at 12:15:30PM +0100, Jeremie Courreges-Anglas wrote:
> > On Fri, Jul 03, 2026 at 05:25:43PM +0100, Stuart Henderson wrote:
> > > On 2026/07/03 18:11, Jeremie Courreges-Anglas wrote:
> > [...]
> > > > Pending some actual migration reports, I'd like to postpone the
> > > > decision of adding @ask-update. Users could probably also benefit
> > > > from a current.html entry, which could very well be enough given the
> > > > availability of mdb_dump-0.9 in the package and the loud MESSAGE.
>
> > > makes sense.
>
> > So far I only got a report from kmos who reported no visible issue,
> > even though I doubt that lwjgl3 is a heavy lmdb user. Therefore I'm
> > heading for just a current.html entry + MESSAGE.
>
> > Here's an updated diff with the following changes:
> > - update to 1.0.2 (and 0.9.36)
> > - move to github since upstream's gitlab refuses me with http 429
> > - keep PORTROACH from sthen since portroach apparently doesn't handle
> > DIST_TUPLE
> > - drop pointless Makefile hunks, we're overriding the variables on the
> > command-line anyway
> > - use the .pc file generated upstream, but tweak its generation
>
> > I'll run a partial bulk but I strongly suspect nothing will break.
> > Upgrade test reports still welcome.
>
> Well, I would definitel like this to go in because now latest lwjgl3
> requires 1.0.x.
>
> ok kmos
Thx for the feedback & ok, Kurt. Here's a tweaked version that
appears needed at least for net/knot. The new SysV semaphores code
path breaks net/knot(-3.6.2, not sure about -3.5.8) with semop(2)
returning EACCES. I don't feel like debugging the root cause so let's
just use the same semaphore implem as previously.
Some tweaks:
- add patch comments
- use mdb_dump -a in test case and MESSAGE
Except for a bogus code pattern in bogofilter fixed yesterday I'm not
aware of any other regression. I will therefore commit this very soon
unless I hear objections. More test reports & oks are still welcome.
Index: Makefile
===================================================================
RCS file: /cvs/ports/databases/lmdb/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- Makefile 14 Sep 2025 16:27:47 -0000 1.18
+++ Makefile 1 Nov 2026 13:44:18 -0000
@@ -1,11 +1,14 @@
COMMENT = Symas Lightning Memory-Mapped Database
-VERSION = 0.9.33
-
-DISTNAME = openldap-LMDB_${VERSION}
+VERSION = 1.0.2
+OVERSION = 0.9.36
+DIST_TUPLE = github LMDB lmdb LMDB_${VERSION} .
+DIST_TUPLE += github LMDB lmdb LMDB_${OVERSION} .
PKGNAME = lmdb-${VERSION}
-SHARED_LIBS += lmdb 0.0 # 0.0
+PORTROACH = site:https://github.com/LMDB/lmdb/archive/
+
+SHARED_LIBS += lmdb 1.0
CATEGORIES = databases
@@ -18,24 +21,35 @@ PERMIT_PACKAGE = Yes
WANTLIB += c pthread
-SITES =
https://git.openldap.org/openldap/openldap/-/archive/LMDB_${VERSION}/
-
DEBUG_PACKAGES = ${BUILD_PACKAGES}
USE_GMAKE = Yes
-MAKE_FLAGS = CC="${CC}" XCFLAGS="${CFLAGS}" \
- SHARED_VERSION_MAJOR=${LIBlmdb_VERSION:R} \
- SHARED_VERSION_MINOR=${LIBlmdb_VERSION:E}
-
-WRKDIST = ${WRKDIR}/openldap-LMDB_${VERSION}/libraries/liblmdb
-
-SUBST_VARS += VERSION
+MAKE_FLAGS = CC="${CC}" OPT="${CFLAGS}" LDL="" \
+ LIBVER=${LIBlmdb_VERSION:R} \
+ ABIVER=${LIBlmdb_VERSION:E} \
+ mandir=${PREFIX}/man
+
+WRKDIST = ${WRKDIR}/lmdb-LMDB_${VERSION}/libraries/liblmdb
+OWRKDIST = ${WRKDIST}/lmdb-0.9
+
+post-extract:
+ mv ${WRKDIR}/lmdb-LMDB_${OVERSION}/libraries/liblmdb ${OWRKDIST}
+
+post-build:
+ cd ${OWRKDIST}; \
+ ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
+ -f ${MAKE_FILE} mdb_dump mtest
+
+post-test:
+ cd ${OWRKDIST}; \
+ mkdir -p testdb testrestore; \
+ ./mtest; \
+ ./mdb_dump -a testdb | ${WRKBUILD}/mdb_load testrestore
-# lmdb.pc: https://bugs.openldap.org/show_bug.cgi?id=10203
post-install:
- ! test -e ${PREFIX}/lib/pkgconfig/lmdb.pc # fail if shipped upstream
- ${SUBST_CMD} -c -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \
- ${FILESDIR}/lmdb.pc.in ${PREFIX}/lib/pkgconfig/lmdb.pc
+ ${INSTALL_DATA} ${WRKBUILD}/lmdb.pc ${PREFIX}/lib/pkgconfig/lmdb.pc
+ ${INSTALL_PROGRAM} ${OWRKDIST}/mdb_dump ${PREFIX}/bin/mdb_dump-0.9
+ ${INSTALL_DATA} ${OWRKDIST}/mdb_dump.1 ${PREFIX}/man/man1/mdb_dump-0.9.1
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/databases/lmdb/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- distinfo 14 Sep 2025 16:27:47 -0000 1.7
+++ distinfo 1 Nov 2026 13:44:18 -0000
@@ -1,2 +1,4 @@
-SHA256 (openldap-LMDB_0.9.33.tar.gz) =
R2gB9SOciMfeYcM5BQKl0Tll7O3vgBBbX7D8uDc9HlM=
-SIZE (openldap-LMDB_0.9.33.tar.gz) = 149281
+SHA256 (LMDB-lmdb-LMDB_0.9.36.tar.gz) =
fVXDy8HvVfmwB2092xbQ2ZltBbnKp8qInOEEMKxne5A=
+SHA256 (LMDB-lmdb-LMDB_1.0.2.tar.gz) =
F+TLjoCHT8zB/299X9ti8CliSWfQAf9AxHwPt6W0LX0=
+SIZE (LMDB-lmdb-LMDB_0.9.36.tar.gz) = 150220
+SIZE (LMDB-lmdb-LMDB_1.0.2.tar.gz) = 179086
Index: files/lmdb.pc.in
===================================================================
RCS file: files/lmdb.pc.in
diff -N files/lmdb.pc.in
--- files/lmdb.pc.in 14 Jul 2025 11:29:55 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-prefix=${TRUEPREFIX}
-exec_prefix=${prefix}
-libdir=${prefix}/lib
-includedir=${prefix}/include
-
-Name: lmdb
-Description: Lightning memory-mapped database: key-value data store
-URL: https://www.symas.com/symas-embedded-database-lmdb
-Version: ${VERSION}
-Libs: -L${libdir} -llmdb
-Libs.private: -lpthread
-Cflags: -I${includedir}
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/databases/lmdb/patches/patch-Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 patch-Makefile
--- patches/patch-Makefile 10 Mar 2022 00:04:05 -0000 1.2
+++ patches/patch-Makefile 1 Nov 2026 13:44:18 -0000
@@ -1,54 +1,27 @@
Index: Makefile
--- Makefile.orig
+++ Makefile
-@@ -18,21 +18,22 @@
- # There may be other macros in mdb.c of interest. You should
- # read mdb.c before changing any of them.
- #
--CC = gcc
-+CC = @CC@
- AR = ar
- W = -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized
- THREADS = -pthread
--OPT = -O2 -g
- CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS)
- LDLIBS =
- SOLIBS =
--SOEXT = .so
--prefix = /usr/local
-+SHARED_VERSION_MAJOR ?= 0
-+SHARED_VERSION_MINOR ?= 0
-+SOEXT = .so.$(SHARED_VERSION_MAJOR).$(SHARED_VERSION_MINOR)
-+prefix = ${LOCALBASE}/
- exec_prefix = $(prefix)
- bindir = $(exec_prefix)/bin
- libdir = $(exec_prefix)/lib
- includedir = $(prefix)/include
--datarootdir = $(prefix)/share
-+datarootdir = $(prefix)
- mandir = $(datarootdir)/man
+@@ -68,11 +68,7 @@ install: $(ILIBS) $(IPROGS) $(IHDRS)
+ mkdir -p $(DESTDIR)$(mandir)/man1
+ for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done
+ for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done
+- for f in $(ILIBS2); do cp $$f $(DESTDIR)$(libdir); \
+- i=`basename -s .$(ABIVER) $$f`; rm -f $(DESTDIR)$(libdir)/$$i; \
+- ln -s $$f $(DESTDIR)$(libdir)/$$i; \
+- i=`basename -s .$(LIBVER) $$i`; rm -f $(DESTDIR)$(libdir)/$$i; \
+- ln -s $$f $(DESTDIR)$(libdir)/$$i; done
++ for f in $(ILIBS2); do cp $$f $(DESTDIR)$(libdir); done
+ for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done
+ for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done
- ########################################################################
-@@ -45,14 +46,14 @@ PROGS = $(IPROGS) mtest mtest2 mtest3 mtest4 mtest5
- all: $(ILIBS) $(PROGS)
+@@ -154,8 +150,8 @@ lmdb.pc: Makefile mdb_stat
+ @echo "URL: https://www.openldap.org" >>$@
+ @LMDB_VERSION=`./mdb_stat -V | sed -e 's/LMDB //' -e 's/:.*//'`; \
+ echo "Version: $$LMDB_VERSION" >>$@
+- @echo "Cflags: $(THREADS) $(XCFLAGS)" >>$@
+- @echo "Libs: -llmdb $(LDL) $(THREADS)" >>$@
++ @echo "Cflags: -I$(includedir) $(THREADS) $(XCFLAGS)" >>$@
++ @echo "Libs: -L$(libdir) -llmdb $(LDL) $(THREADS)" >>$@
- install: $(ILIBS) $(IPROGS) $(IHDRS)
-- mkdir -p $(DESTDIR)$(bindir)
-- mkdir -p $(DESTDIR)$(libdir)
-- mkdir -p $(DESTDIR)$(includedir)
-- mkdir -p $(DESTDIR)$(mandir)/man1
-- for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done
-- for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done
-- for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done
-- for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done
-+ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(bindir)
-+ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(libdir)
-+ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(includedir)
-+ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(mandir)/man1
-+ for f in $(IPROGS); do ${BSD_INSTALL_PROGRAM} $$f $(DESTDIR)$(bindir);
done
-+ for f in $(ILIBS); do ${BSD_INSTALL_DATA} $$f $(DESTDIR)$(libdir); done
-+ for f in $(IHDRS); do ${BSD_INSTALL_DATA} $$f $(DESTDIR)$(includedir);
done
-+ for f in $(IDOCS); do ${BSD_INSTALL_MAN} $$f $(DESTDIR)$(mandir)/man1;
done
-
- clean:
- rm -rf $(PROGS) *.[ao] *.[ls]o *~ testdb
+ COV_FLAGS=-fprofile-arcs -ftest-coverage
+ COV_OBJS=xmdb.o xmidl.o
Index: patches/patch-lmdb-0_9_mdb_c
===================================================================
RCS file: patches/patch-lmdb-0_9_mdb_c
diff -N patches/patch-lmdb-0_9_mdb_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lmdb-0_9_mdb_c 1 Nov 2026 13:44:18 -0000
@@ -0,0 +1,12 @@
+enforce MDB_WRITEMAP, because we have no UBC (Unified Buffer Cache).
+Index: lmdb-0.9/mdb.c
+--- lmdb-0.9/mdb.c.orig
++++ lmdb-0.9/mdb.c
+@@ -5104,6 +5104,7 @@ mdb_env_open(MDB_env *env, const char *path, unsigned
+ /* silently ignore WRITEMAP when we're only getting read access
*/
+ flags &= ~MDB_WRITEMAP;
+ } else {
++ flags |= MDB_WRITEMAP;
+ if (!((env->me_free_pgs = mdb_midl_alloc(MDB_IDL_UM_MAX)) &&
+ (env->me_dirty_list = calloc(MDB_IDL_UM_SIZE,
sizeof(MDB_ID2)))))
+ rc = ENOMEM;
Index: patches/patch-mdb_c
===================================================================
RCS file: /cvs/ports/databases/lmdb/patches/patch-mdb_c,v
retrieving revision 1.11
diff -u -p -r1.11 patch-mdb_c
--- patches/patch-mdb_c 14 Sep 2025 16:27:47 -0000 1.11
+++ patches/patch-mdb_c 1 Nov 2026 13:44:18 -0000
@@ -1,13 +1,35 @@
-enforce MDB_WRITEMAP, because we have no UBC (Unified Buffer Cache).
+- keep using sem_wait(3) instead of semop(2) for mutexes.
+- enforce MDB_WRITEMAP, because we have no UBC (Unified Buffer Cache).
Index: mdb.c
--- mdb.c.orig
+++ mdb.c
-@@ -5055,6 +5055,7 @@ mdb_env_open(MDB_env *env, const char *path, unsigned
+@@ -184,6 +184,12 @@ typedef SSIZE_T ssize_t;
+ # if defined(__APPLE__) && !defined(MDB_USE_ROBUST)
+ # define MDB_USE_POSIX_SEM 1
+ # endif
++# if defined(__OpenBSD__)
++/** On OpenBSD the MDB_USE_SYSV_SEM code path is broken.
++ * semop(2) fails with EACCES.
++ */
++# define MDB_USE_POSIX_SEM 1
++# endif
+ # if !(defined(MDB_USE_POSIX_MUTEX) || defined(MDB_USE_POSIX_SEM))
+ # define MDB_USE_SYSV_SEM 1
+ # endif
+@@ -2333,6 +2339,7 @@ mdb_dlist_free(MDB_txn *txn)
+ #if MDB_RPAGE_CACHE
+ #if defined(MDB_VL32) || ((MDB_RPAGE_CACHE) & 2) /* Always remap */
+ #define MDB_REMAPPING(flags) 1
++#error "MDB_REMAPPING is incompatible with MDB_WRITEMAP"
+ #else
+ #define MDB_REMAPPING(flags) ((flags) & MDB_REMAP_CHUNKS)
+ #endif
+@@ -6310,6 +6317,7 @@ mdb_env_open(MDB_env *env, const char *path, unsigned
/* silently ignore WRITEMAP when we're only getting read access
*/
flags &= ~MDB_WRITEMAP;
} else {
+ flags |= MDB_WRITEMAP;
+ /* WRITEMAP has a dummy element to match dirty_room = 1 */
+ size_t dl_size = (flags & MDB_WRITEMAP) ? 2 : MDB_IDL_UM_SIZE;
if (!((env->me_free_pgs = mdb_midl_alloc(MDB_IDL_UM_MAX)) &&
- (env->me_dirty_list = calloc(MDB_IDL_UM_SIZE,
sizeof(MDB_ID2)))))
- rc = ENOMEM;
Index: pkg/MESSAGE
===================================================================
RCS file: pkg/MESSAGE
diff -N pkg/MESSAGE
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ pkg/MESSAGE 1 Nov 2026 13:44:18 -0000
@@ -0,0 +1,6 @@
+LMDB 1.0 is an incompatible update from LMDB 0.9. Existing databases
+should be converted from the old to the new format using the
+mdb_dump-0.9(1) and mdb_load(1) commands provided in this package:
+
+ mdb_dump-0.9 -a old-db > old-db.txt
+ mdb_load -f old-db.txt new-db
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/databases/lmdb/pkg/PLIST,v
retrieving revision 1.4
diff -u -p -r1.4 PLIST
--- pkg/PLIST 22 Apr 2024 17:50:04 -0000 1.4
+++ pkg/PLIST 1 Nov 2026 13:44:18 -0000
@@ -1,5 +1,7 @@
@bin bin/mdb_copy
+@bin bin/mdb_drop
@bin bin/mdb_dump
+@bin bin/mdb_dump-0.9
@bin bin/mdb_load
@bin bin/mdb_stat
include/lmdb.h
@@ -7,6 +9,8 @@ include/lmdb.h
@lib lib/liblmdb.so.${LIBlmdb_VERSION}
lib/pkgconfig/lmdb.pc
@man man/man1/mdb_copy.1
+@man man/man1/mdb_drop.1
+@man man/man1/mdb_dump-0.9.1
@man man/man1/mdb_dump.1
@man man/man1/mdb_load.1
@man man/man1/mdb_stat.1
--
jca