How can I update the pygobject recipe?

I’m trying to update the recipe for pygobject. The version currently used is 3.50.0, but there are issues using element properties that are enums.

These MRs fix that and are in pygobject 3.53+.

Fix paramspec for enum and flags (!432) · Merge requests · GNOME / pygobject · GitLab

Add `_enum|flags_values_` back to GEnum and GFlags (!420) · Merge requests · GNOME / pygobject · GitLab

Also this issue I posted:

I tried to edit the pygobject.recipe file to use a different version, but the build failed.

class Recipe(recipe.Recipe):
name = ‘pygobject’
version = ‘3.54.2’
stype = SourceType.TARBALL
btype = BuildType.MESON
url = f’https://download.gnome.org/sources/pygobject/{version[0:4]}/pygobject-{version}.tar.gz’
url = ‘gnome://’
licenses = [{License.LGPLv2_1Plus: [‘COPYING’]}]

deps = ['pycairo', 'gobject-introspection', 'libffi']
tarball_checksum = '03cffeb49d8a1879b621d8f606ac904218019a0ae699b1cd3780a8ee611e696b'
meson_options = {
    'tests': False,
}

From the download page:

03cffeb49d8a1879b621d8f606ac904218019a0ae699b1cd3780a8ee611e696b  pygobject-3.54.2.tar.gz

The pygobject-fetch.log file has:

Downloading https://download.gnome.org/sources/pygobject/3.54/pygobject-3.54.2.tar.xz
Running command [‘powershell’, ‘-Command’, “Set-Variable -Name ProgressPreference -Value ‘SilentlyContinue’; Invoke-WebRequest -UserAgent GStreamerCerbero/1.26.7 -OutFile C:/Users/Tim/.cache/cerbero-sources/pygobject-3.54.2/pygobject-3.54.2.tar.xz -Method Get -Uri https://download.gnome.org/sources/pygobject/3.54/pygobject-3.54.2.tar.xz”\] in .
Invoke-WebRequest : 404 Not Found

Why is it looking for a file with extension “xz” when the recipe and download page has “gz”?

Recipe has two urls

url = f'https://download.gnome.org/sources/pygobject/{version[0:4]}/pygobject-{version}.tar.xz'
url = 'gnome://'

The first one is overwritten by the second one.

gnome:// is defined here:

    'gnome': ('https://download.gnome.org/sources/', '%(name)s/%(maj_ver)s/%(name)s-%(version)s', '.tar.xz'),

Where xz us hadcoded.

Simple solution is drop the second definition of url = 'gnome://' and keep only a explicit one:

class Recipe(recipe.Recipe):
    name = 'pygobject'
    version = '3.54.3'
    stype = SourceType.TARBALL
    btype = BuildType.MESON
    url = f'https://download.gnome.org/sources/pygobject/{version[0:4]}/pygobject-{version}.tar.gz'
    licenses = [{License.LGPLv2_1Plus: ['COPYING']}]

Thanks! That did it.

I guess my question now is: Why 2 urls? I can see that the second one would be a fallback URL if the first one was invalid or not available, but if the first one is good, why use the second one?

Looking at the template, the address is the same, it’s just that the extension in now invalid (obsolete?)

BTW, I needed to take out the patch, since it got merged in 3.53.0.

Looks like I do need that patch.

>>> import gi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\opt\msvc_x86_64\lib\site-packages\gi\__init__.py", line 40, in <module>
    from . import _gi
ImportError: DLL load failed while importing _gi: The specified module could not be found.
>>> ^Z

(py312) PS C:\Users\Tim> python
Python 3.12.10 (tags/v3.12.10:0cc8128, Apr  8 2025, 12:21:36) [MSC v.1943 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.add_dll_directory(r'D:\opt\msvc_x86_64\bin')
<AddedDllDirectory('D:\\opt\\msvc_x86_64\\bin')>
>>> import gi
>>> gi
<module 'gi' from 'D:\\opt\\msvc_x86_64\\lib\\site-packages\\gi\\__init__.py'>
>>> gi.version_info
(3, 54, 2)

gi/__init__.py file changed enough that I need to find another patch, or edit the current one.

Running command ['C:/Program Files/Git/cmd/git.EXE', 'am', '--ignore-whitespace', 'D:/GitClones/cerbero/recipes/pygobject/0001-gi-
Call-os.add_dll_directory-on-Windows-when-possibl.patch'] in D:/GitClones/cerbero/build/sources/msvc_x86_64/pygobject-3.54.2
error: patch failed: gi/__init__.py:36
error: gi/__init__.py: patch does not apply
Applying: gi: Call os.add_dll_directory() on Windows when possible
Patch failed at 0001 gi: Call os.add_dll_directory() on Windows when possible
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"

It’s a bug. Feel free to fix it. The Recipe is simply a Python class; having two URLs doesn’t mean anything.

I need to find another patch, or edit the current one

Sure, you will need to update the patch because the MR is not merged yet :disappointed_face: .

How do you do that? I use git, but I’m not all that proficient in it.

In the web you can see the MR status is “open”.

I know. I commented on it, hoping to get some action on the pipeline.