GNOME Bugzilla – Bug 724885
GI tools are not relocatable on W32
Last modified: 2018-02-08 12:26:58 UTC
GI needs libdir and datadir. Hardcoding @datarootdir@ and @libdir@ doesn't cut it on W32. A more generic solution is to remember @prefix@, get actual prefix at runtime by checking the parents directories for well-known subdirs (bin, lib, libexec, etc). Then append data and lib directories to runtime prefix (after stripping compile-time prefix from them).
Created attachment 269911 [details] [review] Make g-ir-* relocatable (W32)
Review of attachment 269911 [details] [review]: Hi LRN, I took a look at your patch, but I am more inclined to favor Dieter's patch for the same purpose at bug 620566 comment #5, as: -It's simpler, and most other GNOME items use the relocatable capabilities of GLib (g_win32_get_installation_directory_of_module () for instance) directly when on Windows. -It seems to be already deemed acceptable by the other devs. Is it okay that you try that patch instead and see whether it works for you? With blessings, thank you!
Aside from minute details (use of sys.argv[0] vs __file__), the difference between 620566 and this are: 1) 620566 assumes g-ir-* are installed in <prefix>/<subdirectory> (subdirectory name does not matter). My patch assumes that g-ir-* are installed somewhere in the tree - i.e. prefix is one of the [grand]parent directories that contains a subdirectory from the known subdir list (bin, lib, etc...). 2) 620566 assumes that datadir is <prefix>/share and libdir is <prefix>/lib/gobject-introspection. My patch takes libdir and datadir as given by the configure script I suspect that there will be people who will be unhappy about 620566's assumptions in (2). (1) - probably not so much. Note that finding the prefix and making datadir/libdir path are two separate steps, so if my prefix-finding algorithm seems to be too fancy, it's possible to replace it with the simple one from 620566 and keep the datadir/libdir path derivation from my path.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/106.