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

Target

Select target project
  • steamrt/steam-runtime-tools
1 result
Show changes
Commits on Source (717)
Showing
with 307 additions and 166 deletions
......@@ -5,9 +5,6 @@
/build/
/builddir/
/helpers/_generated_*/
/libcapsule/
/libcapsule_*.dsc
/libcapsule_*.tar.[gx]z
/obj-*/
/pressure-vessel-[0-9]*.tar.gz
/relocatable-install/
......
steam-runtime-tools (0.20210421.0) UNRELEASED; urgency=medium
steam-runtime-tools (0.20210518.0) scout; urgency=medium
* system-info: List /overrides/ correctly in recent SteamLinuxRuntime.
When pressure-vessel operates in --copy-runtime mode, /overrides is a
symlink to /usr/lib/pressure-vessel/overrides. "find /overrides -ls"
is useless here: it just lists the symlink, rather than traversing the
directory hierarchy.
* pv-wrap: Share Pipewire socket with container if available
* pv-runtime: Refactoring
* resolve-in-sysroot: Correct misleading error messages
* resolve-in-sysroot: Correctly bail out if a non-directory is found
-- Simon McVittie <smcv@collabora.com> Tue, 18 May 2021 11:22:07 +0100
steam-runtime-tools (0.20210430.0) scout; urgency=medium
[ Simon McVittie ]
* pressure-vessel: Speed up startup with cold cache by skipping
unnecessary checks
* pressure-vessel: Remove unnecessary bundled copies of vainfo and
vulkaninfo
* pv-wrap: Assume that Flatpak 1.11.x is at least 1.10.1-80-gcb47d83b
* pv-wrap: Suggest an appropriate `flatpak override` command.
The Steam Flatpak app can't have --allow=per-app-dev-shm set by
default until the Flatpak version used to build apps on Flathub's
buildbot supports it, but we need it (either that or --device=shm,
but --device=shm weakens the sandbox).
* pressure-vessel: Performance improvements, especially on systems with
slow I/O performance
- Enumerate host system graphics drivers in parallel with other
required setup
- Speed up startup with cold cache by skipping unnecessary checks
- Speed up --copy-runtime mode by not opening shared libraries
with libelf
* pressure-vessel: Add a new runtime format with unpacked files
accompanied by a mtree(5) manifest. This is more space-efficient than
deploying a tarball, and speeds up setup when running under Flatpak.
1.11.x subsandboxing. (Resolves: T27912)
* pv-wrap: Auto-detect Flatpak 1.11.x (T27612)
* pv-wrap: Suggest an appropriate `flatpak override` command if needed
* pv-wrap: Remove support for escaping from a Flatpak container.
We did this as a very early prototype, but it never fully worked, and
required configuring Flatpak specially to allow Steam to escape from the
sandbox (which obviously undermines Flatpak's intended sandboxing).
* pv-runtime: Fix some misleading log messages and comments
* pressure-vessel: Remove unnecessary bundled copies of vainfo and
vulkaninfo
* tests: Update populate-depot.py from SteamLinuxRuntime.
Adjust invocation as required.
* Refactoring
[ Ludovico de Nittis ]
* system-info: Try to detect the expansion of $LIB and $PLATFORM (T27436)
* system-info: Detect Flatpak version (T27635)
* pressure-vessel: Undo SDL_VIDEODRIVER=wayland if running in scout.
The SDL in scout is too old for this to work.
(steam-runtime#232, steam-runtime#396, T27777)
* pressure-vessel: Show a warning if $PLATFORM cannot be detected.
This would break our ability to set up VDPAU drivers.
* Refactoring
-- Simon McVittie <smcv@collabora.com> Wed, 21 Apr 2021 14:22:04 +0100
-- Simon McVittie <smcv@collabora.com> Fri, 30 Apr 2021 16:45:15 +0100
steam-runtime-tools (0.20210415.0) scout; urgency=medium
......
......@@ -9,7 +9,6 @@ Build-Depends:
gcc (>= 4:4.8) | gcc-4.8,
glslang-tools,
gtk-doc-tools <!nodoc>,
libcapsule-tools | libcapsule-tools-relocatable,
libelf-dev,
libgl1-mesa-dev | libgl-dev,
libglib2.0-dev,
......@@ -89,7 +88,6 @@ Section: misc
Depends:
${misc:Depends},
${shlibs:Depends},
libcapsule-tools-relocatable,
waffle-utils-multiarch,
Description:
The Steam Runtime is the library stack used to run the Steam client
......@@ -139,7 +137,6 @@ Architecture: amd64 i386
Multi-Arch: foreign
Depends:
bubblewrap,
libcapsule-tools-relocatable (>= 0.20201120.0),
python3 (>= 3.5) | python3.5,
steam-runtime-tools-bin,
${misc:Depends},
......@@ -157,7 +154,6 @@ Section: libs
Architecture: amd64
Multi-Arch: foreign
Depends:
libcapsule-tools-relocatable (>= 0.20201120.0),
libsteam-runtime-tools-0-helpers,
waffle-utils-multiarch,
${misc:Depends},
......@@ -172,7 +168,6 @@ Section: libs
Architecture: i386
Multi-Arch: foreign
Depends:
libcapsule-tools-relocatable (>= 0.20201120.0),
libsteam-runtime-tools-0-helpers,
waffle-utils-multiarch,
${misc:Depends},
......
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Steam Runtime tools
License: Expat and Apache-2.0 and LGPL-2.1+
Comment: SPDX-License-Identifier: MIT and Apache-2.0 and LGPL-2.1-or-later
License: Expat and Apache-2.0 and LGPL-2.1+ and Zlib
Comment: SPDX-License-Identifier: MIT and Apache-2.0 and LGPL-2.1-or-later and Zlib
Files:
*
debian/*
Copyright:
© 2019-2020 Collabora Ltd.
License: Expat
1995-1997 Peter Mattis
1995-1997 Spencer Kimball
1995-1997 Josh MacDonald
1997-2000 GLib team
1997-2020 Sam Lantinga
1999-2017 Free Software Foundation, Inc.
2000-2021 Red Hat, Inc
2010-2011 Lennart Poettering
2012-2017 Colin Walters
2013 Rinat Ibragimov
2013-2021 Collabora Ltd.
2015 Canonical Limited
2016 Zbigniew Jędrzejewski-Szmek
2017 Endless Mobile, Inc.
2018 Georges Basile Stavracas Neto
2018 Philip Withnall
License: Expat and LGPL-2+ and LGPL-2.1+ and Zlib
Files:
pressure-vessel/*
subprojects/*
tests/shellcheck.sh
helpers/check-gl.cpp
helpers/check-vulkan.c
Copyright:
2014-2019 Red Hat, Inc
2017-2019 Collabora Ltd.
License: LGPL-2.1+
2012 Arvin Schnell
2012 Rob Clark
2015 Intel Corporation
2019-2021 Collabora Ltd.
License: Apache-2.0
Files:
pressure-vessel/try-setlocale.*
subprojects/libcapsule/tests/CapsuleTestDpkg.pm
Copyright:
2019 Collabora Ltd.
License: Expat
© 2007 Raphaël Hertzog
© 2009-2010 Modestas Vainius
License: GPL-2+
Files:
build-aux/git-version-gen
subprojects/libcapsule/build-aux/git-version-gen
Copyright:
2007-2018 Free Software Foundation, Inc.
License: GPL-3+
Files:
subprojects/libglnx/*
subprojects/libcapsule/m4/ax_is_release.m4
subprojects/libcapsule/m4/capsule_matching_abi.m4
Copyright:
1995-1997 Peter Mattis
1995-1997 Spencer Kimball
1995-1997 Josh MacDonald
2010-2011 Lennart Poettering
2012-2017 Colin Walters
2015 Canonical Limited
2017 Red Hat, Inc.
2017 Endless Mobile, Inc.
2019 Collabora Ltd.
License: LGPL-2+
© 2015 Philip Withnall
© 2016-2019 Collabora Ltd.
License: Autoconf-permissive
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
......@@ -60,6 +72,11 @@ License: Apache-2.0
Comment:
SPDX-License-Identifier: Apache-2.0
License: Autoconf-permissive
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty provided the copyright notice
and this notice are preserved.
License: Expat
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
......@@ -118,6 +135,23 @@ License: LGPL-2+
Comment:
On Debian systems see /usr/share/common-licenses/LGPL-2
License: GPL-2+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Comment:
On Debian systems, the full text of the GNU General Public License
version 2 can be found in the file '/usr/share/common-licenses/GPL-2'.
License: GPL-3+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -133,3 +167,22 @@ License: GPL-3+
along with this program. If not, see <https://www.gnu.org/licenses/>.
Comment:
On Debian systems see /usr/share/common-licenses/GPL-3
License: Zlib
SPDX-License-Identifier: Zlib
.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
.
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
......@@ -61,7 +61,7 @@ package:
variables:
STEAM_CI_DEB_BUILD: full # debuild --build=full, aka -F
STEAM_CI_INSTALL_SCRIPT: |
apt-get -y install libcapsule-tools pkg-create-dbgsym
apt-get -y install pkg-create-dbgsym
package:i386:
extends: .build_package
......@@ -69,7 +69,7 @@ package:i386:
BUILD_IMAGE: registry.gitlab.steamos.cloud/steamrt/scout/sdk/i386:beta
STEAM_CI_DEB_BUILD: any # debuild --build=any, aka -B
STEAM_CI_INSTALL_SCRIPT: |
apt-get -y install libcapsule-tools pkg-create-dbgsym
apt-get -y install pkg-create-dbgsym
build:devel:
stage: build
......@@ -142,10 +142,6 @@ build:devel:
# be able to get its source code
apt-get -y dist-upgrade
apt-get -y --no-install-recommends install \
libcapsule-tools \
${NULL+}
# g++ 4.6 is too old (see also debian/rules)
export CC=gcc-4.8
export CXX=g++-4.8
......@@ -217,10 +213,6 @@ relocatable-install:
- |
apt-get -y --no-install-recommends install \
bubblewrap \
libcapsule0 \
libcapsule-tools \
libcapsule-tools-relocatable:amd64 \
libcapsule-tools-relocatable:i386 \
libglib2.0-dev \
libxau-dev \
meson \
......
......@@ -11,6 +11,10 @@ libsteam-runtime-tools-0.so.0 libsteam-runtime-tools-0-0 #MINVER#
srt_architecture_error_quark@Base 0.20201124.0
srt_architecture_get_expected_runtime_linker@Base 0.20201124.0
srt_check_library_presence@Base 0.20190801.0
srt_container_info_get_container_host_directory@Base 0.20210430.0
srt_container_info_get_container_type@Base 0.20210430.0
srt_container_info_get_flatpak_version@Base 0.20210430.0
srt_container_info_get_type@Base 0.20210430.0
srt_container_type_get_type@Base 0.20200306.0
srt_desktop_entry_get_commandline@Base 0.20200415.0
srt_desktop_entry_get_filename@Base 0.20200415.0
......@@ -135,6 +139,7 @@ libsteam-runtime-tools-0.so.0 libsteam-runtime-tools-0-0 #MINVER#
srt_system_info_can_run@Base 0.20190801.0
srt_system_info_can_write_to_uinput@Base 0.20190801.0
srt_system_info_check_all_graphics@Base 0.20190822.0
srt_system_info_check_container@Base 0.20210430.0
srt_system_info_check_graphics@Base 0.20190822.0
srt_system_info_check_libraries@Base 0.20190802.0
srt_system_info_check_library@Base 0.20190802.0
......@@ -142,6 +147,8 @@ libsteam-runtime-tools-0.so.0 libsteam-runtime-tools-0-0 #MINVER#
srt_system_info_check_runtime_linker@Base 0.20201124.0
srt_system_info_dup_container_host_directory@Base 0.20200306.0
srt_system_info_dup_expected_runtime_version@Base 0.20190816.0
srt_system_info_dup_libdl_lib@Base 0.20210430.0
srt_system_info_dup_libdl_platform@Base 0.20210430.0
srt_system_info_dup_multiarch_tuples@Base 0.20210305.0
srt_system_info_dup_os_build_id@Base 0.20190926.1
srt_system_info_dup_os_id@Base 0.20190926.1
......
......@@ -83,8 +83,6 @@ override_dh_auto_install:
$(DESTDIR)/usr/$(pkglibexecdir)/
ln -s ../../bin/$(DEB_HOST_MULTIARCH)-wflinfo \
$(DESTDIR)/usr/$(pkglibexecdir)/
ln -s ../../lib/libcapsule/relocatable/$(DEB_HOST_MULTIARCH)-capsule-capture-libs \
$(DESTDIR)/usr/$(pkglibexecdir)/
set -e; for x in $(DESTDIR)/usr/libexec/installed-tests/steam-runtime-tools-0/*; do \
if [ -f "$$x" ] \
&& cmp -s "$$x" \
......@@ -110,9 +108,8 @@ override_dh_link:
:
install -d $(relocatable_pkglibdir)
ln -fnsv ../libsteam-runtime-tools-0.so.0 $(relocatable_pkglibdir)
export PATH=/usr/lib/libcapsule/relocatable:$$PATH; \
LD_LIBRARY_PATH='$(DESTDIR)/usr/$(libdir)' \
$(DEB_HOST_MULTIARCH)-capsule-capture-libs \
$(DESTDIR)/usr/$(pkglibexecdir)/$(DEB_HOST_MULTIARCH)-capsule-capture-libs \
--container / \
--dest $(relocatable_pkglibdir) \
--link-target / \
......@@ -120,6 +117,7 @@ override_dh_link:
--provider / \
only-dependencies:path:$(DESTDIR)/usr/bin/steam-runtime-check-requirements \
only-dependencies:path:$(DESTDIR)/usr/bin/steam-runtime-system-info \
only-dependencies:path:$(DESTDIR)/usr/$(pkglibexecdir)/$(DEB_HOST_MULTIARCH)-capsule-capture-libs \
only-dependencies:path:$(DESTDIR)/usr/$(pkglibexecdir)/$(DEB_HOST_MULTIARCH)-check-locale \
$(NULL)
:
......
......@@ -6,8 +6,6 @@ dpkg --add-architecture amd64
dpkg --add-architecture i386
apt-get -y update
apt-get -y install \
libcapsule-tools-relocatable:amd64 \
libcapsule-tools-relocatable:i386 \
libsteam-runtime-tools-0-0:amd64 \
libsteam-runtime-tools-0-0:i386 \
libsteam-runtime-tools-0-helpers:amd64 \
......
// Copyright © 2021 Collabora Ltd
//
// libcapsule is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// libcapsule is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with libcapsule. If not, see <http://www.gnu.org/licenses/>.
#ifdef __GNUC__
// ELF code taken from glibc does a lot of pointer arithmetic assuming
// that (void * + integer) behaves like (char * + integer), which it does
// in gcc/clang
#pragma GCC diagnostic ignored "-Wpointer-arith"
// For fallback implementation of static_assert() */
#pragma GCC diagnostic ignored "-Wredundant-decls"
#elif defined(__clang__)
#pragma clang diagnostic ignored "-Wpointer-arith"
#pragma clang diagnostic ignored "-Wredundant-decls"
#endif
#include "subprojects/libcapsule/utils/ld-cache.c"
#include "subprojects/libcapsule/utils/ld-libs.c"
#include "subprojects/libcapsule/utils/library-cmp.c"
#include "subprojects/libcapsule/utils/tools.c"
#include "subprojects/libcapsule/utils/utils.c"
#include "subprojects/libcapsule/utils/capture-libs.c"
......@@ -215,4 +215,33 @@ elif multiarch == 'x86_64-linux-gnu'
subdir('xeon_phi')
endif
if multiarch == 'i386-linux-gnu' or multiarch == 'x86_64-linux-gnu'
if meson.version().version_compare('>=0.58.0')
# replaces deprecated source_root()
libcapsule_srcdir = meson.global_source_root() / 'subprojects' / 'libcapsule'
else
libcapsule_srcdir = meson.source_root() / 'subprojects' / 'libcapsule'
endif
# libcapsule doesn't currently have a Meson build system, so instead
# of building it as a subproject, we build our own source file that
# #includes everything we need from it.
executable(
multiarch + '-capsule-capture-libs',
'capture-libs.c',
c_args : [
'-DHOST_PREFIX="' + multiarch + '-"',
'-DPACKAGE_TARNAME="' + meson.project_name() + '"',
'-DPACKAGE_VERSION="' + meson.project_version() + '"',
],
dependencies: [libdl, libelf],
include_directories : project_include_dirs,
install : true,
install_dir : pkglibexecdir,
# Use libelf from the adjacent libdir, ignoring LD_LIBRARY_PATH
build_rpath : pkglibexec_rpath,
install_rpath : pkglibexec_rpath,
)
endif
# vim:set sw=2 sts=2 et:
......@@ -23,7 +23,7 @@
project(
'steam-runtime-tools', 'c', 'cpp',
version : '0.20210415.0',
version : '0.20210518.0',
default_options: [
'c_std=c99',
'cpp_std=c++11',
......@@ -35,7 +35,7 @@ add_languages('cpp')
api_major = '0'
abi_major = '0'
abi_minor = '20210415.0'
abi_minor = '20210518.0'
pkg = import('pkgconfig')
gnome = import('gnome')
......
......@@ -115,49 +115,11 @@ that is likely to depend on libraries from your host system, which is
good for quick turnaround and debugging, but not suitable for deployment
to the public. For that, you'll want a relocatable installation: see below.
If you are developing pressure-vessel, you might well want to alter
the bundled libcapsule tools. You can do this by building your own
copy of libcapsule. This requires 32- and 64-bit copies of libelf (the
version from elfutils) and its development files.
git clone https://gitlab.collabora.com/vivek/libcapsule.git
cd libcapsule
prefix="${XDG_DATA_HOME:-"$HOME/.local/share"}/Steam/steamapps/common/SteamLinuxRuntime/pressure-vessel"
libdir="lib/x86_64-linux-gnu"
NOCONFIGURE=1 ./autogen.sh
mkdir _build _build/i386 _build/x86_64
( cd _build/x86_64; ../../configure
--host=x86_64-linux-gnu --enable-host-prefix=x86_64-linux-gnu- \
--prefix="$prefix" --libdir="\${prefix}/$libdir" \
--disable-gtk-doc --disable-shared --without-glib )
( cd _build/i386; ../../configure
--host=i686-linux-gnu --enable-host-prefix=i386-linux-gnu- \
--prefix="$prefix" --libdir="\${prefix}/$libdir" \
--disable-gtk-doc --disable-shared --without-glib )
make -C _build/x86_64
make -C _build/i386
make -C _build/x86_64 install
make -C _build/i386 install
Use `--host=i586-linux-gnu` instead of `--host=i686-linux-gnu` if your
distribution uses that tuple for its 32-bit compiler. For the i386 build,
if you don't have an `i?86-linux-gnu-gcc` you might have to add
`CC="gcc -m32"` to the i386 configure command line.
Again, this will give you a non-production version of libcapsule that is
likely to depend on libraries from your host system.
Building a relocatable install for deployment
---------------------------------------------
To make the built version compatible with older systems, you will need
a SteamRT 1 'scout' environment.
For this, you need prebuilt versions of libcapsule-tools-relocatable:amd64
and libcapsule-tools-relocatable:i386 either in your build environment
or available via apt-get. For example, you could do the build in a
SteamRT 1 'scout' SDK Docker image that has those packages already.
Then you can do:
a SteamRT 1 'scout' environment. Then you can do:
meson --prefix="$(pwd)/_build/prefix" -Dsrcdir=src _build
ninja -C _build
......
......@@ -2,10 +2,9 @@ Third-party modules
===================
pressure-vessel includes the capsule-capture-libs utility from libcapsule,
which is licensed under [LGPL-2.1-or-later][]. See
libcapsule.txt. Complete source code can be obtained from the
same place as pressure-vessel, or from
<https://gitlab.collabora.com/vivek/libcapsule/>.
which is licensed under [LGPL-2.1-or-later][]. Complete source code can
be obtained from the same place as pressure-vessel, or from
<https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/>.
pressure-vessel incorporates code from GNOME libglnx, variously licensed
under [LGPL-2.0-or-later][] and [LGPL-2.1-or-later][].
......
......@@ -77,7 +77,6 @@ ARCHS = [
]
# package to install from => source package for copyright information
DEPENDENCIES = {
'libcapsule-tools-relocatable': 'libcapsule',
'libelf1': 'elfutils',
'waffle-utils-multiarch': 'waffle',
'zlib1g': 'zlib',
......@@ -114,10 +113,6 @@ EXECUTABLES = [
'pressure-vessel-wrap',
'steam-runtime-system-info',
]
LIBCAPSULE_TOOLS = [
'capsule-capture-libs',
'capsule-symbols',
]
def install(src, dst, mode=0o644):
......@@ -295,38 +290,13 @@ def main():
0o644,
)
for arch in ARCHS:
path = '/usr/lib/libcapsule/relocatable/{}-{}'.format(
arch.multiarch,
LIBCAPSULE_TOOLS[0],
)
if not os.path.exists(path):
package = 'libcapsule-tools-relocatable'
v_check_call([
'apt-get',
'download',
package + ':' + arch.name,
], cwd=tmpdir)
v_check_call(
'dpkg-deb -X {}_*_{}.deb build-relocatable'.format(
quote(package),
quote(arch.name),
),
cwd=tmpdir,
shell=True,
)
path = '{}/build-relocatable/{}'.format(tmpdir, path)
for tool in LIBCAPSULE_TOOLS:
install_exe(
os.path.join(
os.path.dirname(path),
'{}-{}'.format(arch.multiarch, tool),
),
os.path.join(installation, 'bin'),
)
inst_pkglibexecdir = os.path.join(
installation,
'libexec',
'steam-runtime-tools-0',
)
for arch in ARCHS:
path = os.path.join(
args.prefix, 'libexec', 'steam-runtime-tools-0',
)
......@@ -354,29 +324,21 @@ def main():
for tool in glob.glob(os.path.join(path, arch.multiarch + '-*')):
install_exe(
tool,
os.path.join(
installation,
'libexec',
'steam-runtime-tools-0',
os.path.basename(tool),
),
os.path.join(inst_pkglibexecdir, os.path.basename(tool)),
)
for shader in glob.glob(os.path.join(path, 'shaders', '*.spv')):
install(
shader,
os.path.join(
installation, 'libexec', 'steam-runtime-tools-0',
inst_pkglibexecdir,
'shaders', os.path.basename(shader),
)
)
shutil.copytree(
os.path.join(path, arch.multiarch),
os.path.join(
installation, 'libexec', 'steam-runtime-tools-0',
arch.multiarch,
),
os.path.join(inst_pkglibexecdir, arch.multiarch),
)
primary_architecture = subprocess.check_output([
......@@ -390,8 +352,8 @@ def main():
)
v_check_call([
'{}/bin/{}-capsule-capture-libs'.format(
installation,
'{}/{}-capsule-capture-libs'.format(
inst_pkglibexecdir,
arch.multiarch,
),
'--dest={}/build-relocatable/{}/lib'.format(
......@@ -415,8 +377,8 @@ def main():
libsrt_pattern = 'soname:libsteam-runtime-tools-0.so.0'
v_check_call([
'{}/bin/{}-capsule-capture-libs'.format(
installation,
'{}/{}-capsule-capture-libs'.format(
inst_pkglibexecdir,
arch.multiarch,
),
'--dest={}/build-relocatable/{}/lib'.format(
......@@ -484,12 +446,7 @@ def main():
install_exe(
path,
os.path.join(
installation,
'libexec',
'steam-runtime-tools-0',
exe,
)
os.path.join(inst_pkglibexecdir, exe)
)
# For bwrap (and possibly other programs in future) we don't have
......
......@@ -76,6 +76,7 @@ void flatpak_bwrap_add_bind_arg (FlatpakBwrap *bwrap,
const char *type,
const char *src,
const char *dest);
void flatpak_bwrap_sort_envp (FlatpakBwrap *bwrap);
gboolean flatpak_bwrap_bundle_args (FlatpakBwrap *bwrap,
int start,
int end,
......
......@@ -277,6 +277,21 @@ flatpak_bwrap_add_bind_arg (FlatpakBwrap *bwrap,
}
}
/*
* Sort bwrap->envp. This has no practical effect, but it's easier to
* see what is going on in a large environment block if the variables
* are sorted.
*/
void
flatpak_bwrap_sort_envp (FlatpakBwrap *bwrap)
{
if (bwrap->envp != NULL)
{
qsort (bwrap->envp, g_strv_length (bwrap->envp), sizeof (char *),
flatpak_envp_cmp);
}
}
gboolean
flatpak_bwrap_bundle_args (FlatpakBwrap *bwrap,
int start,
......
......@@ -92,4 +92,7 @@ null_safe_g_ptr_array_unref (gpointer data)
{
g_clear_pointer (&data, g_ptr_array_unref);
}
int flatpak_envp_cmp (const void *p1,
const void *p2);
#endif /* __FLATPAK_UTILS_H__ */
......@@ -7105,5 +7105,73 @@ flatpak_dconf_path_is_similar (const char *path1,
return (path1[i1] == '\0');
}
#endif
/**
* flatpak_envp_cmp:
* @p1: a `const char * const *`
* @p2: a `const char * const *`
*
* Compare two environment variables, given as pointers to pointers
* to the actual `KEY=value` string.
*
* In particular this is suitable for sorting a #GStrv using `qsort`.
*
* Returns: negative, 0 or positive if `*p1` compares before, equal to
* or after `*p2`
*/
int
flatpak_envp_cmp (const void *p1,
const void *p2)
{
const char * const * s1 = p1;
const char * const * s2 = p2;
size_t l1 = strlen (*s1);
size_t l2 = strlen (*s2);
size_t min;
const char *tmp;
int ret;
tmp = strchr (*s1, '=');
if (tmp != NULL)
l1 = tmp - *s1;
tmp = strchr (*s2, '=');
if (tmp != NULL)
l2 = tmp - *s2;
min = MIN (l1, l2);
ret = strncmp (*s1, *s2, min);
/* If they differ before the first '=' (if any) in either s1 or s2,
* then they are certainly different */
if (ret != 0)
return ret;
ret = strcmp (*s1, *s2);
/* If they do not differ at all, then they are equal */
if (ret == 0)
return ret;
/* FOO < FOO=..., and FOO < FOOBAR */
if ((*s1)[min] == '\0')
return -1;
/* FOO=... > FOO, and FOOBAR > FOO */
if ((*s2)[min] == '\0')
return 1;
/* FOO= < FOOBAR */
if ((*s1)[min] == '=' && (*s2)[min] != '=')
return -1;
/* FOOBAR > FOO= */
if ((*s2)[min] == '=' && (*s1)[min] != '=')
return 1;
/* Fall back to plain string comparison */
return ret;
}
......@@ -512,7 +512,7 @@ path_to_handle (GUnixFDList *fd_list,
real = realpath (path, NULL);
if (real != NULL)
after = pv_get_path_after (real, home_realpath);
after = _srt_get_path_after (real, home_realpath);
if (after != NULL)
{
......
......@@ -57,6 +57,7 @@ endforeach
# Headers to scan for enum/flags types.
headers = [
'mtree.h',
'runtime.h',
]
......@@ -83,11 +84,13 @@ pressure_vessel_utils = static_library(
'flatpak-utils-base-private.h',
'flatpak-utils.c',
'flatpak-utils-private.h',
'mtree.c',
'mtree.h',
'tree-copy.c',
'tree-copy.h',
'utils.c',
'utils.h',
],
] + enums,
c_args : pv_c_args,
dependencies : [
threads,
......@@ -206,9 +209,11 @@ executable(
'wrap.c',
'wrap-flatpak.c',
'wrap-flatpak.h',
'wrap-pipewire.c',
'wrap-pipewire.h',
'wrap-setup.c',
'wrap-setup.h',
] + enums,
],
c_args : pv_c_args,
dependencies : [
pressure_vessel_utils_dep,
......