<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - If DESTDIR is set to an empty string, the dri drivers are not installed"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=110211">110211</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>If DESTDIR is set to an empty string, the dri drivers are not installed
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>19.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>pierre.labastie@neuf.fr
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Dear maintainer,

The script "bin/install_megadrivers.py" contains the following:
---
if os.path.isabs(args.libdir):
        to = os.path.join(os.environ.get('DESTDIR', '/'), args.libdir[1:])
    else:
        to = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'],
args.libdir)
---
The issue is when libdir is absolute, and DESTDIR is set to the empty string.
This is very likely to occur in build scripts of the form (many of us at
<a href="http://www.linuxfromscratch.org">http://www.linuxfromscratch.org</a> do that):
---
#PKG_DEST=/some/where
...
DESTDIR=$PKG_DEST ninja install
---
where we comment out the PKG_DEST assignment or not, depending on whether we
want a DESTDIR install or not.

Then the "to" variable becomes a relative path, and the drivers are not
installed. This is not really what is expected, I guess. I'd suggest using (but
I am far from being a Python geek):
---
if os.path.isabs(args.libdir):
        to = os.path.join(os.environ.get('DESTDIR', ''), args.libdir)
---
That worked for me in all cases I have tried (may not have thought of all of
them...)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>