Changes between Initial Version and Version 1 of Ticket #62391, comment 4


Ignore:
Timestamp:
Mar 9, 2021, 7:25:43 PM (3 years ago)
Author:
VinDuv
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #62391, comment 4

    initial v1  
    5555
    5656I’ll try to modify `g-ir-scanner` to see if I can fix those issues on my machine.
     57
     58Update: I tried the following changes (patches attached):
     59 - Modify `dumper.py` so it sorts the library paths after uniquing them (1) and does not modify the global `options.library_paths` (2)
     60 - Modify `shlibs.py` so a path that does not start with `/` is considered a build path, and ignored (3)
     61
     62I then rebuilt from source all the packages, with the following results:
     63 - `g-ir-scanner` executes successfully on all packages
     64 - It generates the same files as before, except on `shared-library` attributes, as expected
     65 - All the incorrect relative paths `./directory/libsomething.dylib` are now `/opt/local/lib/libsomething.dylib` and the libraries actually exist at the specified paths.
     66
     67The only two remaining issues are:
     68 - The incorrect path `libavahi-core.so.7` in the `AvahiCore-0.6.gir` from package `avahi`. Looking at the package source, it seems that this `.gir` file is not generated by `g-ir-scanner` but is part of the sources, so this can only be fixed by modifying the `avahi` package.
     69 - The incorrect `.gir` files from the `webkit2-gtk` package come from the fact that the library path given to `g-ir-scanner` is
     70{{{
     71/opt/local/var/macports/build/.../webkit2-gtk/work/build/lib
     72}}}
     73  but the current working directory is
     74{{{
     75/opt/local/var/macports/build/.../webkit2-gtk/work/build/Source/WebKit
     76}}}
     77Since it’s not a prefix of the library path, the library path is not detected as a build path and is used as the final library path in the `.gir` file.
     78This could probably be fixed by changing the heuristic used by `g-ir-scanner` (use the last library path instead of the first? It seems to be `/opt/local/lib` more consistently) but could break other packages.