@@ -10,17 +10,36 @@ check_dependency() {
1010 if ! pkg-config --exists " $1 " 2> /dev/null; then
1111 echo -e " \033[31mError: $1 is not installed.\033[0m"
1212 echo -e " Install it with: sudo apt install $2 "
13- exit 1
13+ return 1
1414 fi
15+ return 0
1516}
1617
17- check_dependency " gtk+-3.0" " libgtk-3-dev"
18- check_dependency " webkit2gtk-4.0" " libwebkit2gtk-4.0-dev"
18+ check_dependency " gtk+-3.0" " libgtk-3-dev" || exit 1
19+
20+ # Ubuntu 24.04+ usa webkit2gtk-4.1, versiones anteriores usan 4.0
21+ if pkg-config --exists " webkit2gtk-4.1" 2> /dev/null; then
22+ echo -e " Found webkit2gtk-4.1"
23+ elif pkg-config --exists " webkit2gtk-4.0" 2> /dev/null; then
24+ echo -e " Found webkit2gtk-4.0"
25+ else
26+ echo -e " \033[31mError: webkit2gtk not found.\033[0m"
27+ echo -e " Install with: sudo apt install libwebkit2gtk-4.1-dev"
28+ exit 1
29+ fi
1930
2031echo -e " \033[32mAll dependencies satisfied!\033[0m"
2132
2233echo -e " Start building the app for Linux platform..."
23- wails build --clean --platform linux/amd64
34+
35+ # Detectar versión de webkit2gtk y usar el tag correcto
36+ if pkg-config --exists " webkit2gtk-4.1" 2> /dev/null; then
37+ echo -e " Using webkit2gtk-4.1 (Ubuntu 24.04+)"
38+ wails build --clean --platform linux/amd64 -tags webkit2_41
39+ else
40+ echo -e " Using webkit2gtk-4.0"
41+ wails build --clean --platform linux/amd64
42+ fi
2443
2544if [ $? -eq 0 ]; then
2645 echo -e " \033[32mBuild successful!\033[0m"
0 commit comments