Skip to content
Snippets Groups Projects
Commit 62d38ff9 authored by Simon McVittie's avatar Simon McVittie
Browse files

Optionally include fewer libraries from --gl-provider


For Mesa we don't need a few NVIDIA libraries, and for NVIDIA
we don't need Mesa's many dependencies.

In the --proposed-nvidia configuration /updates ends up empty, but we
try to bind-mount it in anyway, so make sure it is at least created.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 11ade550
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -713,7 +713,7 @@ my $flatpak_app; ...@@ -713,7 +713,7 @@ my $flatpak_app;
my $flatpak_runtime; my $flatpak_runtime;
my @multiarch_tuples = qw(x86_64-linux-gnu); my @multiarch_tuples = qw(x86_64-linux-gnu);
my $app; my $app;
my $gl_stack; my $gl_stack = 'greedy';
my $arch = 'x86_64'; my $arch = 'x86_64';
my $libc_provider_tree = 'auto'; my $libc_provider_tree = 'auto';
my $libcapsule_tree = 'container'; my $libcapsule_tree = 'container';
...@@ -749,11 +749,16 @@ Options: ...@@ -749,11 +749,16 @@ Options:
[….Games.Platform/$arch/stretch] [….Games.Platform/$arch/stretch]
--gl-provider=USR|SYSROOT Get libGL etc. from USR or SYSROOT --gl-provider=USR|SYSROOT Get libGL etc. from USR or SYSROOT
[/] [/]
--gl-stack=none|STACK Get libGL etc. from STACK/lib/MULTIARCH --gl-stack=greedy|mesa|nvidia|STACK If STACK is specified, get libGL
etc. from STACK/lib/MULTIARCH
instead of --gl-provider, but instead of --gl-provider, but
still use --gl-provider libc, libX11, still use --gl-provider libc, libX11,
libcapsule if appropriate libcapsule if appropriate.
[none] Otherwise get appropriate libraries
for Mesa, NVIDIA, or everything
we might possibly need from
--gl-provider
[greedy]
--x11-provider=auto|container|gl-provider|USR|SYSROOT --x11-provider=auto|container|gl-provider|USR|SYSROOT
Use libX11 etc. from here Use libX11 etc. from here
[auto] [auto]
...@@ -886,6 +891,7 @@ my (undef, undef, $container_libc_version) = ...@@ -886,6 +891,7 @@ my (undef, undef, $container_libc_version) =
File::Spec->splitpath($container_libc_so); File::Spec->splitpath($container_libc_so);
my $updates_tree = "$tmpdir/updates"; my $updates_tree = "$tmpdir/updates";
make_path("$tmpdir/updates", verbose => 1);
if ($libc_provider_tree eq 'auto') { if ($libc_provider_tree eq 'auto') {
if (versioncmp($container_libc_version, $gl_provider_libc_version) <= 0) { if (versioncmp($container_libc_version, $gl_provider_libc_version) <= 0) {
...@@ -926,7 +932,7 @@ else { ...@@ -926,7 +932,7 @@ else {
my @dri_path; my @dri_path;
if (defined $gl_stack && $gl_stack ne 'none') { if (defined $gl_stack && $gl_stack !~ m/^(?:greedy|mesa|nvidia)$/) {
diag "Using standalone GL stack $gl_stack"; diag "Using standalone GL stack $gl_stack";
push @bwrap, '--ro-bind', $gl_stack, '/gl'; push @bwrap, '--ro-bind', $gl_stack, '/gl';
...@@ -938,26 +944,37 @@ if (defined $gl_stack && $gl_stack ne 'none') { ...@@ -938,26 +944,37 @@ if (defined $gl_stack && $gl_stack ne 'none') {
else { else {
my $gl_provider_gl = "$tmpdir/gl"; my $gl_provider_gl = "$tmpdir/gl";
my @libs = (
qw(EGL GL GLESv1_CM GLESv2 GLX GLdispatch glx),
qr{lib(EGL|GLESv1_CM|GLESv2|GLX|drm|vdpau)_.*\.so\.[0-9]+},
);
push @libs, qw(
Xau Xdamage Xdmcp Xext Xfixes Xxf86vm
drm gbm glapi wayland-client wayland-server
xcb-dri2 xcb-dri3 xcb-present xcb-sync xcb-xfixes xshmfence
) if $gl_stack =~ m/^(?:greedy|mesa)$/;
push @libs, (
qw(cuda nvcuvid vdpau),
# We allow any extension for these, not just a single integer
qr{libnvidia-.*\.so\..*},
) if $gl_stack =~ m/^(?:greedy|nvidia)$/;
diag "Using GL stack from $gl_provider_tree"; diag "Using GL stack from $gl_provider_tree";
capture_libs_if_newer($gl_provider_tree, undef, capture_libs_if_newer($gl_provider_tree, undef,
\@multiarch_tuples, $gl_provider_gl, [ \@multiarch_tuples, $gl_provider_gl, \@libs,
qw(EGL GL GLESv1_CM GLESv2 GLX GLdispatch '/gl-provider', $ansi_green);
Xau Xdamage Xdmcp Xext Xfixes Xxf86vm
cuda drm gbm glapi glx nvcuvid vdpau if ($gl_stack =~ m/^(?:greedy|mesa)$/) {
wayland-client wayland-server diag "Updating libraries from $gl_provider_tree if necessary";
xcb-dri2 xcb-dri3 xcb-present xcb-sync xcb-xfixes xshmfence), capture_libs_if_newer($gl_provider_tree, $container_tree,
qr{lib(EGL|GLESv1_CM|GLESv2|GLX|drm|vdpau)_.*\.so\.[0-9]+}, \@multiarch_tuples, $gl_provider_gl, [
# We allow any extension for these, not just a single integer qw(bsd edit elf expat ffi gcc_s
qr{libnvidia-.*\.so\..*}, ncurses pciaccess sensors stdc++ tinfo z),
], '/gl-provider', $ansi_green); qr{libLLVM-.*\.so\.[0-9]+},
], '/gl-provider', $ansi_green);
diag "Updating libraries from $gl_provider_tree if necessary"; }
capture_libs_if_newer($gl_provider_tree, $container_tree,
\@multiarch_tuples, $gl_provider_gl, [
qw(bsd edit elf expat ffi gcc_s
ncurses pciaccess sensors stdc++ tinfo z),
qr{libLLVM-.*\.so\.[0-9]+},
], '/gl-provider', $ansi_green);
foreach my $tuple (@multiarch_tuples) { foreach my $tuple (@multiarch_tuples) {
my $ldso = multiarch_tuple_to_ldso($tuple); my $ldso = multiarch_tuple_to_ldso($tuple);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment