uninstalled: Add an option to strip off the sysroot path
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 6 May 2019 20:07:28 +0000 (16:07 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 6 May 2019 20:10:59 +0000 (16:10 -0400)
As the data from meson is no longer relative path, it is not longer
possible to move gst-build around and run gst-uninstalled.py. This broke
cross-compilation usage, where you build on a host and run over NFS on
target. This adds an option to tell the script to strip off the host path
to the sysroot.

gst-uninstalled.py

index 78c5ec1..5b60039 100755 (executable)
@@ -117,6 +117,8 @@ def get_subprocess_env(options, gst_version):
     for target in targets:
         filenames = listify(target['filename'])
         for filename in filenames:
+            if filename.startswith(options.sysroot):
+                filename = filename[len(options.sysroot):]
             root = os.path.dirname(filename)
             if srcdir_path / "subprojects/gst-devtools/validate/plugins" in (srcdir_path / root).parents:
                 continue
@@ -227,6 +229,9 @@ if __name__ == "__main__":
     parser.add_argument("--srcdir",
                         default=SCRIPTDIR,
                         help="The top level source directory")
+    parser.add_argument("--sysroot",
+                        default='',
+                        help="The sysroot path used during cross-compilation")
     options, args = parser.parse_known_args()
 
     if not os.path.exists(options.builddir):