After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 692597 - patch to allow relocation on Linux, and first step to integrating cross-platform relocation
patch to allow relocation on Linux, and first step to integrating cross-platf...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: Other
2.24.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-01-26 19:30 UTC by Paul Davis
Modified: 2018-04-15 00:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to add/generalize relocation for GTK (12.60 KB, patch)
2013-01-26 19:30 UTC, Paul Davis
needs-work Details | Review

Description Paul Davis 2013-01-26 19:30:53 UTC
Created attachment 234490 [details] [review]
Patch to add/generalize relocation for GTK

The attached patch against gtk-2-24 provides --enable-relocation which builds GTK so that GTK_{DATA,LIB,LOCALEDIR,SYSCONF}DIR and GTK_DATA_DIR are determined at runtime, not build time. The paths are determined relative to the location of the executable file used to exec the calling process, BUT the value may also set by defining the environment variables GTK_BUNDLEDIR or any of GTK_{DATA,LIB,LOCALEDIR,SYSCONF}DIR and GTK_DATA_DIR to override the location or provide a different packaging strategy.

GTK already had code for doing this on Quartz - this has been merged into the new file gtkrelocation.c, and the old --enable-quartz-relocation has been made equivalent to --enable-relocation.

Provision has been made for merging the existing Windows relocation code too, but this has not been done at this time because the Windows version behaves in a more complex fashion that I do not believe is necessary but would rather defer to those who understand why it behaves as it currently does.
Comment 1 Christian Persch 2013-01-27 12:19:03 UTC
Review of attachment 234490 [details] [review]:

::: gtk/gtkrelocation.c
@@ +1,3 @@
+/* gtklinuxrelocation: functions used to provide relocation on Linux
+ *
+ * Copyright (C) 2013 Whomsoever

Really??

_br_find_exe at least is clearly copied from BinReloc, so its author definitely should get credit here.
Comment 2 Paul Davis 2013-01-28 17:01:32 UTC
the "Whomsoever" was a placeholder until the full credits could be identified. several different people deserve credit here.
Comment 3 Matthias Clasen 2013-03-12 12:46:57 UTC
Review of attachment 234490 [details] [review]:

I'm missing the documentation part that would explain how one is expected to use this.

If we want to go for this, the implementations of _gtk_...dir shouldn't be spread across multiple files. Put it all into one file, with all the ifdeffery in one place. It seems with your patch, we have _gtk_get_...dir implementations in both gtkprivate.c and gtkrelocation.c ?

::: gtk/gtkrelocation.c
@@ +71,3 @@
+static char *
+_br_find_exe (gint *error)
+{

This entire function has the wrong coding style.
Comment 4 Paul Davis 2013-03-12 13:02:04 UTC
(1) i didn't move the windows stuff in here for now, just because it was an initial pass at the overall idea. moving them in is easy, since the ones for linux and OS X are modelled on them. moving them all here would remove any relocation code from gtkprivate.c and it would all be in gtkrelocation.c. if there is serious interest in the idea, i can do another patch with everything merged into one location.

(2) the br_find_exe() code comes from another project (via GIMP) and I did not reformat it. same rationale as (1), but simple to fix.

(3) what form would you want the documentation in? doxygen inline? web text? i'm happy to write it up.
Comment 5 Matthias Clasen 2018-02-10 05:25:32 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 6 Paul Davis 2018-02-10 13:46:02 UTC
Will there ever be actual interest in making GTK+ relocatable on *nix systems?
Comment 7 Matthias Clasen 2018-04-15 00:34:40 UTC
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla.

If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab:

https://gitlab.gnome.org/GNOME/gtk/issues/new