Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#5270 closed defect (fixed)

Relative PREFIX problem

Reported by: Nigel Owned by: Nigel
Priority: minor Milestone: unknown
Component: mythtv Version: unknown
Severity: medium Keywords: build
Cc: Ticket locked: no

Description

Generating relocatable packages or tarballs should be possible like this:

cd mythtv
./configure --prefix=..
make install INSTALL_ROOT=/tmp
cd ../mythplugins
./configure --prefix=..
make install INSTALL_ROOT=/tmp

but the configure in plugins will not be able to find mythconfig.mak. That is easily fixed with a copy or move of /tmp/include/mythtv, but then the linker will fail to find libmythtv-*.
Plugins doesn't currently use PREFIX in the code (i.e. at runtime), so it should be possible to modify its configure to allow something. My current thought is to use an absolute path its configure, which replaces the one in its copy of mythconfig.mak

Attachments (6)

runprefix.patch (3.9 KB) - added by Nigel 12 years ago.
Add a configure arg for a separate runtime prefix
runprefix.2.patch (5.1 KB) - added by Nigel 12 years ago.
Always get filters and plugins from PREFIX/lib, re-enable OS X runtime asset location
runprefix.3.patch (5.4 KB) - added by anonymous 12 years ago.
Compile error on 2.patch
runprefix.4.patch (7.5 KB) - added by Nigel 12 years ago.
Patch 3 had wrong path for plugins/filters, this also updates doco and win packager, moves LIBDIR down to the only dir that needs it (could also move PREFIX?)
runprefix.5.patch (8.2 KB) - added by Nigel 12 years ago.
Patch 4 was missing libmyth makefile fixes
runprefix.6.patch (8.0 KB) - added by Nigel 12 years ago.
A few fixes of v5

Download all attachments as: .zip

Change History (17)

comment:1 Changed 12 years ago by Nigel

Keywords: build added
Owner: changed from Isaac Richards to Nigel
Status: newassigned

comment:2 Changed 12 years ago by Nigel

(In [17303]) Update trunk SVNrel to 17189 (17131 had too many missing fixes). Revert parts of [17138]. Move INSTALL_ROOT from qt*env.sh files (it really has nothing to do with Qt - it is a mythtv install trick). prefix=/ causes errors:

make install
...
make[2]: Entering directory `/C/mythtv/mythtv/libs/libavutil'
mkdir: cannot create directory `/C/mythtv/build///bin/': No such file or directory

While that looks like a MinGW error, I have changed it to something that almost works for mythtv. Note that mythplugins build will not work yet. See #5270

comment:3 Changed 12 years ago by Nigel

I was wrong, using a relative PREFIX like this isn't possible - qmake won't allow it. Any relative install path always has the current directory prefixed, which means the install rules will sprinkle stuff all over the source tree.
To do what I was aiming for (have the executable open themes, filters and plugins relative to its current directory), we will need a new value passed in to MythContext, and probably in configure. (e.g. RUNTIMEPREFIX)

comment:4 Changed 12 years ago by Nigel

(In [17350]) Patch Qt 4 to work around a few issues (inspired by Arnon's work). I have sent most of these upstream to Trolltech, but it will be a while before they find their way into an official Qt Windows release? Also removed some more of [17138] because relative PREFIX won't work. See #5270

Changed 12 years ago by Nigel

Attachment: runprefix.patch added

Add a configure arg for a separate runtime prefix

comment:5 Changed 12 years ago by anonymous

OK. With that patch, people shouldn't need to use INSTALL_ROOT for sandbox building (although it doesn't remove that var yet). We should be able to do:

./configure --prefix=/tmp --runtime-prefix=..
make install
cd /tmp
tar -czvf mythtv.tar.gz bin include lib share

to generate a new mythtv tarball that it totally relocatable!

Changed 12 years ago by Nigel

Attachment: runprefix.2.patch added

Always get filters and plugins from PREFIX/lib, re-enable OS X runtime asset location

Changed 12 years ago by anonymous

Attachment: runprefix.3.patch added

Compile error on 2.patch

Changed 12 years ago by Nigel

Attachment: runprefix.4.patch added

Patch 3 had wrong path for plugins/filters, this also updates doco and win packager, moves LIBDIR down to the only dir that needs it (could also move PREFIX?)

Changed 12 years ago by Nigel

Attachment: runprefix.5.patch added

Patch 4 was missing libmyth makefile fixes

Changed 12 years ago by Nigel

Attachment: runprefix.6.patch added

A few fixes of v5

comment:6 Changed 12 years ago by Nigel

LIBDIR is also used to install filters/*, so patch 4 was a little too agressive. Moved those common make variables back to settings.pro. I also tried to use -rpath ${RUNPREFIX} to ensure that the binaries would use the libraries they were built/installed with (instead of relying on LD_LIBRARY_PATH), but got caught up in trying to pass them from g++ down to ld, and gave up. This would also be a little annoying for developers who wanted to swap between library versions by using LD_LIBRARY_PATH. [BR] Will commit this in a few hours if I don't find any testbuild problems (and no-one complains - assuming that anyone is reading)

comment:7 Changed 12 years ago by Nigel

(In [17458]) Allow relative PREFIX by implementing new --runtime-prefix configure param. See #5270, #4984.Also deprecates LIBDIR (runtime plugins/filters are relative to $prefix/lib), and INSTALL_ROOT (--prefix should work).

comment:8 Changed 12 years ago by Nigel

Resolution: fixed
Status: assignedclosed

(In [17459]) Allow relative PREFIX by implementing new --runtime-prefix configure param. Also deprecates LIBDIR (runtime plugins/filters are relative to $prefix/lib), and INSTALL_ROOT (--prefix should work). Closes #5270, #4984. Added some theme dir debug to help sort "The frontend can't find any themes..."

comment:9 Changed 11 years ago by Janne Grunau

(In [17486]) Refs #5270. set $RUNPREFIX late so that installs in different directories than /usr/local still work without specifying --runtime-prefix

comment:10 Changed 11 years ago by Nigel

(In [17487]) Oops. Janne's fix, copied from 0-21-fixes: Refs #5270. set $RUNPREFIX late so that installs in different directories than /usr/local still work without specifying --runtime-prefix

comment:11 Changed 11 years ago by Nigel

(In [17657]) Use --libdir-name=blah to find plugins and filters. Refs #5475, #5270. Also needs patching in trunk, but that will have wait several hours.

Note: See TracTickets for help on using tickets.