$OpenBSD: patch-texmf-dist_web2c_texmf_cnf,v 1.4 2016/06/01 12:47:33 edd Exp $
--- texmf-dist/web2c/texmf.cnf.origy	Sun Apr 12 16:20:30 2015
+++ texmf-dist/web2c/texmf.cnf	Sun Apr 17 21:46:32 2016
@@ -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
@@ -48,10 +52,9 @@
 % All trees must be organized according to the TeX Directory Structure
 % (http://tug.org/tds), or files may not be found.
 %
-% Redistributors will probably want $SELFAUTODIR/share, i.e., /usr/share.
-% Kpathsea sets SELFAUTOLOC (the directory with the binary),
-% SELFAUTODIR (its parent), and SELFAUTOPARENT (its grandparent).
-TEXMFROOT = $SELFAUTOPARENT
+% We use the old teTeX paths in OpenBSD, respect the legacy.
+OBSD_PREFIX= ${TRUEPREFIX}
+TEXMFROOT = $OBSD_PREFIX/share
 
 % The main tree of distributed packages and programs:
 TEXMFDIST = $TEXMFROOT/texmf-dist
@@ -61,7 +64,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
@@ -440,7 +443,7 @@ LUAINPUTS.dvilualatex = .;$TEXMF/scripts/{$progname,$e
 LUAINPUTS = .;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{luatex,plain,generic,}//
 
 % Lua needs to look for binary lua libraries distributed with packages.
-CLUAINPUTS = .;$SELFAUTOLOC/lib/{$progname,$engine,}/lua//
+CLUAINPUTS = .;$OBSD_PREFIX/lib/{$progname,$engine,}/lua//
 
 % Architecture independent executables.
 TEXMFSCRIPTS = $TEXMF/scripts/{$progname,$engine,}//
