Skip to content

Commit ff030ce

Browse files
committed
fix(deps): update WebKitGTK package for Ubuntu 24.04 compatibility and adjust installation scripts
1 parent 9e6552e commit ff030ce

6 files changed

Lines changed: 55 additions & 13 deletions

File tree

.github/workflows/build-all.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ jobs:
8282
- name: Install Linux dependencies
8383
run: |
8484
sudo apt-get update
85+
# Ubuntu 24.04+ usa libwebkit2gtk-4.1-dev
8586
sudo apt-get install -y \
8687
libgtk-3-dev \
87-
libwebkit2gtk-4.0-dev \
88+
libwebkit2gtk-4.1-dev \
8889
build-essential \
8990
pkg-config \
9091
libappindicator3-dev
@@ -120,7 +121,8 @@ jobs:
120121
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
121122

122123
- name: Build Wails application
123-
run: wails build -platform linux/amd64
124+
# El tag webkit2_41 es necesario para Ubuntu 24.04+ que usa webkit2gtk-4.1
125+
run: wails build -platform linux/amd64 -tags webkit2_41
124126

125127
- name: Rename artifact
126128
run: |
@@ -183,6 +185,10 @@ jobs:
183185
### Requirements
184186
- **Linux**: GTK3 and WebKitGTK runtime libraries
185187
```bash
188+
# Ubuntu 24.04+
189+
sudo apt install libgtk-3-0 libwebkit2gtk-4.1-0
190+
191+
# Ubuntu 22.04 y anteriores
186192
sudo apt install libgtk-3-0 libwebkit2gtk-4.0-37
187193
```
188194
files: |

.github/workflows/build-linux.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ jobs:
3232
- name: Install Linux dependencies
3333
run: |
3434
sudo apt-get update
35+
# Ubuntu 24.04+ usa libwebkit2gtk-4.1-dev, versiones anteriores usan 4.0
3536
sudo apt-get install -y \
3637
libgtk-3-dev \
37-
libwebkit2gtk-4.0-dev \
38+
libwebkit2gtk-4.1-dev \
3839
build-essential \
3940
pkg-config \
4041
libappindicator3-dev
@@ -76,8 +77,9 @@ jobs:
7677
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
7778

7879
# 9. Build de la aplicación Wails para Linux
80+
# El tag webkit2_41 es necesario para Ubuntu 24.04+ que usa webkit2gtk-4.1
7981
- name: Build Wails application
80-
run: wails build -platform linux/amd64
82+
run: wails build -platform linux/amd64 -tags webkit2_41
8183

8284
# 10. Crear nombre del artefacto con timestamp
8385
- name: Get timestamp

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,14 @@ The application features a clean, card-based interface with:
5555

5656
### Linux (Ubuntu/Debian) Dependencies
5757
```bash
58-
sudo apt update
58+
# Ubuntu 24.04+
59+
sudo apt install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
60+
61+
# Ubuntu 22.04 y anteriores
5962
sudo apt install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
6063
```
6164

62-
Or use the automated script:
65+
Or use the automated script (auto-detects version):
6366
```bash
6467
./scripts/install-linux-deps.sh
6568
```

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.22.0
44

55
toolchain go1.23.2
66

7-
require github.com/wailsapp/wails/v2 v2.10.2
7+
require github.com/wailsapp/wails/v2 v2.11.0
88

99
require (
1010
github.com/bep/debounce v1.2.1 // indirect

scripts/build-linux.sh

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

2031
echo -e "\033[32mAll dependencies satisfied!\033[0m"
2132

2233
echo -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

2544
if [ $? -eq 0 ]; then
2645
echo -e "\033[32mBuild successful!\033[0m"

scripts/install-linux-deps.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ case $DISTRO in
2222
ubuntu|debian|linuxmint|pop)
2323
echo -e "Installing dependencies for Ubuntu/Debian..."
2424
sudo apt update
25+
# Detectar versión de Ubuntu para elegir el paquete correcto
26+
if apt-cache show libwebkit2gtk-4.1-dev &>/dev/null; then
27+
WEBKIT_PKG="libwebkit2gtk-4.1-dev"
28+
else
29+
WEBKIT_PKG="libwebkit2gtk-4.0-dev"
30+
fi
31+
echo -e "Using WebKit package: $WEBKIT_PKG"
2532
sudo apt install -y \
2633
libgtk-3-dev \
27-
libwebkit2gtk-4.0-dev \
34+
$WEBKIT_PKG \
2835
build-essential \
2936
pkg-config \
3037
libappindicator3-dev
@@ -79,7 +86,12 @@ verify_pkg() {
7986

8087
ALL_OK=true
8188
verify_pkg "gtk+-3.0" || ALL_OK=false
82-
verify_pkg "webkit2gtk-4.0" || ALL_OK=false
89+
# Verificar webkit2gtk-4.1 (Ubuntu 24.04+) o 4.0 (versiones anteriores)
90+
if pkg-config --exists "webkit2gtk-4.1" 2>/dev/null; then
91+
verify_pkg "webkit2gtk-4.1" || ALL_OK=false
92+
else
93+
verify_pkg "webkit2gtk-4.0" || ALL_OK=false
94+
fi
8395

8496
if [ "$ALL_OK" = true ]; then
8597
echo -e "\n\033[32m✓ All dependencies installed successfully!\033[0m"

0 commit comments

Comments
 (0)