I also ran into this issue, trying to upgrade glib to the latest 2.82.5, on a macbookpro running Catalina and python3.13... editing glib.rb did NOT work for me... now I am looking at installing pkg-config-wrapper via brew. Tried many other 'tips', so far no luck yet.