@@ -193,13 +193,19 @@ jobs:
193193 # Also copy tcl8 modules directly to lib for module path discovery
194194 cp -rL /usr/share/tcltk/tcl8.6/tcl8 ${{ github.workspace }}/rpm-root/opt/scidcommunity/lib/
195195
196- - name : Create symlink structure for Tcl hardcoded paths
196+ - name : Create symlink structure and patch Tcl init for module path
197197 run : |
198198 # Tcl library has /usr/share/tcltk hardcoded, create symlink structure
199199 mkdir -p ${{ github.workspace }}/rpm-root/opt/scidcommunity/usr/share/tcltk
200200 ln -s ../../lib/tcl8.6 ${{ github.workspace }}/rpm-root/opt/scidcommunity/usr/share/tcltk/tcl8.6
201201 ln -s ../../lib/tk8.6 ${{ github.workspace }}/rpm-root/opt/scidcommunity/usr/share/tcltk/tk8.6
202202
203+ # Patch init.tcl to add our module path first
204+ cat >> ${{ github.workspace }}/rpm-root/opt/scidcommunity/lib/tcl8.6/init.tcl << 'EOFTCL'
205+ # Add bundled module path for scidCommunity
206+ ::tcl::tm::path add /opt/scidcommunity/usr/share/tcltk/tcl8.6/tcl8
207+ EOFTCL
208+
203209 - name : Rename binary and create wrapper script
204210 run : |
205211 mv ${{ github.workspace }}/rpm-root/opt/scidcommunity/bin/scidCommunity \
@@ -292,6 +298,14 @@ jobs:
292298 ln -s ../../lib/tcl8.6 ${{ github.workspace }}/AppDir/usr/share/tcltk/tcl8.6
293299 ln -s ../../lib/tk8.6 ${{ github.workspace }}/AppDir/usr/share/tcltk/tk8.6
294300
301+ # Patch init.tcl to add AppImage module path
302+ cat >> ${{ github.workspace }}/AppDir/usr/lib/tcl8.6/init.tcl << 'EOFTCL'
303+ # Add bundled module path for scidCommunity AppImage
304+ if {[info exists ::env(APPDIR)]} {
305+ ::tcl::tm::path add "$::env(APPDIR)/usr/share/tcltk/tcl8.6/tcl8"
306+ }
307+ EOFTCL
308+
295309 # Rename binary
296310 mv ${{ github.workspace }}/AppDir/usr/bin/scidCommunity \
297311 ${{ github.workspace }}/AppDir/usr/bin/scidCommunity.bin
0 commit comments