Skip to content
Snippets Groups Projects

Generate mock sysroots programmatically

Merged Simon McVittie requested to merge wip/programmatic-mock-sysroots into master
1 file
+ 20
1
Compare changes
  • Side-by-side
  • Inline
+ 20
1
@@ -24,6 +24,22 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("path")
parser.add_argument('-i', '--install', action='store_true',
help='Install the sysroot in the provided [path], using $MESON_INSTALL_DESTDIR_PREFIX as a prefix')
args = parser.parse_args()
if args.install:
full_path = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], args.path.lstrip("/"))
else:
full_path = args.path
# If the chosen destination 'sysroot' is not yet available we create it
os.makedirs(full_path, mode=0o755, exist_ok=True)
os.chdir(full_path)
# Only the leaf directories need to be listed here.
for name in '''
@@ -207,7 +223,10 @@ for name, target in {
'libvdpau_radeonsi.so.1.0.0',
}.items():
os.makedirs(os.path.dirname(name), mode=0o755, exist_ok=True)
os.symlink(target, name)
try:
os.symlink(target, name)
except FileExistsError:
pass
with open('debian10/usr/lib/os-release', 'w') as writer:
writer.write('''\
Loading