Index: texmf-dist/web2c/texmf.cnf
--- texmf-dist/web2c/texmf.cnf.orig
+++ texmf-dist/web2c/texmf.cnf
@@ -1,6 +1,10 @@
 % original texmf.cnf -- runtime path configuration file for kpathsea.
 % Public domain.
 % 
+% ************************
+% HACKED FOR OPENBSD PORTS
+% ************************
+% 
 % If you modify this original file, YOUR CHANGES WILL BE LOST when it is
 % updated.  Instead, put your changes -- and only your changes, not an
 % entire copy! -- in ../../texmf.cnf.  That is, if this file is
@@ -59,8 +63,11 @@
 % SELFAUTOPARENT (its grandparent = /usr/local/texlive/YYYY), and
 % SELFAUTOGRANDPARENT (its great-grandparent = /usr/local/texlive).
 % Sorry for the off-by-one-generation names.
-TEXMFROOT = $SELFAUTOPARENT
 
+% We use the old teTeX paths in OpenBSD.
+OBSD_PREFIX= ${TRUEPREFIX}
+TEXMFROOT = $OBSD_PREFIX/share
+
 % The various texmf trees used by TeX Live, follow.
 % They must must all have the TDS directory structure (https://tug.org/tds).
 
@@ -72,7 +79,7 @@ TEXMFDIST = $TEXMFROOT/texmf-dist
 TEXMFMAIN = $TEXMFDIST
 
 % Local additions to the distribution trees.
-TEXMFLOCAL = $SELFAUTOGRANDPARENT/texmf-local
+TEXMFLOCAL = $TEXMFROOT/texmf-local
 
 % TEXMFSYSVAR, where *-sys store cached runtime data.
 TEXMFSYSVAR = $TEXMFROOT/texmf-var
@@ -528,7 +535,7 @@ LUAINPUTS.harflatex-dev = $TEXMFDOTDIR;$TEXMF/scripts/
 LUAINPUTS = $TEXMFDOTDIR;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{luatex,plain,generic,latex,}//
 
 % Lua needs to look for binary lua libraries distributed with packages.
-CLUAINPUTS = $TEXMFDOTDIR;$SELFAUTOLOC/lib/{$progname,$engine,}/lua//
+CLUAINPUTS = $TEXMFDOTDIR;$OBSD_PREFIX/lib/{$progname,$engine,}/lua//
 
 % Architecture independent executables.
 TEXMFSCRIPTS = $TEXMF/scripts/{$progname,$engine,}//
