Bug 2372 - better 'install' make targets
Summary: better 'install' make targets
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-24 10:42 UTC by Adam Jackson
Modified: 2009-08-24 12:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch (8.40 KB, patch)
2006-04-29 21:28 UTC, Tilman Sauerbeck
Details | Splinter Review
Patch (8.29 KB, patch)
2006-05-03 00:14 UTC, Tilman Sauerbeck
Details | Splinter Review

Description Adam Jackson 2005-01-24 10:42:01 UTC
Mesa's install targets aren't good enough.  bin/installmesa is very simplistic
and doesn't take the current config into account at all.  the DRI builds would
like to put the DRI drivers in the canonical path, for example.
Comment 1 Tilman Sauerbeck 2006-04-29 21:28:16 UTC
Created attachment 5520 [details] [review]
patch

Replace bin/installmesa with various install targets. The directory to use for
the DRI drivers is now also specified in the Makefiles, so it can be easily
overridden.
Comment 2 Tilman Sauerbeck 2006-04-29 21:31:06 UTC
Forgot to mention it:
Defining PREFIX in the top level Makefile, too really sucks, but we cannot
include configs/current from it, I think :(

Ideas to fix this are appreciated.
Comment 3 Donnie Berkholz 2006-04-30 03:58:04 UTC
Haven't looked at it real closely, but the default prefix isn't consistent
within the patch. Some places it's /usr, others it's /usr/local -- should always
be the latter.
Comment 4 Tilman Sauerbeck 2006-04-30 04:04:06 UTC
Yes. Defining PREFIX in two places isn't acceptable anyway... the 2nd definition
in the top level Makefile needs to go.
Comment 5 Tilman Sauerbeck 2006-05-03 00:14:10 UTC
Created attachment 5548 [details] [review]
Patch

I don't know why I thought it was necessary to define PREFIX in the top level
Makefile. It's fixed in the new patch which works just fine.
Comment 6 Tilman Sauerbeck 2006-06-13 01:57:26 UTC
So, any comments on this? I'm willing to work more on this, but I think it's
ready for inclusion :)
Comment 7 Brian Paul 2006-06-13 09:38:05 UTC
Sorry, I kind of forgot about this and haven't had time lately to scan the bug
database.  I'll try to review this in the next week or so.
Comment 8 Brian Paul 2006-06-22 15:54:54 UTC
I've applied your patch with a number of changes.

1. Define INSTALL variable in configs/default so that it may be overridden.
2. Use two simplified install paths:  INSTALL_DIR and DRI_DRIVERS_INSTALL_DIR.
3. Fixed glut's install target.

It's kind of ugly that we need the COPY_LIBS command.  Apparently, it's just to
make up for the fact that 'install' doesn't install symlinks as symlinks.

I'm tempted to write a Mesa/bin/install shell script that'll wrap 'install' and
handle symlinks correctly, then get rid of COPY_LIBS.
Comment 9 Tilman Sauerbeck 2006-06-23 09:32:25 UTC
src/glx/x11/Makefile now says:
 EXTRA_DEFINES = ... -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_INSTALL_DIR)\"

This makes packaging more difficult than it needs to be IMO.

To create packages, I'd like to set DRI_DRIVER_INSTALL_DIR to /usr/lib/dri, set
DESTDIR to some temporary directory, so the files get copied there, then I'd tar
up DESTDIR.

With the current approach this isn't possible. I'd have to set
DRI_DRIVER_INSTALL_DIR to /usr/lib/dri for the compile stage, then set it to
/some/temp/directory/usr/lib/dri for the installation stage.

Having DESTDIR solves this problem in an elegant way, and I think it's a common
technique to build packages.

It doesn't make the Makefile look much more complicated either, most people will
just leave DESTDIR undefined and things would just work.
Comment 10 Brian Paul 2006-06-23 09:55:26 UTC
OK, I didn't know you needed to separate driver installation and search like that.

How about a 3rd variable, DRI_DRIVER_SEARCH_DIR, defaulting to
/usr/X11R6/lib/modules/dri ?

Then, EXTRA_DEFINES = ... -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\"

This way, the concepts of installation and run-time searching are kept distinct.

I found the concatenation of paths in your patch confusing.
Comment 11 Tilman Sauerbeck 2006-06-23 10:23:57 UTC
Too bad you don't like the DESTDIR approach :) but you are right, having
DRI_DRIVER_SEARCH_DIR would solve that problem, too.
Comment 12 Donnie Berkholz 2006-06-23 11:06:03 UTC
The toplevel Makefile already uses DESTDIR as the parameter to pass to
installmesa for its prefix. It should probably use PREFIX instead and pass
$(DESTDIR)$(PREFIX), where DESTDIR=/tmp/mesa or similar and PREFIX=/usr.

Here's how Gentoo currently installs:

    make \
        DESTDIR=${D}/usr \
        INCLUDE_DIR=${D}/usr/include \
        LIB_DIR=${D}/usr/lib \
        install

where D is some temporary directory, as Tilman said. It would be useful for the
DRI drivers to respect some similar setting.
Comment 13 Brian Paul 2006-06-26 08:40:37 UTC
Another problem already surfaced on the mesa3d-users list.  On some systems
libraries go into somepath/lib64/ (or lib32/) instead of somepath/lib/

Comment 14 Hanno Böck 2006-08-28 04:30:17 UTC
I think those issues are all resolved now, so this could be closed.
Comment 15 Brian Paul 2006-08-28 06:56:51 UTC
Seems to be OK now, closing.
Comment 16 Adam Jackson 2009-08-24 12:23:00 UTC
Mass version move, cvs -> git


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.