@@ -38,6 +38,9 @@ if [ ! -d "$OUTPUT_DIR" ]; then
38
38
exit 1
39
39
fi
40
40
41
+ # Derive GTK directory from DLL directory (typically /mingw64/bin -> /mingw64)
42
+ GTK_DIR=$( dirname " $DLL_SOURCE_DIR " )
43
+
41
44
# Function to get direct dependencies of a file
42
45
get_dependencies () {
43
46
local file=" $1 "
@@ -55,6 +58,64 @@ declare -A processed_dlls
55
58
declare -a dlls_to_process
56
59
declare -a missing_dlls
57
60
61
+ # Create necessary GTK directories
62
+ echo " Creating GTK directory structure..."
63
+ mkdir -p " $OUTPUT_DIR /share/glib-2.0/schemas"
64
+ mkdir -p " $OUTPUT_DIR /share/icons"
65
+ mkdir -p " $OUTPUT_DIR /share/themes"
66
+ mkdir -p " $OUTPUT_DIR /lib/gdk-pixbuf-2.0"
67
+ mkdir -p " $OUTPUT_DIR /lib/gtk-3.0"
68
+
69
+ # Copy GTK related files
70
+ echo " Copying GTK files..."
71
+ echo " Looking for schemas in: $GTK_DIR /share/glib-2.0/schemas/"
72
+ ls -l " $GTK_DIR /share/glib-2.0/schemas/" || echo " Directory not found"
73
+
74
+ # Try multiple possible locations for gschemas.compiled
75
+ SCHEMA_LOCATIONS=(
76
+ " $GTK_DIR /share/glib-2.0/schemas/gschemas.compiled"
77
+ " $DLL_SOURCE_DIR /../share/glib-2.0/schemas/gschemas.compiled"
78
+ " /usr/x86_64-w64-mingw32/sys-root/mingw/share/glib-2.0/schemas/gschemas.compiled"
79
+ " /mingw64/share/glib-2.0/schemas/gschemas.compiled"
80
+ )
81
+
82
+ SCHEMA_FOUND=0
83
+ for schema_path in " ${SCHEMA_LOCATIONS[@]} " ; do
84
+ echo " Checking for schema at: $schema_path "
85
+ if [ -f " $schema_path " ]; then
86
+ echo " Found schema file at: $schema_path "
87
+ cp " $schema_path " " $OUTPUT_DIR /share/glib-2.0/schemas/"
88
+ SCHEMA_FOUND=1
89
+ break
90
+ fi
91
+ done
92
+
93
+ if [ $SCHEMA_FOUND -eq 0 ]; then
94
+ echo " Warning: Could not find gschemas.compiled in any of the expected locations"
95
+ fi
96
+
97
+ # Copy theme-related files if they exist
98
+ if [ -d " $GTK_DIR /share/icons/hicolor" ]; then
99
+ cp -r " $GTK_DIR /share/icons/hicolor" " $OUTPUT_DIR /share/icons/"
100
+ fi
101
+ if [ -d " $GTK_DIR /share/themes/default" ]; then
102
+ cp -r " $GTK_DIR /share/themes/default" " $OUTPUT_DIR /share/themes/"
103
+ fi
104
+ if [ -d " $GTK_DIR /share/themes/emacs" ]; then
105
+ cp -r " $GTK_DIR /share/themes/emacs" " $OUTPUT_DIR /share/themes/"
106
+ fi
107
+
108
+ # Create GTK settings file
109
+ cat > " $OUTPUT_DIR /settings.ini" << EOF
110
+ [Settings]
111
+ gtk-theme-name = default
112
+ gtk-icon-theme-name = hicolor
113
+ gtk-font-name = Segoe UI 9
114
+ gtk-menu-images = true
115
+ gtk-button-images = true
116
+ gtk-toolbar-style = both-horiz
117
+ EOF
118
+
58
119
# Get initial dependencies
59
120
echo " Analyzing dependencies for $( basename " $EXE_PATH " ) ..."
60
121
initial_dlls=$( get_dependencies " $EXE_PATH " )
0 commit comments