@@ -91,12 +91,17 @@ dylibbundler -of -b \ |
| 91 | -s /opt/homebrew/opt/zstd/lib 2>&1 || echo " (dylibbundler completed with warnings - this is expected)" | 91 | -s /opt/homebrew/opt/zstd/lib 2>&1 || echo " (dylibbundler completed with warnings - this is expected)" |
| 92 | | 92 | |
| 93 | echo "" | 93 | echo "" |
| 94 | -echo "Step 2.5: Manually fixing GFortran library references..." | 94 | +echo "Step 2.5: Manually fixing GFortran and GTK-Fortran library references..." |
| 95 | -# dylibbundler fails to fully fix libgfortran due to header limits, so we fix remaining references manually | 95 | +# dylibbundler sometimes misses @rpath references, so we fix them manually |
| | 96 | + |
| 96 | # Fix binary's reference to libgfortran | 97 | # Fix binary's reference to libgfortran |
| 97 | install_name_tool -change /opt/homebrew/opt/gcc/lib/gcc/current/libgfortran.5.dylib @executable_path/../Frameworks/libgfortran.5.dylib "$MACOS_BIN" 2>/dev/null || true | 98 | install_name_tool -change /opt/homebrew/opt/gcc/lib/gcc/current/libgfortran.5.dylib @executable_path/../Frameworks/libgfortran.5.dylib "$MACOS_BIN" 2>/dev/null || true |
| 98 | install_name_tool -change /usr/local/lib/gcc/current/libgfortran.5.dylib @executable_path/../Frameworks/libgfortran.5.dylib "$MACOS_BIN" 2>/dev/null || true | 99 | install_name_tool -change /usr/local/lib/gcc/current/libgfortran.5.dylib @executable_path/../Frameworks/libgfortran.5.dylib "$MACOS_BIN" 2>/dev/null || true |
| 99 | | 100 | |
| | 101 | +# Fix binary's @rpath reference to libgtk-4-fortran (CRITICAL FIX) |
| | 102 | +install_name_tool -change @rpath/libgtk-4-fortran.4.8.0.dylib @executable_path/../Frameworks/libgtk-4-fortran.4.8.0.dylib "$MACOS_BIN" 2>/dev/null || true |
| | 103 | +install_name_tool -change /usr/local/lib/libgtk-4-fortran.4.8.0.dylib @executable_path/../Frameworks/libgtk-4-fortran.4.8.0.dylib "$MACOS_BIN" 2>/dev/null || true |
| | 104 | + |
| 100 | # Fix libgfortran's internal references (only if it exists and isn't fully fixed) | 105 | # Fix libgfortran's internal references (only if it exists and isn't fully fixed) |
| 101 | if [ -f "$FRAMEWORKS/libgfortran.5.dylib" ]; then | 106 | if [ -f "$FRAMEWORKS/libgfortran.5.dylib" ]; then |
| 102 | # Try to fix remaining references - these might fail if header is full, but that's OK | 107 | # Try to fix remaining references - these might fail if header is full, but that's OK |