Skip to content

Commit a8170f7

Browse files
Include girepository-2.0 as a system depdendency for Toga on Debian (#2187)
Defaults to libgirepository-2.0 on Debian-based releases, to avoid incompatibility with PyGObject 3.52.1. This change will break new apps on Debian 11, Debian 12, or Ubuntu 22.04; but there's no way to support both simultaneously. Co-authored-by: Russell Martin <russell@rjm.li>
1 parent 5770cbb commit a8170f7

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

changes/2187.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
New Toga projects on Debian-derived distributions now include ``libgirepository-2.0-0`` and ``libgirepository-2.0-dev`` as a system requirement. This is needed for support for PyGObject 3.52.1 and later.

src/briefcase/bootstraps/toga.py

+17-4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ def pyproject_table_linux(self):
6060
return """\
6161
requires = [
6262
"toga-gtk~=0.4.7",
63+
# PyGObject 3.52.1 enforces a requirement on libgirepository-2.0-dev. This library
64+
# isn't available on Debian 12/Ubuntu 22.04. If you need to support those (or older)
65+
# releases, uncomment this version pin. See beeware/toga#3143.
66+
# "pygobject < 3.52.1",
6367
]
6468
"""
6569

@@ -68,18 +72,27 @@ def pyproject_table_linux_system_debian(self):
6872
system_requires = [
6973
# Needed to compile pycairo wheel
7074
"libcairo2-dev",
71-
# Needed to compile PyGObject wheel
72-
"libgirepository1.0-dev",
75+
# One of the following two packages are needed to compile PyGObject wheel.
76+
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
77+
# If you use the older version, you'll also need to apply the pygobject pin
78+
# (see the linux requires table). See beeware/toga#3143.
79+
"libgirepository-2.0-dev",
80+
# "libgirepository1.0-dev",
7381
]
7482
7583
system_runtime_requires = [
7684
# Needed to provide GTK and its GI bindings
7785
"gir1.2-gtk-3.0",
78-
"libgirepository-1.0-1",
86+
# One of the following two packages are needed to use PyGObject at runtime.
87+
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
88+
# If you use the older version, you'll also need to apply the pygobject pin
89+
# (see the linux requires table). See beeware/toga#3143.
90+
"libgirepository-2.0-0",
91+
# "libgirepository-1.0-1",
7992
# Dependencies that GTK looks for at runtime
8093
"libcanberra-gtk3-module",
8194
# Needed to provide WebKit2 at runtime
82-
# Note: Debian 11 and Ubuntu 20.04 require gir1.2-webkit2-4.0 instead
95+
# Note: Debian 11 requires gir1.2-webkit2-4.0 instead
8396
# "gir1.2-webkit2-4.1",
8497
]
8598
"""

tests/commands/new/test_build_gui_context.py

+17-4
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,37 @@ def main():
8686
pyproject_table_linux="""\
8787
requires = [
8888
"toga-gtk~=0.4.7",
89+
# PyGObject 3.52.1 enforces a requirement on libgirepository-2.0-dev. This library
90+
# isn't available on Debian 12/Ubuntu 22.04. If you need to support those (or older)
91+
# releases, uncomment this version pin. See beeware/toga#3143.
92+
# "pygobject < 3.52.1",
8993
]
9094
""",
9195
pyproject_table_linux_system_debian="""\
9296
system_requires = [
9397
# Needed to compile pycairo wheel
9498
"libcairo2-dev",
95-
# Needed to compile PyGObject wheel
96-
"libgirepository1.0-dev",
99+
# One of the following two packages are needed to compile PyGObject wheel.
100+
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
101+
# If you use the older version, you'll also need to apply the pygobject pin
102+
# (see the linux requires table). See beeware/toga#3143.
103+
"libgirepository-2.0-dev",
104+
# "libgirepository1.0-dev",
97105
]
98106
99107
system_runtime_requires = [
100108
# Needed to provide GTK and its GI bindings
101109
"gir1.2-gtk-3.0",
102-
"libgirepository-1.0-1",
110+
# One of the following two packages are needed to use PyGObject at runtime.
111+
# Debian 12/Ubuntu 22.04 only has the older 1.0 version of the library.
112+
# If you use the older version, you'll also need to apply the pygobject pin
113+
# (see the linux requires table). See beeware/toga#3143.
114+
"libgirepository-2.0-0",
115+
# "libgirepository-1.0-1",
103116
# Dependencies that GTK looks for at runtime
104117
"libcanberra-gtk3-module",
105118
# Needed to provide WebKit2 at runtime
106-
# Note: Debian 11 and Ubuntu 20.04 require gir1.2-webkit2-4.0 instead
119+
# Note: Debian 11 requires gir1.2-webkit2-4.0 instead
107120
# "gir1.2-webkit2-4.1",
108121
]
109122
""",

0 commit comments

Comments
 (0)