$OpenBSD: patch-nagelfar_tcl,v 1.3 2017/05/05 04:10:48 stu Exp $
Index: nagelfar.tcl
--- nagelfar.tcl.orig
+++ nagelfar.tcl
@@ -50,15 +50,13 @@ while {[file type $tmplink] == "link"} {
 unset tmplink
 
 # This makes it possible to customize where files are installed
-set dbDir      $thisDir
-set docDir     $thisDir/doc
+set dbDir      [file join [file dirname [::tcl::pkgconfig get libdir,install]] libdata nagelfar]
+set docDir     [file join [file dirname [::tcl::pkgconfig get libdir,install]] share doc nagelfar]
 set libDir     $thisDir/lib
  
 # Search where the script is, to be able to place e.g. ctext there.
 if {[info exists ::starkit::topdir]} {
     lappend auto_path [file dirname [file normalize $::starkit::topdir]]
-} else {
-    lappend auto_path $libDir
 }
 set version "Version 1.2.5 2017-01-09"
 #----------------------------------------------------------------------
@@ -6149,11 +6147,7 @@ proc addOptionsMenu {m} {
 #----------------------------------------------------------------------
 
 proc PluginSearchPath {} {
-    set dirs [list . ./plugins]
-    lappend dirs [file join $::thisDir .. ..]
-    lappend dirs [file join $::thisDir .. .. plugins]
-    lappend dirs [file join $::thisDir .. plugins]
-    return $dirs
+    return [list . ./nagelfar_plugins ~/nagelfar_plugins]
 }
 
 # Locate plugin source
