summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-04-09 13:53:09 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-04-27 10:11:58 -0700
commit08e8556f54173f8cee0b0dc90948a3b08fb7346c (patch)
tree19ca5c93d746c21f5d1f5afcb6cfb4b37b6ad56d
parentd6a312e28821bb27a0615f9a811e7c4630923377 (diff)
bin/install_megadrivers: fix DESTDIR and -D*-path
This fixes -Ddri-drivers-path, -Dvdpau-libs-path, etc. with DESTDIR when those paths are absolute. Currently due to the way python's os.path.join handles absolute paths these will ignore DESTDIR, which is bad. This fixes them to be relative to DESTDIR if that is set. Fixes: 3218056e0eb375eeda470058d06add1532acd6d4 ("meson: Build i965 and dri stack") Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> (cherry picked from commit ae3f45c11e3f934939b90445471da8f18b057bc5)
-rwxr-xr-xbin/install_megadrivers.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
index 7931a544bd2..c04a2a3eb34 100755
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding=utf-8
-# Copyright © 2017 Intel Corporation
+# Copyright © 2017-2018 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -35,7 +35,11 @@ def main():
parser.add_argument('drivers', nargs='+')
args = parser.parse_args()
- to = os.path.join(os.environ.get('MESON_INSTALL_DESTDIR_PREFIX'), args.libdir)
+ 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)
+
master = os.path.join(to, os.path.basename(args.megadriver))
if not os.path.exists(to):