So would it be a good idea to force *all* ports to be relocatable? (i.e. only hardcode path relative to base path, *not* absolute path) Will this be difficult to be enforced by a lintian-like tool?
I think MacPort is mainly for user programs and libraries. Admin tools such as daemons and OS maintenance (such as stuff in /bin and /sbin) should have already been in the OS X itself rather than in MacPort. On Fri, Jul 30, 2010 at 1:42 AM, Rainer Müller <rai...@macports.org> wrote: > On 2010-07-29 11:57 , Mark Farnell wrote: >> Are there any way to make ports relocable? >> >> In OS X, applications are placed in Foo.app > > I see a lot of applications in /usr/bin. > >> whereas shared libraries (Framework) and data are placed under /Library > > There are many libraries in /usr/lib and lots of data in /usr/share. > >> If Foo.app is in /Applications, then it will look at shared data in /Library >> >> whereas >> >> if Foo.app is in $(HOME)/Applications, then it will look at shared >> data in $HOME/Library > > Isn't such data usually embedded inside the application bundle at > Contents/Resources/? > >> So under OS X, applications are relocatable > > No, application *bundles*, those special directories ending in .app, > ought to be relocatable. There are other binary files which you cannot > move around as you like. > >> So are there any way to compile ports so that the binaries are >> relocatable (i.e. look at relative path)? > > Software might hardcode the path they will look for shared data. You > would need to patch that to determine paths at runtime. > > By default the linker writes the path to each library into the binary. > There are ways to change that later with install_name_tool, but that > requires to pass -headerpad_max_install_names to the linker. > > While I am not saying it isn't possible when putting enough effort into > it, I don't think there is really a need for this feature. Users > installing to /opt/local can easily follow our documentation, our HOWTOs > or other instructions on the net. > > Rainer > _______________________________________________ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev