Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • steamrt/steam-runtime-tools
1 result
Select Git revision
Show changes
...@@ -68,6 +68,7 @@ flatpak-example/usr/lib/mock-abi/vdpau ...@@ -68,6 +68,7 @@ flatpak-example/usr/lib/mock-abi/vdpau
flatpak-example/run/host flatpak-example/run/host
invalid-os-release/usr/lib invalid-os-release/usr/lib
invalid-os-release/run/host invalid-os-release/run/host
no-os-release/another_custom_path
no-os-release/custom_path32/dri no-os-release/custom_path32/dri
no-os-release/custom_path32/va no-os-release/custom_path32/va
no-os-release/custom_path32/vdpau no-os-release/custom_path32/vdpau
...@@ -154,6 +155,7 @@ flatpak-example/usr/lib/mock-abi/libvdpau.so.1 ...@@ -154,6 +155,7 @@ flatpak-example/usr/lib/mock-abi/libvdpau.so.1
flatpak-example/usr/lib/mock-abi/vdpau/libvdpau_radeonsi.so.1 flatpak-example/usr/lib/mock-abi/vdpau/libvdpau_radeonsi.so.1
flatpak-example/run/host/.exists flatpak-example/run/host/.exists
invalid-os-release/run/host/.exists invalid-os-release/run/host/.exists
no-os-release/another_custom_path/libvdpau_custom.so
no-os-release/custom_path32/dri/r600_dri.so no-os-release/custom_path32/dri/r600_dri.so
no-os-release/custom_path32/dri/radeon_dri.so no-os-release/custom_path32/dri/radeon_dri.so
no-os-release/custom_path32/va/r600_drv_video.so no-os-release/custom_path32/va/r600_drv_video.so
...@@ -170,6 +172,7 @@ no-os-release/usr/lib/dri/radeonsi_dri.so ...@@ -170,6 +172,7 @@ no-os-release/usr/lib/dri/radeonsi_dri.so
no-os-release/usr/lib/libGL.so.1 no-os-release/usr/lib/libGL.so.1
no-os-release/usr/lib/libva.so.1 no-os-release/usr/lib/libva.so.1
no-os-release/usr/lib/libvdpau.so.1 no-os-release/usr/lib/libvdpau.so.1
no-os-release/usr/lib/libvdpau_r9000.so
no-os-release/usr/lib/vdpau/libvdpau_nouveau.so.1 no-os-release/usr/lib/vdpau/libvdpau_nouveau.so.1
steamrt/overrides/bin/.keep steamrt/overrides/bin/.keep
steamrt/overrides/lib/x86_64-linux-gnu/libGLX_custom.so.0 steamrt/overrides/lib/x86_64-linux-gnu/libGLX_custom.so.0
......
...@@ -1899,7 +1899,7 @@ test_dri_debian10 (Fixture *f, ...@@ -1899,7 +1899,7 @@ test_dri_debian10 (Fixture *f,
gchar *sysroot; gchar *sysroot;
GList *dri; GList *dri;
GList *va_api; GList *va_api;
const gchar *multiarch_tuples[] = {"mock-debian-i386", "mock-debian-x86_64", NULL}; const gchar *multiarch_tuples[] = {"i386-mock-debian", "x86_64-mock-debian", NULL};
const gchar *dri_suffixes_i386[] = {"/lib/i386-linux-gnu/dri/i965_dri.so", const gchar *dri_suffixes_i386[] = {"/lib/i386-linux-gnu/dri/i965_dri.so",
"/lib/i386-linux-gnu/dri/r300_dri.so", "/lib/i386-linux-gnu/dri/r300_dri.so",
"/lib/i386-linux-gnu/dri/radeonsi_dri.so", "/lib/i386-linux-gnu/dri/radeonsi_dri.so",
...@@ -1985,7 +1985,7 @@ test_dri_fedora (Fixture *f, ...@@ -1985,7 +1985,7 @@ test_dri_fedora (Fixture *f,
gchar *sysroot; gchar *sysroot;
GList *dri; GList *dri;
GList *va_api; GList *va_api;
const gchar *multiarch_tuples[] = {"mock-fedora-32-bit", "mock-fedora-64-bit", NULL}; const gchar *multiarch_tuples[] = {"i386-mock-fedora", "x86_64-mock-fedora", NULL};
const gchar *dri_suffixes_32[] = {"/usr/lib/dri/i965_dri.so", const gchar *dri_suffixes_32[] = {"/usr/lib/dri/i965_dri.so",
"/usr/lib/dri/r300_dri.so", "/usr/lib/dri/r300_dri.so",
"/usr/lib/dri/radeonsi_dri.so", "/usr/lib/dri/radeonsi_dri.so",
...@@ -2100,7 +2100,7 @@ test_dri_with_env (Fixture *f, ...@@ -2100,7 +2100,7 @@ test_dri_with_env (Fixture *f,
gchar *libva_combined; gchar *libva_combined;
GList *dri; GList *dri;
GList *va_api; GList *va_api;
const gchar *multiarch_tuples[] = {"mock-fedora-32-bit", NULL}; const gchar *multiarch_tuples[] = {"i386-mock-fedora", NULL};
const gchar *dri_suffixes[] = {"/custom_path32/dri/r600_dri.so", const gchar *dri_suffixes[] = {"/custom_path32/dri/r600_dri.so",
"/custom_path32/dri/radeon_dri.so", "/custom_path32/dri/radeon_dri.so",
"/custom_path32_2/dri/r300_dri.so", "/custom_path32_2/dri/r300_dri.so",
...@@ -2270,15 +2270,17 @@ typedef struct ...@@ -2270,15 +2270,17 @@ typedef struct
const gchar *sysroot; const gchar *sysroot;
const gchar *vdpau_suffixes[5]; const gchar *vdpau_suffixes[5];
const gchar *vdpau_links[5]; const gchar *vdpau_links[5];
const gchar *vdpau_suffixes_extra[5]; const gchar *vdpau_suffixes_extra[6];
const gchar *vdpau_path_env; const gchar *vdpau_path_env;
const gchar *vdpau_driver_env;
const gchar *ld_library_path_env;
} VdpauTest; } VdpauTest;
static const VdpauTest vdpau_test[] = static const VdpauTest vdpau_test[] =
{ {
{ {
.description = "debian 10 i386", .description = "debian 10 i386",
.multiarch_tuple = "mock-debian-i386", .multiarch_tuple = "i386-mock-debian",
.sysroot = "debian10", .sysroot = "debian10",
.vdpau_suffixes = .vdpau_suffixes =
{ {
...@@ -2298,7 +2300,7 @@ static const VdpauTest vdpau_test[] = ...@@ -2298,7 +2300,7 @@ static const VdpauTest vdpau_test[] =
{ {
.description = "debian 10 x86_64", .description = "debian 10 x86_64",
.multiarch_tuple = "mock-debian-x86_64", .multiarch_tuple = "x86_64-mock-debian",
.sysroot = "debian10", .sysroot = "debian10",
.vdpau_suffixes = .vdpau_suffixes =
{ {
...@@ -2320,7 +2322,7 @@ static const VdpauTest vdpau_test[] = ...@@ -2320,7 +2322,7 @@ static const VdpauTest vdpau_test[] =
{ {
.description = "fedora 32 bit", .description = "fedora 32 bit",
.multiarch_tuple = "mock-fedora-32-bit", .multiarch_tuple = "i386-mock-fedora",
.sysroot = "fedora", .sysroot = "fedora",
.vdpau_suffixes = .vdpau_suffixes =
{ {
...@@ -2341,7 +2343,7 @@ static const VdpauTest vdpau_test[] = ...@@ -2341,7 +2343,7 @@ static const VdpauTest vdpau_test[] =
{ {
.description = "fedora 64 bit", .description = "fedora 64 bit",
.multiarch_tuple = "mock-fedora-64-bit", .multiarch_tuple = "x86_64-mock-fedora",
.sysroot = "fedora", .sysroot = "fedora",
.vdpau_suffixes = .vdpau_suffixes =
{ {
...@@ -2362,7 +2364,7 @@ static const VdpauTest vdpau_test[] = ...@@ -2362,7 +2364,7 @@ static const VdpauTest vdpau_test[] =
{ {
.description = "vdpau with environment", .description = "vdpau with environment",
.multiarch_tuple = "mock-fedora-32-bit", .multiarch_tuple = "i386-mock-fedora",
.sysroot = "no-os-release", .sysroot = "no-os-release",
.vdpau_suffixes = .vdpau_suffixes =
{ {
...@@ -2375,9 +2377,13 @@ static const VdpauTest vdpau_test[] = ...@@ -2375,9 +2377,13 @@ static const VdpauTest vdpau_test[] =
"/custom_path32/vdpau/libvdpau_r600.so.1", "/custom_path32/vdpau/libvdpau_r600.so.1",
"/custom_path32/vdpau/libvdpau_radeonsi.so.1", "/custom_path32/vdpau/libvdpau_radeonsi.so.1",
"/usr/lib/vdpau/libvdpau_nouveau.so.1", "/usr/lib/vdpau/libvdpau_nouveau.so.1",
"/another_custom_path/libvdpau_custom.so",
"/usr/lib/libvdpau_r9000.so",
NULL NULL
}, },
.vdpau_path_env = "custom_path32" .vdpau_path_env = "custom_path32",
.vdpau_driver_env = "r9000",
.ld_library_path_env = "another_custom_path",
}, },
{ {
...@@ -2402,6 +2408,7 @@ test_vdpau (Fixture *f, ...@@ -2402,6 +2408,7 @@ test_vdpau (Fixture *f,
SrtSystemInfo *info; SrtSystemInfo *info;
gchar **envp; gchar **envp;
gchar *sysroot; gchar *sysroot;
gchar *ld_library_path = NULL;
gchar *vdpau_path = NULL; gchar *vdpau_path = NULL;
gchar *vdpau_relative_path = NULL; gchar *vdpau_relative_path = NULL;
GList *vdpau; GList *vdpau;
...@@ -2423,6 +2430,21 @@ test_vdpau (Fixture *f, ...@@ -2423,6 +2430,21 @@ test_vdpau (Fixture *f,
envp = g_environ_setenv (envp, "VDPAU_DRIVER_PATH", vdpau_path, TRUE); envp = g_environ_setenv (envp, "VDPAU_DRIVER_PATH", vdpau_path, TRUE);
} }
if (test->vdpau_driver_env == NULL)
envp = g_environ_unsetenv (envp, "VDPAU_DRIVER");
else
envp = g_environ_setenv (envp, "VDPAU_DRIVER", test->vdpau_driver_env, TRUE);
if (test->ld_library_path_env == NULL)
{
envp = g_environ_unsetenv (envp, "LD_LIBRARY_PATH");
}
else
{
ld_library_path = g_build_filename (sysroot, test->ld_library_path_env, NULL);
envp = g_environ_setenv (envp, "LD_LIBRARY_PATH", ld_library_path, TRUE);
}
info = srt_system_info_new (NULL); info = srt_system_info_new (NULL);
srt_system_info_set_environ (info, envp); srt_system_info_set_environ (info, envp);
srt_system_info_set_sysroot (info, sysroot); srt_system_info_set_sysroot (info, sysroot);
...@@ -2464,6 +2486,7 @@ test_vdpau (Fixture *f, ...@@ -2464,6 +2486,7 @@ test_vdpau (Fixture *f,
g_object_unref (info); g_object_unref (info);
g_free (sysroot); g_free (sysroot);
g_free (ld_library_path);
g_free (vdpau_path); g_free (vdpau_path);
g_free (vdpau_relative_path); g_free (vdpau_relative_path);
g_strfreev (envp); g_strfreev (envp);
......
...@@ -42,6 +42,7 @@ main (int argc, ...@@ -42,6 +42,7 @@ main (int argc,
g_strstr_len (argv[1], -1, "/lib32/dri/") != NULL || g_strstr_len (argv[1], -1, "/lib32/dri/") != NULL ||
g_strstr_len (argv[1], -1, "/lib/dri/") != NULL || g_strstr_len (argv[1], -1, "/lib/dri/") != NULL ||
g_strstr_len (argv[1], -1, "/lib/vdpau/") != NULL || g_strstr_len (argv[1], -1, "/lib/vdpau/") != NULL ||
g_strstr_len (argv[1], -1, "/another_custom_path/") != NULL ||
g_strstr_len (argv[1], -1, "/custom_path32/") != NULL || g_strstr_len (argv[1], -1, "/custom_path32/") != NULL ||
g_strstr_len (argv[1], -1, "/custom_path32_2/") != NULL) g_strstr_len (argv[1], -1, "/custom_path32_2/") != NULL)
{ {
......
...@@ -29,6 +29,7 @@ test_env.prepend('PATH', join_paths(meson.current_build_dir(), '..', 'bin')) ...@@ -29,6 +29,7 @@ test_env.prepend('PATH', join_paths(meson.current_build_dir(), '..', 'bin'))
tests = [ tests = [
'architecture', 'architecture',
'check-requirements-cli',
'desktop-entry', 'desktop-entry',
'graphics', 'graphics',
'library', 'library',
...@@ -232,10 +233,10 @@ endforeach ...@@ -232,10 +233,10 @@ endforeach
foreach helper : [ foreach helper : [
'mock-abi-inspect-library', 'mock-abi-inspect-library',
'mock-bad-wflinfo', 'mock-bad-wflinfo',
'mock-debian-x86_64-inspect-library', 'x86_64-mock-debian-inspect-library',
'mock-debian-i386-inspect-library', 'i386-mock-debian-inspect-library',
'mock-fedora-64-bit-inspect-library', 'x86_64-mock-fedora-inspect-library',
'mock-fedora-32-bit-inspect-library', 'i386-mock-fedora-inspect-library',
'mock-good-wflinfo', 'mock-good-wflinfo',
'mock-mixed-check-gl', 'mock-mixed-check-gl',
'mock-software-wflinfo', 'mock-software-wflinfo',
...@@ -260,6 +261,7 @@ foreach arch : [ ...@@ -260,6 +261,7 @@ foreach arch : [
foreach helper : [ foreach helper : [
'mock-container-capsule-capture-libs', 'mock-container-capsule-capture-libs',
'mock-debian-capsule-capture-libs', 'mock-debian-capsule-capture-libs',
'mock-fedora-capsule-capture-libs',
] ]
executable( executable(
arch + '-' + helper, arch + '-' + helper,
......
...@@ -50,6 +50,11 @@ main (int argc, ...@@ -50,6 +50,11 @@ main (int argc,
g_return_val_if_fail (argc > 3, EXIT_FAILURE); g_return_val_if_fail (argc > 3, EXIT_FAILURE);
g_return_val_if_fail (g_strcmp0 (argv[1], "--dest") == 0, EXIT_FAILURE); g_return_val_if_fail (g_strcmp0 (argv[1], "--dest") == 0, EXIT_FAILURE);
const gchar *soname_match = g_strrstr (argv[3], "libGLX_");
/* We are using this capsule-capture-libs just for libGLX*. Discard every other request */
if (soname_match == NULL)
return EXIT_SUCCESS;
for (gsize i = 0; sonames[i] != NULL; i++) for (gsize i = 0; sonames[i] != NULL; i++)
{ {
file_path = g_build_filename (argv[2], sonames[i], NULL); file_path = g_build_filename (argv[2], sonames[i], NULL);
......
/*
* Copyright © 2020 Collabora Ltd.
*
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <steam-runtime-tools/glib-compat.h>
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include <gio/gio.h>
int
main (int argc,
char **argv)
{
GError *error = NULL;
gchar *file_path = NULL;
gchar *target = NULL;
GFile *file = NULL;
const gchar *soname_match = NULL;
GPtrArray *found = NULL;
#if defined(MOCK_ARCHITECTURE_x86_64)
static const char *const sonames[] = { "libvdpau_r9000.so", NULL };
/* We don't use the x86_64 version yet */
return EXIT_FAILURE;
#else
static const char *const sonames[] = { "libvdpau_r9000.so", NULL };
#endif
g_return_val_if_fail (argc > 3, EXIT_FAILURE);
g_return_val_if_fail (g_strcmp0 (argv[1], "--dest") == 0, EXIT_FAILURE);
found = g_ptr_array_new_with_free_func (g_free);
/* Currently we are using this just for VDPAU. Discard every other request.
* Also we mimic a system where a wildcard-matching search will return no
* results. */
for (gsize i = 0; sonames[i] != NULL; i++)
{
for (gsize j = 3; argv[j] != NULL; j++)
{
soname_match = g_strrstr (argv[j], sonames[i]);
if (soname_match != NULL)
g_ptr_array_add (found, g_strdup (sonames[i]));
}
}
for (gsize i = 0; i < found->len; i++)
{
file_path = g_build_filename (argv[2], found->pdata[i], NULL);
file = g_file_new_for_path (file_path);
target = g_build_filename ("/usr/lib", found->pdata[i], NULL);
if (!g_file_make_symbolic_link (file, target, NULL, &error))
{
g_critical ("An error occurred creating a symlink: %s", error->message);
g_clear_error (&error);
g_clear_pointer (&file, g_object_unref);
g_free (file_path);
g_free (target);
return EXIT_FAILURE;
}
g_clear_pointer (&file, g_object_unref);
g_free (file_path);
g_free (target);
}
g_ptr_array_free (found, TRUE);
return EXIT_SUCCESS;
}
...@@ -132,6 +132,8 @@ libraries_presence (Fixture *f, ...@@ -132,6 +132,8 @@ libraries_presence (Fixture *f,
g_assert_true (json_object_has_member (json, "driver_environment")); g_assert_true (json_object_has_member (json, "driver_environment"));
g_assert_true (json_object_has_member (json, "cpu-features"));
g_assert_true (json_object_has_member (json, "architectures")); g_assert_true (json_object_has_member (json, "architectures"));
json = json_object_get_object_member (json, "architectures"); json = json_object_get_object_member (json, "architectures");
......