Looks like preloading libtcl works. $ LD_PRELOAD=/usr/local/lib/libtcl86.so.1.13 python3.9
import tkinter tcl = tkinter.Tk(useTk=False) tcl.eval('load /usr/local/lib/libdb_tcl.so.6.0');
''
The port doesn't install a pkgIndex.tcl file, so [package require] won't work,
and you really want to simply [package require] things.Here is a patch (also attached in case of mail mangling) that stub-enables both v3 and v4, creates and installs pkgIndex.tcl files, and is a tad less noisy. The v4 test results look good.
The main package needs a REVISION bump? This looks like a really old version of bdb. Stu With both installed:$ for t in 5 6; do for d in '' 4.6 1.0; do echo "puts [package provide Tcl]\\\t[package require Db_tcl $d]\\\t$d" | tclsh8.$t; done; done
8.5.19 4.6 8.5.19 4.6 4.6 8.5.19 1.0 1.0 8.6.13 4.6 8.6.13 4.6 4.6 8.6.13 1.0 1.0 $ python3.9
import tkinter tcl = tkinter.Tk(useTk=False) tcl.eval('package require Db_tcl')
'4.6' $ python3.9
import tkinter tcl = tkinter.Tk(useTk=False) tcl.eval('package require Db_tcl 4.6')
'4.6' $ python3.9
import tkinter tcl = tkinter.Tk(useTk=False) tcl.eval('package require Db_tcl 1.0')
'1.0' Index: Makefile.inc =================================================================== RCS file: /cvs/ports/databases/db/Makefile.inc,v retrieving revision 1.43 diff -u -p -u -p -r1.43 Makefile.inc --- Makefile.inc 11 Mar 2022 18:31:18 -0000 1.43 +++ Makefile.inc 24 Dec 2022 04:34:54 -0000 @@ -46,13 +46,18 @@ WANTLIB-tcl?= RUN_DEPENDS-tcl+= ${MODTCL_RUN_DEPENDS} BUILD_DEPENDS+= ${MODTCL_BUILD_DEPENDS} -CFLAGS+= -I${MODTCL_INCDIR} CONFIGURE_ARGS+=--enable-tcl \ --with-tcl=${MODTCL_LIBDIR} # this compiles slightly different code, some tests fail nevertheless #CONFIGURE_ARGS+=--enable-test +. if ${REV:M3}+MAKE_FLAGS += TCFLAGS='-I${MODTCL_INCDIR} -DUSE_TCL_STUBS=1 -DTCL_NO_DEPRECATED=1'
+. endif + +DB_TCL_INST_DIR = ${DESTDIR}${MODTCL_TCLDIR}/db_v${REV} + do-test:@cd ${WRKBUILD}; env PATH=${PORTPATH} ${MODTCL_BIN} ${FILESDIR}/regress.tcl
@@ -78,4 +83,8 @@ post-install: ${PREFIX}/share/examples/db${DEST_SUBDIR} cd ${WRKSRC}/examples_cxx; ${INSTALL_DATA} *.cpp \ ${PREFIX}/share/examples/db${DEST_SUBDIR} - +.if ${BUILD_PACKAGES:M-tcl} + ${INSTALL_DATA_DIR} ${DB_TCL_INST_DIR}+ echo 'package ifneeded Db_tcl ${DB_TCL_VER} [list load [file join $$dir .. .. libdb_tcl.so.${LIBdb_tcl_VERSION}]]' \
+ > ${DB_TCL_INST_DIR}/pkgIndex.tcl +.endif Index: v3/Makefile =================================================================== RCS file: /cvs/ports/databases/db/v3/Makefile,v retrieving revision 1.34 diff -u -p -u -p -r1.34 Makefile --- v3/Makefile 11 Mar 2022 18:31:18 -0000 1.34 +++ v3/Makefile 24 Dec 2022 04:34:54 -0000 @@ -1,10 +1,11 @@ REV= 3 DBLIBDIR= lib/db +DB_TCL_VER= 1.0 VERSION= ${REV}.1.17 EPOCH= 0 REVISION-main = 3 -REVISION-tcl = 2 +REVISION-tcl = 3 SHARED_LIBS += db 3.1 # .0.0 SHARED_LIBS += db_cxx 4.0 # .0.0 @@ -18,8 +19,6 @@ CONFIGURE_STYLE=gnu dest DEST_SUBDIR= WANTLIB=c -WANTLIB-tcl = m ${MODTCL_WANTLIB} -LIB_DEPENDS-tcl = ${MODTCL_LIB_DEPENDS} RUN_DEPENDS-tcl = ${BUILD_PKGPATH} pre-configure: Index: v3/patches/patch-dist_configure =================================================================== RCS file: /cvs/ports/databases/db/v3/patches/patch-dist_configure,v retrieving revision 1.6 diff -u -p -u -p -r1.6 patch-dist_configure --- v3/patches/patch-dist_configure 11 Mar 2022 18:31:18 -0000 1.6 +++ v3/patches/patch-dist_configure 24 Dec 2022 04:34:54 -0000 @@ -1,5 +1,6 @@ ---- dist/configure.orig Mon Jul 31 18:58:18 2000 -+++ dist/configure Thu Oct 28 12:28:52 2010 +Index: dist/configure +--- dist/configure.orig ++++ dist/configure @@ -728,7 +728,7 @@ echo "$ac_t""no" 1>&6 @@ -36,7 +37,7 @@ fi - LIBS="$LIBS $TCL_LIB_SPEC $TCL_LIBS" -+ LIBTSO_LIBS="$TCL_LIB_SPEC $TCL_LIBS" ++ LIBTSO_LIBS="$TCL_STUB_LIB_SPEC" ADDITIONAL_LIBS="$ADDITIONAL_LIBS \$(libtso_target)" DEFAULT_INSTALL="${DEFAULT_INSTALL} install_tcl" Index: v3/patches/patch-tcl_tcl_db_pkg_c =================================================================== RCS file: /cvs/ports/databases/db/v3/patches/patch-tcl_tcl_db_pkg_c,v retrieving revision 1.3 diff -u -p -u -p -r1.3 patch-tcl_tcl_db_pkg_c --- v3/patches/patch-tcl_tcl_db_pkg_c 11 Mar 2022 18:31:18 -0000 1.3 +++ v3/patches/patch-tcl_tcl_db_pkg_c 24 Dec 2022 04:34:54 -0000 @@ -11,7 +11,17 @@ Index: tcl/tcl_db_pkg.c /* * Prototypes for procedures defined later in this file: */ -@@ -162,7 +165,7 @@ berkdb_Cmd(notused, interp, objc, objv) +@@ -55,6 +58,9 @@ Db_tcl_Init(interp) + { + int code; + ++ if (Tcl_InitStubs(interp, "8.5", 0) == NULL) ++ return TCL_ERROR; ++ + code = Tcl_PkgProvide(interp, "Db_tcl", "1.0"); + if (code != TCL_OK) + return (code); +@@ -162,7 +168,7 @@ berkdb_Cmd(notused, interp, objc, objv) * defined above. */ if (Tcl_GetIndexFromObj(interp, @@ -20,7 +30,7 @@ Index: tcl/tcl_db_pkg.c return (IS_HELP(objv[1])); res = NULL; switch ((enum berkdbcmds)cmdindex) { -@@ -421,7 +424,7 @@ bdb_EnvOpen(interp, objc, objv, ip, env) +@@ -421,7 +427,7 @@ bdb_EnvOpen(interp, objc, objv, ip, env) server_to = client_to = 0; i = 2; while (i < objc) { @@ -29,7 +39,7 @@ Index: tcl/tcl_db_pkg.c TCL_EXACT, &optindex) != TCL_OK) { Tcl_ResetResult(interp); continue; -@@ -489,7 +492,7 @@ bdb_EnvOpen(interp, objc, objv, ip, env) +@@ -489,7 +495,7 @@ bdb_EnvOpen(interp, objc, objv, ip, env) */ i = 2; while (i < objc) { @@ -38,7 +48,7 @@ Index: tcl/tcl_db_pkg.c TCL_EXACT, &optindex) != TCL_OK) { result = IS_HELP(objv[i]); goto error; -@@ -813,7 +816,7 @@ bdb_EnvOpen(interp, objc, objv, ip, env) +@@ -813,7 +819,7 @@ bdb_EnvOpen(interp, objc, objv, ip, env) result = TCL_ERROR; break; } @@ -47,7 +57,7 @@ Index: tcl/tcl_db_pkg.c if (result == TCL_OK) { _debug_check(); ret = (*env)->set_tx_timestamp(*env, &time); -@@ -1079,7 +1082,7 @@ bdb_DbOpen(interp, objc, objv, ip, dbp) +@@ -1079,7 +1085,7 @@ bdb_DbOpen(interp, objc, objv, ip, dbp) */ i = 2; while (i < objc) { @@ -56,7 +66,7 @@ Index: tcl/tcl_db_pkg.c "option", TCL_EXACT, &optindex) != TCL_OK) { /* * Reset the result so we don't get -@@ -1139,7 +1142,7 @@ bdb_DbOpen(interp, objc, objv, ip, dbp) +@@ -1139,7 +1145,7 @@ bdb_DbOpen(interp, objc, objv, ip, dbp) */ i = 2; while (i < objc) { @@ -65,7 +75,7 @@ Index: tcl/tcl_db_pkg.c TCL_EXACT, &optindex) != TCL_OK) { arg = Tcl_GetStringFromObj(objv[i], NULL); if (arg[0] == '-') { -@@ -1596,7 +1599,7 @@ bdb_DbRemove(interp, objc, objv) +@@ -1596,7 +1602,7 @@ bdb_DbRemove(interp, objc, objv) */ i = 2; while (i < objc) { @@ -74,7 +84,7 @@ Index: tcl/tcl_db_pkg.c "option", TCL_EXACT, &optindex) != TCL_OK) { arg = Tcl_GetStringFromObj(objv[i], NULL); if (arg[0] == '-') { -@@ -1721,7 +1724,7 @@ bdb_DbRename(interp, objc, objv) +@@ -1721,7 +1727,7 @@ bdb_DbRename(interp, objc, objv) */ i = 2; while (i < objc) { @@ -83,7 +93,7 @@ Index: tcl/tcl_db_pkg.c "option", TCL_EXACT, &optindex) != TCL_OK) { arg = Tcl_GetStringFromObj(objv[i], NULL); if (arg[0] == '-') { -@@ -1860,7 +1863,7 @@ bdb_DbVerify(interp, objc, objv) +@@ -1860,7 +1866,7 @@ bdb_DbVerify(interp, objc, objv) */ i = 2; while (i < objc) { @@ -92,7 +102,7 @@ Index: tcl/tcl_db_pkg.c "option", TCL_EXACT, &optindex) != TCL_OK) { arg = Tcl_GetStringFromObj(objv[i], NULL); if (arg[0] == '-') { -@@ -1999,7 +2002,7 @@ bdb_Version(interp, objc, objv) +@@ -1999,7 +2005,7 @@ bdb_Version(interp, objc, objv) */ i = 2; while (i < objc) { @@ -101,7 +111,7 @@ Index: tcl/tcl_db_pkg.c "option", TCL_EXACT, &optindex) != TCL_OK) { arg = Tcl_GetStringFromObj(objv[i], NULL); if (arg[0] == '-') { -@@ -2108,7 +2111,7 @@ bdb_DbUpgrade(interp, objc, objv) +@@ -2108,7 +2114,7 @@ bdb_DbUpgrade(interp, objc, objv) i = 2; while (i < objc) { Index: v3/pkg/PLIST-main =================================================================== RCS file: /cvs/ports/databases/db/v3/pkg/PLIST-main,v retrieving revision 1.5 diff -u -p -u -p -r1.5 PLIST-main --- v3/pkg/PLIST-main 11 Mar 2022 18:31:18 -0000 1.5 +++ v3/pkg/PLIST-main 24 Dec 2022 04:34:54 -0000 @@ -19,12 +19,12 @@ include/db/db.h include/db/db_185.h include/db/db_cxx.h lib/db/ -lib/db/libdb.a +@static-lib lib/db/libdb.a lib/db/libdb.la @comment lib/db/libdb.so @comment lib/db/libdb.so.3 @lib lib/db/libdb.so.${LIBdb_VERSION} -lib/db/libdb_cxx.a +@static-lib lib/db/libdb_cxx.a lib/db/libdb_cxx.la @comment lib/db/libdb_cxx.so @comment lib/db/libdb_cxx.so.3 Index: v3/pkg/PLIST-tcl =================================================================== RCS file: /cvs/ports/databases/db/v3/pkg/PLIST-tcl,v retrieving revision 1.5 diff -u -p -u -p -r1.5 PLIST-tcl --- v3/pkg/PLIST-tcl 11 Mar 2022 18:31:18 -0000 1.5 +++ v3/pkg/PLIST-tcl 24 Dec 2022 04:34:54 -0000 @@ -1,12 +1,15 @@ @option no-default-conflict @option is-branch @conflict db-tcl->=3,<4 -lib/db/libdb_tcl.a +@static-lib lib/db/libdb_tcl.a lib/db/libdb_tcl.la @comment lib/db/libdb_tcl.so @comment lib/db/libdb_tcl.so.3 @lib lib/db/libdb_tcl.so.${LIBdb_tcl_VERSION} @lib lib/libdb_tcl.so.${LIBdb_tcl_VERSION} +lib/tcl/ +lib/tcl/db_v3/ +lib/tcl/db_v3/pkgIndex.tcl share/doc/db/api_tcl/ share/doc/db/api_tcl/db_close.html share/doc/db/api_tcl/db_count.html Index: v4/Makefile =================================================================== RCS file: /cvs/ports/databases/db/v4/Makefile,v retrieving revision 1.82 diff -u -p -u -p -r1.82 Makefile --- v4/Makefile 11 Mar 2022 18:31:18 -0000 1.82 +++ v4/Makefile 24 Dec 2022 04:34:54 -0000 @@ -8,10 +8,11 @@ PKGSPEC-tcl = db-tcl->=4,<5|db-tcl->=4 REVISION-main = 7 REVISION-java = 13 -REVISION-tcl = 4 +REVISION-tcl = 5 EPOCH= 0 DBLIBDIR= lib/db4 +DB_TCL_VER= 4.6 # XXX LIBdb_VERSION is used by x11/gnome/libgda SHARED_LIBS += db 5.0 # .0.0 Index: v4/patches/patch-dist_configure =================================================================== RCS file: /cvs/ports/databases/db/v4/patches/patch-dist_configure,v retrieving revision 1.11 diff -u -p -u -p -r1.11 patch-dist_configure --- v4/patches/patch-dist_configure 11 Mar 2022 18:31:18 -0000 1.11 +++ v4/patches/patch-dist_configure 24 Dec 2022 04:34:54 -0000 @@ -127,7 +127,17 @@ Index: dist/configure exit(0); #else FAIL TO COMPILE/LINK -@@ -35352,7 +35374,7 @@ fi+@@ -35150,6 +35172,9 @@ echo "$as_me: error: Berkeley DB requires Tcl version
+ LIBTSO_LIBS="$LIBTSO_LIBS -L$TCL_EXEC_PREFIX/lib -ltcl$TCL_VERSION; + aix*) + LIBTSO_LIBS="$LIBTSO_LIBS $TCL_LIB_SPEC $TCL_LIB_FLAG; ++ openbsd*) ++ LIBTSO_LIBS="$LIBTSO_LIBS $TCL_STUB_LIB_SPEC" ++ TCL_INCLUDE_SPEC="$TCL_INCLUDE_SPEC -DUSE_TCL_STUBS=1; + esac + + +@@ -35352,7 +35377,7 @@ fi # Optional utilities. if test "$db_cv_dump185" = "yes; then @@ -136,7 +146,7 @@ Index: dist/configure fi # You can disable pieces of functionality to save space. -@@ -36224,7 +36246,9 @@ MAKEFILE_CC!$MAKEFILE_CC$ac_delim +@@ -36224,7 +36249,9 @@ MAKEFILE_CC!$MAKEFILE_CC$ac_delim MAKEFILE_CCLINK!$MAKEFILE_CCLINK$ac_delim MAKEFILE_CXX!$MAKEFILE_CXX$ac_delim MAKEFILE_CXXLINK!$MAKEFILE_CXXLINK$ac_delim @@ -147,7 +157,7 @@ Index: dist/configure MAKEFILE_XSOLINK!$MAKEFILE_XSOLINK$ac_delim OSDIR!$OSDIR$ac_delim POSTLINK!$POSTLINK$ac_delim -@@ -36244,7 +36268,7 @@ DB_VERSION_PATCH!$DB_VERSION_PATCH$ac_delim +@@ -36244,7 +36271,7 @@ DB_VERSION_PATCH!$DB_VERSION_PATCH$ac_delim DB_VERSION_STRING!$DB_VERSION_STRING$ac_delim _ACEOF Index: v4/patches/patch-tcl_tcl_db_pkg_c =================================================================== RCS file: /cvs/ports/databases/db/v4/patches/patch-tcl_tcl_db_pkg_c,v retrieving revision 1.4 diff -u -p -u -p -r1.4 patch-tcl_tcl_db_pkg_c --- v4/patches/patch-tcl_tcl_db_pkg_c 11 Mar 2022 18:31:18 -0000 1.4 +++ v4/patches/patch-tcl_tcl_db_pkg_c 24 Dec 2022 04:34:54 -0000 @@ -1,6 +1,17 @@ ---- tcl/tcl_db_pkg.c.orig Mon Jul 9 19:38:45 2007 -+++ tcl/tcl_db_pkg.c Sat Sep 15 12:39:57 2007 -@@ -210,7 +210,7 @@ berkdb_Cmd(notused, interp, objc, objv) +Index: tcl/tcl_db_pkg.c +--- tcl/tcl_db_pkg.c.orig ++++ tcl/tcl_db_pkg.c +@@ -74,6 +74,9 @@ Db_tcl_Init(interp) + int code; + char pkg[12]; + ++ if (Tcl_InitStubs(interp, "8.5", 0) == NULL) ++ return TCL_ERROR; +++ snprintf(pkg, sizeof(pkg), "%d.%d", DB_VERSION_MAJOR, DB_VERSION_MINOR);
+ code = Tcl_PkgProvide(interp, "Db_tcl", pkg); + if (code != TCL_OK) +@@ -210,7 +213,7 @@ berkdb_Cmd(notused, interp, objc, objv) * defined above. */ if (Tcl_GetIndexFromObj(interp, @@ -9,7 +20,7 @@ return (IS_HELP(objv[1])); res = NULL; switch ((enum berkdbcmds)cmdindex) { -@@ -577,7 +577,7 @@ bdb_EnvOpen(interp, objc, objv, ip, env) +@@ -577,7 +580,7 @@ bdb_EnvOpen(interp, objc, objv, ip, env) server_to = client_to = 0; i = 2; while (i < objc) { @@ -18,7 +29,7 @@ TCL_EXACT, &optindex) != TCL_OK) { Tcl_ResetResult(interp); continue; -@@ -650,7 +650,7 @@ bdb_EnvOpen(interp, objc, objv, ip, env) +@@ -650,7 +653,7 @@ bdb_EnvOpen(interp, objc, objv, ip, env) i = 2; while (i < objc) { Tcl_ResetResult(interp); @@ -27,7 +38,7 @@ TCL_EXACT, &optindex) != TCL_OK) { result = IS_HELP(objv[i]); goto error; -@@ -1579,7 +1579,7 @@ bdb_DbOpen(interp, objc, objv, ip, dbp) +@@ -1579,7 +1582,7 @@ bdb_DbOpen(interp, objc, objv, ip, dbp) */ i = 2; while (i < objc) { @@ -36,7 +47,7 @@ "option", TCL_EXACT, &optindex) != TCL_OK) { /* * Reset the result so we don't get -@@ -1641,7 +1641,7 @@ bdb_DbOpen(interp, objc, objv, ip, dbp) +@@ -1641,7 +1644,7 @@ bdb_DbOpen(interp, objc, objv, ip, dbp) i = 2; while (i < objc) { Tcl_ResetResult(interp); @@ -45,7 +56,7 @@ TCL_EXACT, &optindex) != TCL_OK) { arg = Tcl_GetStringFromObj(objv[i], NULL); if (arg[0] == '-') { -@@ -2548,7 +2548,7 @@ bdb_DbRemove(interp, objc, objv) +@@ -2548,7 +2551,7 @@ bdb_DbRemove(interp, objc, objv) */ i = 2; while (i < objc) { @@ -54,7 +65,7 @@ "option", TCL_EXACT, &optindex) != TCL_OK) { arg = Tcl_GetStringFromObj(objv[i], NULL); if (arg[0] == '-') { -@@ -2768,7 +2768,7 @@ bdb_DbRename(interp, objc, objv) +@@ -2768,7 +2771,7 @@ bdb_DbRename(interp, objc, objv) */ i = 2; while (i < objc) { @@ -63,7 +74,7 @@ "option", TCL_EXACT, &optindex) != TCL_OK) { arg = Tcl_GetStringFromObj(objv[i], NULL); if (arg[0] == '-') { -@@ -3005,7 +3005,7 @@ bdb_DbVerify(interp, objc, objv) +@@ -3005,7 +3008,7 @@ bdb_DbVerify(interp, objc, objv) */ i = 2; while (i < objc) { @@ -72,7 +83,7 @@ "option", TCL_EXACT, &optindex) != TCL_OK) { arg = Tcl_GetStringFromObj(objv[i], NULL); if (arg[0] == '-') { -@@ -3224,7 +3224,7 @@ bdb_Version(interp, objc, objv) +@@ -3224,7 +3227,7 @@ bdb_Version(interp, objc, objv) */ i = 2; while (i < objc) { @@ -81,7 +92,7 @@ "option", TCL_EXACT, &optindex) != TCL_OK) { arg = Tcl_GetStringFromObj(objv[i], NULL); if (arg[0] == '-') { -@@ -3452,7 +3452,7 @@ bdb_DbUpgrade(interp, objc, objv) +@@ -3452,7 +3455,7 @@ bdb_DbUpgrade(interp, objc, objv) i = 2; while (i < objc) { Index: v4/pkg/PLIST-java =================================================================== RCS file: /cvs/ports/databases/db/v4/pkg/PLIST-java,v retrieving revision 1.6 diff -u -p -u -p -r1.6 PLIST-java --- v4/pkg/PLIST-java 11 Mar 2022 18:31:18 -0000 1.6 +++ v4/pkg/PLIST-java 24 Dec 2022 04:34:54 -0000 @@ -1,6 +1,6 @@ @option is-branch lib/db4/db.jar -lib/db4/libdb_java.a +@static-lib lib/db4/libdb_java.a lib/db4/libdb_java.la @lib lib/db4/libdb_java.so.${LIBdb_java_VERSION} @lib lib/libdb_java.so.${LIBdb_java_VERSION} Index: v4/pkg/PLIST-main =================================================================== RCS file: /cvs/ports/databases/db/v4/pkg/PLIST-main,v retrieving revision 1.7 diff -u -p -u -p -r1.7 PLIST-main --- v4/pkg/PLIST-main 11 Mar 2022 18:31:18 -0000 1.7 +++ v4/pkg/PLIST-main 24 Dec 2022 04:34:55 -0000 @@ -21,10 +21,10 @@ include/db4/db.h include/db4/db_185.h include/db4/db_cxx.h lib/db4/ -lib/db4/libdb.a +@static-lib lib/db4/libdb.a lib/db4/libdb.la @lib lib/db4/libdb.so.${LIBdb_VERSION} -lib/db4/libdb_cxx.a +@static-lib lib/db4/libdb_cxx.a lib/db4/libdb_cxx.la @lib lib/db4/libdb_cxx.so.${LIBdb_cxx_VERSION} @lib lib/libdb.so.${LIBdb_VERSION} Index: v4/pkg/PLIST-tcl =================================================================== RCS file: /cvs/ports/databases/db/v4/pkg/PLIST-tcl,v retrieving revision 1.5 diff -u -p -u -p -r1.5 PLIST-tcl --- v4/pkg/PLIST-tcl 11 Mar 2022 18:31:18 -0000 1.5 +++ v4/pkg/PLIST-tcl 24 Dec 2022 04:34:55 -0000 @@ -1,10 +1,13 @@ @option no-default-conflict @option is-branch @conflict db-tcl->=4,<5 -lib/db4/libdb_tcl.a +@static-lib lib/db4/libdb_tcl.a lib/db4/libdb_tcl.la @lib lib/db4/libdb_tcl.so.${LIBdb_tcl_VERSION} @lib lib/libdb_tcl.so.${LIBdb_tcl_VERSION} +lib/tcl/ +lib/tcl/db_v4/ +lib/tcl/db_v4/pkgIndex.tcl share/doc/db4/api_tcl/ share/doc/db4/api_tcl/api_tcl.html share/doc/db4/api_tcl/db_close.html ------ Original Message ------ From: s...@spacehopper.org To: r...@rmswch.plus.com; ports@openbsd.org Sent: Thursday, December 22, 2022 9:33 AM Subject: Re: Python access to Berkeley DBYou could try rebuilding databases/db/v4 with MODTCL_VERSION=8.6 added to the Makefile and see if that helps at all..
-- Sent from a phone, apologies for poor formatting. On 21 December 2022 20:52:06 Roger Marsh <r...@rmswch.plus.com> wrote: > On Tue, 20 Dec 2022 12:18:59 -0000 (UTC) > Stuart Henderson <stu.li...@spacehopper.org> wrote: > >> ["Followup-To:" header set to gmane.os.openbsd.misc.] >> On 2022-12-19, Stuart Cassoff <3...@bell.net> wrote: >>> ------ Original Message ------ >>> From: stu.li...@spacehopper.org >>> To: ports@openbsd.org >>> Cc: m...@openbsd.org >>> Sent: Monday, December 19, 2022 7:53 AM >>> Subject: Re: Python access to Berkeley DB >>>>>> [ moving to ports@, hopefully reply-to will be set correctly
>>> if >>> I got the gmane/nntp bits right :) ] >>>>>> You might possibly be able to kludge around it with some LD_PRELOAD, >>> though tkinter is now built against Tcl 8.6 and the db-tcl package is >>> built against Tcl 8.5 and I don't know if extensions are compatible
>>> cross-version. >>> >>> >>> Extensions built against 8.5 should load into 8.6 no problem. >>>> Thanks. I wasn't sure and the tclsh import didn't work for either 8.5 or 8.6
>> for me. >> >> > Thanks for LD_PRELOAD, about which I knew nothing. > > The kludge got rid of all but one undefined symbols: > > Script started on Tue Dec 20 09:20:33 2022 > d630amd64$ ls /usr/local/lib/db4 > libdb.a libdb_cxx.a libdb_tcl.a pkgIndex.tcl > libdb.la libdb_cxx.la libdb_tcl.la > libdb.so.5.0 libdb_cxx.so.6.0 libdb_tcl.so.6.0 > d630amd64$ export LD_PRELOAD=/usr/local/lib/db4/libdb_tcl.so.6.0 > d630amd64$ python3.9 > Python 3.9.15 (main, Oct 21 2022, 14:01:40) > [Clang 13.0.0 ] on openbsd7> Type "help", "copyright", "credits" or "license" for more information.
>>>> import tkinter >>>> tcl = tkinter.Tk(useTk=False) >>>> tcl.tk.call("lappend", "auto_path", "/usr/local/lib/db4") > (, '/usr/local/lib/tcl', > '/usr/local/lib/db4') >>>> tcl.tk.call("package", "require", "Db_tcl") > python3.9:/usr/local/lib/db4/libdb_tcl.so.6.0: undefined symbol > 'Tcl_PkgProvideEx' > ld.so: python3.9: lazy binding failed! > Killed > d630amd64$ exit > > Script done on Tue Dec 20 09:24:01 2022 >> so I tried building from ports, building Python against Tcl/Tk 8.5 because > I could see what to change in Makefile.inc with some confidence I was > guessing right (8.6 > 8.5 about line 100). Same result, first with package
> command: > > Script started on Tue Dec 20 20:25:17 2022 > rack$ export LD_PRELOAD=/usr/local/lib/db4/libdb_tcl.so.6.0 > rack$ python3.9 > Python 3.9.14 (main, Dec 20 2022, 16:12:25) > [Clang 13.0.0 ] on openbsd7> Type "help", "copyright", "credits" or "license" for more information.
>>>> import tkinter >>>> tkinter.TclVersion > 8.5 >>>> tcl = tkinter.Tk(useTk=False) >>>> tcl.tk.call("lappend", "auto_path", "/usr/local/lib/db4") > (, '/usr/local/lib/tcl', > '/usr/local/lib/db4') >>>> tcl.tk.call("package", "require", "Db_tcl") > python3.9:/usr/local/lib/db4/libdb_tcl.so.6.0: undefined symbol > 'Tcl_PkgProvideEx' > ld.so: python3.9: lazy binding failed! > Killed > rack$ tclsh8.5 > % lappend auto_path /usr/local/lib/db4 > /usr/local/lib/tcl/tcl8.5 /usr/local/lib/tcl /usr/local/lib/db4 > % package require Db_tcl > 4.6 > % exit > rack$ exit > > Script done on Tue Dec 20 20:33:19 2022 > > > And with the load command: > > Script started on Wed Dec 21 20:25:22 2022 > rack$ tclsh8.5 > % load /usr/local/lib/db4/libdb_tcl.so.6.0 > % berkdb version -string > Berkeley DB 4.6.21: (September 27, 2007) > % exit > rack$ export LD_PRELOAD=/usr/local/lib/db4/libdb_tcl.so.6.0 > rack$ python3.9 > Python 3.9.14 (main, Dec 20 2022, 16:12:25) > [Clang 13.0.0 ] on openbsd7> Type "help", "copyright", "credits" or "license" for more information.
>>>> import tkinter >>>> tkinter.TclVersion > 8.5 >>>> tcl = tkinter.Tk(useTk=False) >>>> tcl.tk.call("load", "/usr/local/lib/db4/libdb_tcl.so.6.0") > python3.9:/usr/local/lib/db4/libdb_tcl.so.6.0: undefined symbol > 'Tcl_PkgProvideEx' > ld.so: python3.9: lazy binding failed! > Killed > rack$ exit > > Script done on Wed Dec 21 20:30:35 2022 > > > Give up on kludge I think. > > Roger
db.diff.gz
Description: application/gzip