├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ └── ISSUE_TEMPLATE.md ├── .gitignore ├── COPYING ├── Makefile ├── README.md ├── build-runtime.py ├── doc ├── building-custom-runtime.md ├── debug-symbols.md ├── goals.md ├── possible-designs.md ├── reporting-steamlinuxruntime-bugs.md └── steamlinuxruntime-known-issues.md ├── setup_chroot.sh ├── templates ├── COPYING ├── README.txt ├── common-licenses │ ├── Apache-2.0 │ ├── Artistic │ ├── BSD │ ├── GFDL │ ├── GFDL-1.2 │ ├── GFDL-1.3 │ ├── GPL │ ├── GPL-1 │ ├── GPL-2 │ ├── GPL-3 │ ├── LGPL │ ├── LGPL-2 │ ├── LGPL-2.1 │ └── LGPL-3 ├── run.sh ├── scripts │ ├── README.txt │ ├── check-program.sh │ ├── check-runtime-conflicts.sh │ ├── check-runtime-consistency.sh │ ├── check-symlinks.sh │ ├── fix-debuglinks.sh │ ├── fix-symlinks.sh │ └── switch-runtime.sh └── setup.sh ├── tests ├── build-runtime.py ├── mypy.sh ├── pycodestyle.sh ├── pyflakes.sh ├── read-manifests.py ├── shellcheck.sh └── third-party │ └── pycotap.py ├── ubuntu-archive-keyring.gpg └── write-manifest /.gitattributes: -------------------------------------------------------------------------------- 1 | # Stop license files from skewing language-stats on GitHub 2 | templates/common-licenses/* linguist-documentation linguist-language=Text 3 | 4 | # Enforce Unix-style line-endings for shell-scripts 5 | *.sh text eol=lf 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Issues with the Steam runtime 4 | 5 | --- 6 | 7 | #### Your system information 8 | 9 | * Steam Runtime Version: 10 | * Distribution (e.g. Ubuntu 18.04): 11 | * Link to your full system information (Help -> Steam Runtime Diagnostics) in a [Gist](https://gist.github.com/): 12 | * Have you checked for system updates?: [Yes/No] 13 | * What compatibility tool are you using?: [None / Steam Linux Runtime / Proton 5.13+ / older Proton] 14 | * What versions are listed in `steamapps/common/SteamLinuxRuntime/VERSIONS.txt`? 15 | * What versions are listed in `steamapps/common/SteamLinuxRuntime_soldier/VERSIONS.txt`? 16 | * What versions are listed in `steamapps/common/SteamLinuxRuntime_sniper/VERSIONS.txt`? 17 | 18 | #### Please describe your issue in as much detail as possible: 19 | 20 | 21 | 26 | 27 | #### Steps for reproducing this issue: 28 | 29 | 1. 30 | 2. 31 | 3. 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | p4.ignore 2 | build.log 3 | buildroot/amd64/ 4 | buildroot/i386/ 5 | buildroot/pbuilder/ 6 | crosstool/amd64/.build/ 7 | crosstool/crosstool-ng/ 8 | crosstool/i386/.build/ 9 | crosstool/tarballs/ 10 | packages/binary/ 11 | packages/debug/ 12 | packages/source/ 13 | /runtime/ 14 | publish_symbols.sh 15 | do-buildbot-build.sh 16 | merge_hg_to_runtime.sh 17 | x-tools 18 | tmp/ 19 | newpkg/ 20 | /ubuntu-precise-core-cloudimg-* 21 | /steam-runtime-*.built-using.txt 22 | /steam-runtime-*.deb822.gz 23 | /steam-runtime-*.manifest.txt 24 | /steam-runtime-*.sources.txt 25 | /steam-runtime-*.tar.gz 26 | /steam-runtime-*.tar.xz 27 | /steam-runtime-sdk-chroot-*.deb822.gz 28 | /steam-runtime-sdk-chroot-*.tar.gz 29 | /steam-runtime-sdk-chroot-*.txt 30 | /unofficial-steam-runtime-*.built-using.txt 31 | /unofficial-steam-runtime-*.deb822.gz 32 | /unofficial-steam-runtime-*.manifest.txt 33 | /unofficial-steam-runtime-*.sources.txt 34 | /unofficial-steam-runtime-*.tar.xz 35 | /unofficial-steam-runtime-sdk-chroot-*.deb822.gz 36 | /unofficial-steam-runtime-sdk-chroot-*.tar.gz 37 | /unofficial-steam-runtime-sdk-chroot-*.txt 38 | *.pyc 39 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | 2 | This is a collection of software packages and scripts to build them. 3 | The individual packages each have their own licensing terms included with them. 4 | 5 | The scripts and other documentation contributed by Valve are covered under 6 | the following copyright notice: 7 | 8 | Copyright (C) 2013 Valve Corporation 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy of these scripts 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: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | 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. 15 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | @echo "Nothing to build." 3 | @echo "You probably want to run build-runtime.py instead, see README.md" 4 | 5 | check: 6 | prove -v tests/*.py tests/*.sh 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Steam Runtime 2 | ============= 3 | 4 | A binary compatible runtime environment for Steam applications on Linux. 5 | 6 | Introduction 7 | ------------ 8 | 9 | The Linux version of Steam runs on many Linux distributions, ranging 10 | from the latest rolling-release distributions like Arch Linux to older 11 | LTS distributions like Ubuntu 16.04. 12 | To achieve this, it uses a special library stack, the *Steam Runtime*. 13 | 14 | The original version of the Steam Runtime is installed in 15 | `~/.steam/root/ubuntu12_32/steam-runtime`. 16 | This is Steam Runtime version 1, codenamed `scout` after the Team 17 | Fortress 2 character class. 18 | The Steam client itself is run in an environment that adds the shared 19 | libraries from Steam Runtime 1 'scout' to the library loading path, 20 | using the `LD_LIBRARY_PATH` environment variable: 21 | this is referred to as the [`LD_LIBRARY_PATH` runtime][LD_LIBRARY_PATH runtime]. 22 | 23 | A newer approach to cross-distribution compatibility is to use Linux 24 | namespace (container) technology, to run games in a more predictable 25 | environment, even when running on an arbitrary Linux distribution which 26 | might be old, new or unusually set up. 27 | This is implemented as a series of Steam Play compatibility tools, and 28 | is referred to as the Steam [container runtime][], or as the 29 | *Steam Linux Runtime*. 30 | 31 | Newer native Linux games such as Counter-Strike 2 and Dota 2 32 | run in an environment referred to as `Steam Linux Runtime 3.0 (sniper)`, 33 | which is a [Steam Runtime 3 'sniper'][sniper] container. 34 | This is the recommended environment for developers of new native Linux games. 35 | To target this environment, 36 | developers should compile their games in the [sniper SDK][], 37 | then set up a Launch Option that supports Linux, 38 | and use the Installation → Linux Runtime menu item in the Steamworks 39 | partner web interface to select the sniper runtime. 40 | 41 | Older native Linux games normally run in an environment referred to as 42 | `Steam Linux Runtime 1.0 (scout)`, which is a 43 | [Steam Runtime 2 'soldier'][soldier] container combined with the 44 | Steam Runtime 1 'scout' [`LD_LIBRARY_PATH` runtime][LD_LIBRARY_PATH runtime]. 45 | They can also be switched to run in an environment referred to as 46 | `Legacy runtime 1.0`, which is the Steam Runtime 1 'scout' `LD_LIBRARY_PATH` 47 | runtime used on its own. 48 | To target either of these environments, 49 | developers should compile their games in the [scout SDK][]. 50 | For backwards compatibility, 51 | this is still the default when a developer publishes a native Linux game, 52 | but we now recommend that developers should target sniper instead. 53 | 54 | The Steam Runtime is also used by the [Proton][] Steam Play compatibility 55 | tools, which run Windows games on Linux systems. 56 | Current versions of Proton (8.0 or newer) use the Steam Runtime 3 'sniper' 57 | container runtime. 58 | Older versions of Proton (5.13, 6.3 and 7.0) use the 59 | Steam Runtime 2 'soldier' container runtime. 60 | The oldest versions of Proton (5.0 or earlier) use the legacy 61 | Steam Runtime 1 'scout' `LD_LIBRARY_PATH` runtime. 62 | 63 | More information about the 64 | [`LD_LIBRARY_PATH` runtime][LD_LIBRARY_PATH runtime] and 65 | [container runtime][] is available as part of the 66 | [steam-runtime-tools documentation][]. 67 | 68 | [LD_LIBRARY_PATH runtime]: https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/ld-library-path-runtime.md 69 | [container runtime]: https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/container-runtime.md 70 | [Proton]: https://github.com/ValveSoftware/Proton/ 71 | [scout SDK]: https://gitlab.steamos.cloud/steamrt/scout/sdk 72 | [sniper]: https://gitlab.steamos.cloud/steamrt/steamrt/-/blob/steamrt/sniper/README.md 73 | [sniper SDK]: https://gitlab.steamos.cloud/steamrt/sniper/sdk 74 | [soldier]: https://gitlab.steamos.cloud/steamrt/steamrt/-/blob/steamrt/soldier/README.md 75 | [steam-runtime-tools documentation]: https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/tree/main/docs 76 | 77 | Reporting bugs and issues 78 | ------------------------- 79 | 80 | Please report issues to the [steam-runtime issue tracker][]. 81 | 82 | The container runtimes have some [known issues][] which do not need to be 83 | reported again. 84 | 85 | The container runtime is quite complicated, so we will need 86 | [additional information][reporting bugs] to be able to make progress 87 | on resolving issues. 88 | 89 | [steam-runtime issue tracker]: https://github.com/ValveSoftware/steam-runtime 90 | [known issues]: doc/steamlinuxruntime-known-issues.md 91 | [reporting bugs]: doc/reporting-steamlinuxruntime-bugs.md 92 | 93 | Installation 94 | ------------ 95 | 96 | Steam Runtime version 1, 'scout' is automatically installed as part 97 | of the [Steam Client for Linux][]. 98 | 99 | Each version of the Steam [container runtime][] is automatically 100 | downloaded to your Steam library if you install a game or a version of 101 | Proton that requires it. 102 | They can also be downloaded by opening `steam://` links with Steam: 103 | 104 | * Steam Linux Runtime 1.0 (scout): `steam steam://install/1070560` 105 | * Steam Linux Runtime 2.0 (soldier): `steam steam://install/1391110` 106 | * Steam Linux Runtime 3.0 (sniper): `steam steam://install/1628350` 107 | 108 | All the software that makes up the Steam Runtime is available in both source and binary form in the Steam Runtime repository [https://repo.steampowered.com/steamrt](https://repo.steampowered.com/steamrt "") 109 | 110 | [Steam Client for Linux]: https://github.com/ValveSoftware/steam-for-linux/ 111 | 112 | Building in the runtime 113 | ----------------------- 114 | 115 | To prevent libraries from development and build machines 'leaking' 116 | into your applications, you should build within a Steam Runtime container. 117 | 118 | We recommend using a 119 | [Toolbx](https://containertoolbx.org/), 120 | [Distrobox](https://distrobox.it/), 121 | [rootless Podman](https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md) 122 | or [Docker](https://docs.docker.com/get-docker/) 123 | container for this. 124 | All of these environments are compatible with the official Steam Runtime 125 | SDK images, 126 | which we provide in OCI format. 127 | 128 | If targeting Steam Linux Runtime 3.0 'sniper', 129 | please consult the 130 | [Steam Runtime 3 'sniper' SDK](https://gitlab.steamos.cloud/steamrt/sniper/sdk/-/blob/steamrt/sniper/README.md) 131 | documentation for details. 132 | 133 | If targeting the legacy 'scout' runtime, 134 | please consult the 135 | [Steam Runtime 1 'scout' SDK](https://gitlab.steamos.cloud/steamrt/scout/sdk/-/blob/steamrt/scout/README.md) 136 | documentation instead. 137 | 138 | ### Using a debugger in the build environment 139 | 140 | To get the detached debug symbols that are required for `gdb` and 141 | similar tools, you can download the matching 142 | `com.valvesoftware.SteamRuntime.Sdk-amd64,i386-scout-debug.tar.gz`, 143 | unpack it (preserving directory structure), and use its `files/` 144 | directory as the schroot or container's `/usr/lib/debug`. 145 | 146 | For example, with Docker, you might unpack the tarball in 147 | `/tmp/scout-dbgsym-0.20191024.0` and use something like: 148 | 149 | sudo docker run \ 150 | --rm \ 151 | --init \ 152 | -v /home:/home \ 153 | -v /tmp/scout-dbgsym-0.20191024.0/files:/usr/lib/debug \ 154 | -e HOME=/home/user \ 155 | -u $(id -u):$(id -g) \ 156 | -h $(hostname) \ 157 | -v /tmp:/tmp \ 158 | -it \ 159 | steamrt_scout_amd64:latest \ 160 | /dev/init -sg -- /bin/bash 161 | 162 | or with schroot, you might create 163 | `/var/chroots/steamrt_scout_amd64/usr/lib/debug/` and move the contents 164 | of `files/` into it. 165 | 166 | Using detached debug symbols 167 | ---------------------------- 168 | 169 | Please see [doc/debug-symbols.md](doc/debug-symbols.md). 170 | 171 | Steam Runtime apt repositories 172 | ------------------------------ 173 | 174 | Each Steam Runtime suite has an associated apt repository: 175 | 176 | * [`deb https://repo.steampowered.com/steamrt3/apt sniper main contrib non-free`](https://repo.steampowered.com/steamrt3/apt) 177 | * [`deb https://repo.steampowered.com/steamrt2/apt soldier main contrib non-free`](https://repo.steampowered.com/steamrt2/apt) 178 | * [`deb https://repo.steampowered.com/steamrt1/apt scout main`](https://repo.steampowered.com/steamrt1/apt) 179 | 180 | These apt repositories are preconfigured in the SDK container images. 181 | 182 | A beta branch is also available for each suite. 183 | Please see the corresponding SDK documentation for more details. 184 | 185 | Code in this repository 186 | ----------------------- 187 | 188 | This repository contains scripts for building local copies of the 189 | `LD_LIBRARY_PATH` Steam Runtime for testing. 190 | This is not usually necessary: using the official runtime is normally 191 | more appropriate. 192 | 193 | This repository also contains scripts for building Linux chroot 194 | environments suitable for building applications. 195 | These scripts are deprecated, 196 | and are not usually necessary. 197 | Using the official container-based SDKs (see above) is recommended. 198 | 199 | The container runtimes and the official container-based SDKs are not 200 | built using the scripts in this repository: 201 | instead, 202 | they are built using 203 | [flatdeb-steam](https://gitlab.steamos.cloud/steamrt/flatdeb-steam). 204 | It is not usually necessary for individual developers to rebuild these. 205 | Using the official container-based SDKs (see above) is recommended. 206 | -------------------------------------------------------------------------------- /doc/building-custom-runtime.md: -------------------------------------------------------------------------------- 1 | # Building your own version of the Steam Runtime 2 | 3 | Steam ships with a copy of the Steam Runtime, and all Steam Applications 4 | are launched within the runtime environment. 5 | 6 | For some scenarios, you 7 | may want to test an application with a different build of the runtime. 8 | This is unsupported: the only build of the runtime that is available 9 | for Steam users is the one in `~/.steam/root/ubuntu12_32`. 10 | 11 | ## Downloading a Steam Runtime 12 | 13 | Current and past versions of the Steam Runtime are available from 14 | . 15 | Beta builds, newer than the one included with Steam, are sometimes 16 | available from the same location. The versioned directory names correspond 17 | to the `version.txt` found in official Steam Runtime builds, typically 18 | `ubuntu12_32/steam-runtime/version.txt` in a Steam installation. 19 | The file `steam-runtime.tar.xz` in each directory contains the Steam 20 | Runtime. It unpacks into a directory named `steam-runtime/`. 21 | 22 | Each directory also contains various other archive and metadata files, 23 | and a `sources/` subdirectory with source code for all the packages that 24 | went into this Steam Runtime release. 25 | 26 | ## Building your own Steam Runtime variant 27 | 28 | For advanced use, you can use the **build-runtime.py** script to build 29 | your own runtime. To get a Steam Runtime in a directory, run a command 30 | like: 31 | 32 | ./build-runtime.py --output=$(pwd)/runtime 33 | 34 | The resulting directory is similar to the `ubuntu12_32/steam-runtime` 35 | directory in a Steam installation. 36 | 37 | To get a Steam Runtime in a compressed tar archive for easy transfer to 38 | other systems, similar to the official runtime deployed with the 39 | Steam client, use a command like: 40 | 41 | ./build-runtime.py --archive=$(pwd)/steam-runtime.tar.xz 42 | 43 | To output a tarball and metadata files with automatically-generated 44 | names in a directory, specify the name of an existing directory, or a 45 | directory to be created with a `/` suffix: 46 | 47 | ./build-runtime.py --archive=$(pwd)/archives/ 48 | 49 | or to force a particular basename to be used for the tar archive and all 50 | associated metadata files, end with `.*`, which will usually need to be 51 | quoted to protect it from shell interpretation: 52 | 53 | ./build-runtime.py --archive="$(pwd)/archives/steam-runtime.*" 54 | 55 | The archive will unpack into a directory named `steam-runtime`. 56 | 57 | The `--archive` and `--output` options can be combined, but at least one 58 | is required. 59 | 60 | Run `./build-runtime.py --help` for more options. 61 | 62 | ## Using a Steam Runtime 63 | 64 | Once the runtime is downloaded (and unpacked into a directory, if you used 65 | an archive), you can set up library pinning by running the **setup.sh** script, 66 | then you can use the **run.sh** script to launch any program within that 67 | runtime environment. 68 | 69 | For example, to get diagnostic information using the same tool used to get 70 | what appears in Help -> System Information in Steam, if your runtime is in 71 | '~/rttest', you could run: 72 | 73 | ~/rttest/setup.sh 74 | ~/rttest/run.sh ~/rttest/usr/bin/steam-runtime-system-info 75 | 76 | Or to launch Steam itself (and any Steam applications) within your runtime, 77 | set both the `STEAM_RUNTIME_SCOUT` and `STEAM_RUNTIME` environment variables 78 | to point to your runtime directory: 79 | 80 | $ STEAM_RUNTIME_SCOUT=~/rttest STEAM_RUNTIME="$STEAM_RUNTIME_SCOUT" ./steam.sh 81 | Running Steam on ubuntu 14.04 64-bit 82 | STEAM_RUNTIME has been set by the user to: /home/username/rttest 83 | -------------------------------------------------------------------------------- /doc/debug-symbols.md: -------------------------------------------------------------------------------- 1 | # Using debug symbols in the Steam Runtime 2 | 3 | If your game runs in the `LD_LIBRARY_PATH`-based Steam Runtime 4 | environment, it is likely to be loading a mixture of libraries from the 5 | host system and libraries from the Steam Runtime. In this situation, 6 | debugging with tools like `gdb` benefits from having 7 | [debug symbols][]. 8 | 9 | Like typical Linux operating system library stacks, the Steam Runtime 10 | libraries do not contain debug symbols, to keep their size small; however, 11 | they were compiled with debug symbols included, so we can make their 12 | corresponding [detached debug symbols][] available for download. 13 | 14 | The steps to attach a debugger to a game apply can in fact apply equally 15 | to the Steam client itself. 16 | 17 | [debug symbols]: https://en.wikipedia.org/wiki/Debug_symbol 18 | [detached debug symbols]: https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html 19 | 20 | ## Example scenario 21 | 22 | Suppose you are using a SteamOS 2 'brewmaster' host system, and you are 23 | having difficulty with the PulseAudio libraries, similar to 24 | [steam-for-linux#4753][]. 25 | 26 | * Use a SteamOS 2 'brewmaster' host system 27 | * Ensure that your Steam client is up to date 28 | * Do not have `libpulse0:i386` or `libopenal1:i386` installed, so that 29 | the 32-bit `libpulse.so.0` and `libopenal.so.1` from the Steam Runtime 30 | will be used 31 | * Run the Steam client in "desktop mode", from a terminal 32 | * Put the Steam client in Big Picture mode, which makes it initialize 33 | PulseAudio 34 | * Run a 32-bit game like [Floating Point][] 35 | * Alt-tab to a terminal 36 | * Locate the main Steam process with `pgrep steam | xargs ps`, 37 | or locate the main Floating Point process with `pgrep Float | xargs ps`. 38 | Let's say the process you are interested in is process 12345. 39 | * Run a command like 40 | `gdb ~/.steam/root/ubuntu12_32/steam 12345` (for the Steam client) 41 | or `gdb ~/.steam/steam/steamapps/common/"Floating Point"/"Floating Point.x86" 12345` 42 | (for the game). 43 | * In gdb: `set pagination off` 44 | * In gdb: `thread apply all bt` to see a backtrace of each thread. 45 | * At the time of writing, the Steam client has two threads that are 46 | calling `pa_mainloop_run()`, while Floating Point has one such thread. 47 | Because you don't have debug symbols for `libpulse.so.0`, these 48 | backtraces are quite vague, with no information about the source 49 | code file/line or about the function arguments. 50 | * Exit from gdb so that the Steam client or the game can continue to run. 51 | 52 | [Floating Point]: https://store.steampowered.com/app/302380 53 | [steam-for-linux#4753]: https://github.com/ValveSoftware/steam-for-linux/issues/4753#issuecomment-280920124 54 | 55 | ## Getting the debug symbols for the host system 56 | 57 | This is the same as it would be without Steam. For a Debian, Ubuntu or 58 | SteamOS 2 host, `apt install libc6-dbg:i386` is a good start. For 59 | non-Debian-derived OSs, use whatever is the OS's usual mechanism to get 60 | detached debug symbols. 61 | 62 | More OS-specific information: 63 | 64 | * [Debian](https://wiki.debian.org/HowToGetABacktrace#Installing_the_debugging_symbols) 65 | * [Ubuntu](https://wiki.ubuntu.com/Debug%20Symbol%20Packages) 66 | 67 | ## Getting the debug symbols for the Steam Runtime 68 | 69 | Look in `~/.steam/root/ubuntu12_32/steam-runtime/version.txt` to see 70 | which Steam Runtime you have. These instructions assume you are using 71 | at least version 0.20190716.1. At the time of writing, the public stable 72 | release is version 0.20191024.0. 73 | 74 | Look in 75 | for a corresponding version of the Steam Runtime container builds. 76 | 77 | Download 78 | `com.valvesoftware.SteamRuntime.Sdk-amd64,i386-scout-debug.tar.gz` from 79 | the matching build. Create a directory, for example 80 | `/tmp/scout-dbgsym-0.20191024.0`, and untar the debug symbols tarball 81 | into that directory. 82 | 83 | The `/tmp/scout-dbgsym-0.20191024.0/files` directory is actually the 84 | `/usr/lib/debug` from the SDK container, and has most of the debug 85 | symbols that you will need. 86 | 87 | ## Re-running gdb 88 | 89 | Run gdb the same as you did before, but this time use the `-iex` option 90 | to tell it to set the new debug symbols directory before loading the 91 | executable, for example: 92 | 93 | gdb -iex \ 94 | 'set debug-file-directory /tmp/scout-debug-0.20191024.0/files:/usr/lib/debug' \ 95 | ~/.steam/root/ubuntu12_32/steam 12345 96 | 97 | You will get some warnings about CRC mismatches, because gdb can now 98 | see two versions of the debug symbols for some libraries. Those warnings 99 | can safely be ignored: gdb does the right thing. 100 | 101 | ## Example scenario revisited 102 | 103 | * Do the setup above 104 | * Run a command like 105 | `gdb ~/.steam/root/ubuntu12_32/steam 12345` (for the Steam client) 106 | or `gdb ~/.steam/steam/steamapps/common/"Floating Point"/"Floating Point.x86" 12345` 107 | (for the game). 108 | * In gdb: `set pagination off` 109 | * In gdb: `thread apply all bt` to see a backtrace of each thread. 110 | * At the time of writing, the Steam client has two threads that are 111 | calling `pa_mainloop_run()`, while Floating Point has one such thread. 112 | Now that you have debug symbols for `libpulse.so.0`, these backtraces 113 | are more specific, with the source file, line number and function 114 | arguments for calls into `libpulse.so.0`, and details of functions 115 | that are internal to `libpulse.so.0`. 116 | * Similarly, for `start_thread()` in `libc.so.6` (which came from the host 117 | system), you should see file and line information from `libc6-dbg:i386`. 118 | * If you use `info locals` or `thread apply all bt full`, you'll also see 119 | that you can even get information about local variables. 120 | -------------------------------------------------------------------------------- /doc/goals.md: -------------------------------------------------------------------------------- 1 | # Requirements and goals for the Steam Runtime 2 | 3 | This document summarizes actual and potential goals for how the Steam 4 | client uses the Steam Runtime and containers to run itself and/or games. 5 | 6 | For details of how the Steam Runtime works and how that influences which 7 | of these goals are achieved, see 8 | [Steam Runtime design models](possible-designs.md). 9 | 10 | ## Non-regression requirements 11 | 12 | These are things that are already more or less true in the 13 | `LD_LIBRARY_PATH` runtime, and need to remain more or less true. 14 | 15 | ### Old games continue to work 16 | 17 | Older games like Half-Life and Portal, developed circa Ubuntu 12.04, 18 | must work on modern systems like Ubuntu 22.04 without needing ongoing 19 | maintenance. 20 | 21 | This is particularly important in cases like Torchlight where the 22 | original developer has gone out of business, so there will be no more 23 | updates, however much we might hope there would be. 24 | 25 | ### i386 games continue to work on i386-capable hosts 26 | 27 | Older games were compiled for the IA32 ABI (e.g. Debian i386). 28 | They must work on modern x86-64 systems (e.g. Debian amd64), as long 29 | as the modern system provides basic i386 packages like glibc and 30 | graphics drivers. 31 | 32 | ### Games are deployed through steampipe 33 | 34 | Valve is happy with steampipe as a deployment mechanism. Games will 35 | not switch to some other deployment mechanism, e.g. libostree as used 36 | by Flatpak. 37 | 38 | ### Games developed in an impure scout environment continue to work 39 | 40 | Game developers were always meant to compile their games in a "pure" 41 | scout environment (originally `schroot`, and more recently Docker) but 42 | many did not do so. "Most" of these games should continue to work on 43 | "most" modern host systems. 44 | 45 | This is unlikely to be achievable for all games, and is more important 46 | for higher-profile games. 47 | 48 | ### Host system doesn't need uncommon packages installed 49 | 50 | The Steam client should have as few requirements on the host system 51 | as possible. 52 | 53 | Note that all modes of operation require udev rules for input devices 54 | and uinput. These affect system security and need root to install, so 55 | the most we can do from unprivileged software is to diagnose the problem. 56 | 57 | ### Open-source (Mesa) graphics drivers continue to work 58 | 59 | If the host system has graphics hardware that is best-supported by 60 | open-source drivers (in practice this normally means Intel iGPUs 61 | or the AMD Radeon series), games should work on it. 62 | 63 | For recent GPUs, this means the game must be able to use a suitably 64 | recent driver version that supports the GPU: for example, we cannot 65 | expect a 2023 GPU to be supported by a 2012 version of Mesa. 66 | 67 | Meeting this goal is likely to be particularly problematic in designs 68 | that would require us to compile a 2023 graphics driver in the 2012 69 | runtime/SDK environment. 70 | 71 | ### Proprietary (NVIDIA) graphics drivers continue to work 72 | 73 | If the host system has a graphics driver that we cannot legally 74 | distribute, we should be able to keep games working anyway. 75 | 76 | Now that AMD are using open-source drivers for the Radeon series, 77 | our main use-case for proprietary graphics drivers is the NVIDIA 78 | driver. This is not redistributable without specific permission 79 | (Debian has permission, but the same is not true for all distributions), 80 | and it must have its user-space part kept in lockstep with the kernel part. 81 | (for example using the v430.40 kernel module with the v430.64 user-space 82 | driver is not supported, and neither is the other way round). 83 | 84 | ## New goals 85 | 86 | These are things that are mostly not true in the `LD_LIBRARY_PATH` 87 | runtime. In some cases, we would like them to *become* true. 88 | In other cases, third-party users and developers have these as goals, 89 | but Valve do not consider them to be a priority. 90 | 91 | ### New runtimes 92 | 93 | The Steam Runtime version 1, 'scout', is based on a 2012 version of 94 | Ubuntu. The open source software stack has moved on since then, and 95 | it should be possible to build new games against a newer runtime. 96 | 97 | We already have a partial newer runtime (referred to as Steam Runtime 98 | version 1½, 'heavy') which is used to run the `steamwebhelper`. 99 | However, this is based on Debian 8 'jessie', released in 2015 (SteamOS 2 100 | 'brewmaster' is also based on Debian 8); this version was chosen to avoid 101 | increasing the Steam client's minimum glibc requirements further than 102 | was strictly necessary. This is a step forward, but if we are going to 103 | introduce a new runtime for games and support it longer-term, we should 104 | aim higher than 2015. 105 | 106 | Steam Runtime version 2, 'soldier', is based on Debian 10 'buster', 107 | released in 2019. It is used to run Proton 5.13 up to 7.0. 108 | 109 | Steam Runtime version 3, 'sniper', is based on Debian 11 'bullseye', 110 | released in 2021. It is otherwise similar to soldier. 111 | It is used to run Proton 8.0 or later, and some native Linux games 112 | such as Dota 2, Endless Sky and Retroarch. 113 | 114 | Similarly, Steam Runtime version 4, 'medic', is likely to be based on 115 | Debian 12 'bookworm', which was released in 2023. 116 | 117 | #### New glibc 118 | 119 | One specific aspect of new runtimes that we need to be able to ship is 120 | a newer version of glibc. 121 | 122 | The `LD_LIBRARY_PATH` Steam Runtime cannot contain glibc, because: 123 | 124 | * The path to [`ld.so(8)`][ld.so] is hard-coded into all executables 125 | (it is the ELF interpreter, part of the platform ABI), so we 126 | don't get to change it. 127 | 128 | * The version of `ld.so` is coupled to `libdl.so.2`: 129 | they come from the same source package, and are allowed to assume 130 | that they are installed and upgraded in lockstep. 131 | 132 | * Similarly, the version of `libdl.so.2` is coupled to the rest of glibc. 133 | 134 | So, everything in the `LD_LIBRARY_PATH` Steam Runtime must be built for 135 | a glibc at least as old as the oldest system that Steam supports. This 136 | makes it difficult to advance beyond the Ubuntu 12.04-based 'scout' 137 | runtime: everything that is updated effectively has to be backported to 138 | Ubuntu 12.04. 139 | 140 | To be able to replace glibc, the runtime needs to provide at least 141 | `/usr`, `/lib*`, `/bin` and `/sbin`, like a Flatpak runtime does. 142 | 143 | [ld.so]: https://linux.die.net/man/8/ld.so 144 | 145 | ### Games can be built in a container 146 | 147 | It should be straightforward for game developers to build their games 148 | in a "pure" Steam Runtime environment (for scout or any future Steam 149 | Runtime of their choice). 150 | 151 | ### Games run in a predictable, robust environment 152 | 153 | Games should not be broken by unexpected changes to the host system. 154 | After a game works once, it should work essentially forever. 155 | 156 | In particular we don't want to spend time debugging conflicts between the 157 | Steam Runtime's idea of what should be in libpcre.so.3 and libcurl.so.4, 158 | and the host system's. 159 | 160 | #### Avoiding incompatibilities between libraries 161 | 162 | Games can break when libraries claim to be compatible (by having the 163 | same ELF `DT_SONAME`) but are in fact not compatible, for example: 164 | 165 | 166 | - libcurl.so.4 linked to libssl 1.0 is not completely compatible with 167 | libcurl.so.4 linked to libssl 1.1 168 | 169 | - The history of libcurl.so.4 in Debian/Ubuntu has involved two 170 | incompatible sets of versioned symbols, due to some decisions 171 | made in 2005 and 2007 that, with hindsight, were less wise than 172 | they appeared at the time 173 | 174 | - Various libraries can be compiled with or without particular 175 | features and dependencies; if the version in the Steam Runtime 176 | has a feature, and the host system version is newer but does not 177 | have that feature, then games cannot rely on the feature 178 | 179 | - In the worst-case, compiling a library without a particular 180 | feature or dependency can result in symbols disappearing from 181 | its ABI, resulting in games that reference those symbols crashing 182 | 183 | - There is a fairly subtle interaction between 184 | libdbusmenu-gtk, libdbusmenu-glib and Ubuntu's patched GTK 2 185 | that has resulted in these libraries being forced to be taken 186 | from the Steam Runtime, to avoid breaking the Unity dock 187 | 188 | If we always take these libraries from the runtime, then incompatible 189 | changes on the host system don't affect us. 190 | 191 | ### Games that inappropriately bundle libraries work anyway 192 | 193 | Some games bundle private copies of libraries that also exist in the 194 | Steam Runtime, or libraries that are dependencies of graphics drivers, 195 | or even the graphics drivers themselves. These libraries bypass the 196 | mechanisms that are intended to make sure games keep working. 197 | 198 | For example, some games bundle a private copy of `libgcc_s.so.1` or 199 | `libstdc++.so.6`, and Mesa graphics drivers also depend on those 200 | libraries. If the game's bundled copy is older than the version that 201 | the user's Mesa graphics driver requires, the game will crash or 202 | otherwise fail to work. 203 | 204 | The unofficial Flatpak Steam app on Flathub has a clever mechanism 205 | involving `LD_AUDIT` that can prevent libraries bundled with games 206 | from taking precedence over newer libraries from the Steam Runtime or 207 | the host system. 208 | 209 | ### Games don't all have to use the same runtime 210 | 211 | We need older games like Torchlight to keep using the old runtime 212 | indefinitely, even if newer/more-updated games like DOTA2 switch to 213 | a new runtime, and even if the Steam client itself switches to a 214 | new runtime. 215 | 216 | ### Steam client runs in a predictable environment 217 | 218 | The Steam client should not be broken by unexpected changes to the 219 | host system. 220 | 221 | ### Steam client can use a newer runtime 222 | 223 | The Steam client and the oldest games currently both use scout, the 224 | oldest Steam Runtime, but I expect we will eventually want the Steam 225 | client to switch to something more modern. 226 | 227 | ### New runtimes for games can be supported for multiple years 228 | 229 | The basis for a new runtime should have upstream security support, 230 | without compatibility breaks, for a few years. For example, Debian 10 231 | or Ubuntu LTS would be suitable (they are supported for multiple years), 232 | but non-LTS Ubuntu releases would not be suitable. 233 | 234 | Even after upstream security support ends, we should be able to backport 235 | critical security fixes to our version ourselves. 236 | 237 | We do not necessarily require this for the runtime that is used to run 238 | the Steam client itself: the Steam client is frequently updated and 239 | versions older than the current general-availability version are not 240 | supported, so if necessary the Steam client can have a flag-day that 241 | increases its requirements to a newer runtime. 242 | 243 | ### New runtimes do not require newest host system 244 | 245 | Games built for the new runtime might have higher minimum requirements 246 | than Ubuntu 12.04, but they should work on ordinary non-bleeding-edge 247 | distributions like Debian stable and Ubuntu LTS. Ideally they should 248 | also work on Debian oldstable and Ubuntu old-LTS for a reasonable length 249 | of time. 250 | 251 | ### New runtimes do not require rebuilding *everything* 252 | 253 | We should be able to produce a new runtime reasonably often, for example 254 | once per 2-4 years (1-2 Debian stable releases). To make this scale, 255 | we should only need to build and maintain selected packages that we 256 | are actively patching, but take unmodified packages directly from the 257 | base distribution. 258 | 259 | ### New runtimes do not require extensive patching 260 | 261 | To minimize the cost of maintaining a runtime, we shouldn't need to 262 | patch a lot of packages (for example libraries that dlopen modules, like 263 | GTK) to make them suitable for the Steam Runtime. 264 | 265 | ### New runtimes work on future hardware 266 | 267 | When a now-new (let's say 2020) runtime has become outdated (let's say 268 | 2025 or 2030), games built against it must still work. This means it 269 | must have access to graphics drivers for 2025 GPUs that had not yet been 270 | invented when the runtime's base distribution was released. 271 | 272 | ### i386 games work on non-i386 hosts 273 | 274 | Older games were compiled for the IA32 ABI (e.g. Debian i386). 275 | They should ideally work on modern x86-64 systems (e.g. Debian amd64) even 276 | if the modern system *does not* provide basic i386 packages like 277 | glibc and graphics drivers, as long as the container runtime *does*. 278 | 279 | In particular, Canonical briefly planned to remove the i386 (IA32) 280 | ABI from Ubuntu host systems, recommending use of Snap or LXD. 281 | This would have meant that we could no longer rely on the host 282 | system to give us i386 glibc and graphics drivers. Their plan has 283 | now changed to reducing i386 to be a partial architecture 284 | ("second-class citizen" status), similar to the way 32-bit libraries 285 | are handled in Arch Linux, which is good enough for our current needs. 286 | However, it seems likely that other distributions will want to do 287 | similarly in future. 288 | 289 | ### Game data is easy to sync and delete 290 | 291 | If we restrict each game so it can only write to a finite number of 292 | well-known locations, it's easy to upload all files from those 293 | locations for Steam Cloud Sync, and/or delete them when the game is 294 | uninstalled. 295 | 296 | ### Steam can be installed in a cross-distro way 297 | 298 | Installing the Steam client should not be OS-specific: 299 | we don't want to have to build `.deb` packages for Debian, Ubuntu 300 | and SteamOS 2, `.rpm` packages for Fedora, *different* `.rpm` packages 301 | for openSUSE, Pacman packages for Arch Linux and SteamOS 3, and so on. 302 | 303 | ### Steam can be installed unprivileged 304 | 305 | Installing the Steam client should not require OS-level privileges, 306 | and some users do not believe it should be able to run arbitrary code 307 | as an administrator at all. If it does run arbitrary code, ideally they 308 | should not be required to trust Valve: the privileged code that they 309 | run should have been audited by someone who the user already has no 310 | choice but to trust, such as their OS vendor. 311 | 312 | For example, the maintainer scripts (preinst and postinst) in Debian 313 | packages, and the scriptlets in RPM packages, run arbitrary code as root. 314 | 315 | ### Steam client cannot accidentally break the system 316 | 317 | Some users want the Steam client to run in a "least-privilege" sandbox 318 | so that bugs are mitigated. For example, if a shell script in the 319 | Steam client accidentally runs `rm -fr /`, it should not be able to 320 | delete the user's documents. 321 | 322 | (This is weaker than a security boundary: it guards against mistakes, 323 | not against malice.) 324 | 325 | ### Games cannot accidentally break the system 326 | 327 | Some users want the games to run in a "least-privilege" sandbox 328 | so that bugs are mitigated. For example, if a shell script in a game 329 | accidentally runs `rm -fr /`, it should not be able to delete the 330 | user's documents. 331 | 332 | (This is weaker than a security boundary: it guards against mistakes, 333 | not against malice.) 334 | 335 | ### Games cannot accidentally break the Steam client 336 | 337 | Some users want the games to run in a "least-privilege" sandbox 338 | so that bugs are mitigated. For example, if a shell script in a game 339 | accidentally runs `rm -fr /`, it should only be able to delete that 340 | game's data, not Steam client data. 341 | 342 | (This is weaker than a security boundary: it guards against mistakes, 343 | not against malice.) 344 | 345 | ### Security boundary between desktop and Steam client 346 | 347 | Some users want the Steam client to run in a "least-privilege" sandbox 348 | so that if it gets compromised, the impact is mitigated. For example, 349 | they do not want it to be possible for the Steam client to read personal 350 | documents, or execute arbitrary code that can do so. 351 | 352 | This is not the same as saying that *games* are untrusted, although 353 | the same people probably want both. 354 | 355 | ### Security boundary between desktop and games 356 | 357 | Some users want Steam games to run in a "least-privilege" sandbox so 358 | that if they are malicious or compromised, the impact is mitigated. For 359 | example, they do not want it to be possible for Steam games to read 360 | personal documents, or execute arbitrary code that can do so. 361 | 362 | This is particularly interesting if game mods are installed. 363 | 364 | This is not the same as saying that the *Steam client* is untrusted, 365 | although the same people probably want both. 366 | 367 | ### Security boundary between Steam client and games 368 | 369 | While we're thinking about least-privilege, it also seems desirable 370 | that if Steam games are malicious or compromised, the impact is mitigated. 371 | For example, a malicious game should not be able to spend money via the 372 | Steam client. 373 | 374 | Again, this is particularly interesting if game mods are installed. 375 | -------------------------------------------------------------------------------- /doc/reporting-steamlinuxruntime-bugs.md: -------------------------------------------------------------------------------- 1 | Reporting SteamLinuxRuntime bugs 2 | ================================ 3 | 4 | The Steam Linux container runtime runs each game in a container. 5 | 6 | It consists of: 7 | 8 | * pressure-vessel, a container launching tool 9 | * a *runtime*, providing a set of libraries for games to use 10 | 11 | There are currently three runtimes available: 12 | 13 | * [Steam Linux Runtime 3.0 (sniper)](https://gitlab.steamos.cloud/steamrt/steamrt/-/blob/steamrt/sniper/README.md), 14 | [app ID 1628350](https://steamdb.info/app/1628350/) 15 | is used to run official releases of Proton 8.0 or newer, 16 | and some native Linux games such as Dota 2, Endless Sky and Retroarch. 17 | We expect it to be used for other newer native Linux games in future. 18 | 19 | * [Steam Linux Runtime 2.0 (soldier)](https://gitlab.steamos.cloud/steamrt/steamrt/-/blob/steamrt/soldier/README.md), 20 | [app ID 1391110](https://steamdb.info/app/1391110/) 21 | is used to run official releases of Proton versions 5.13 to 7.0. 22 | 23 | It is also used to run native Linux games that target 24 | Steam Runtime 1 'scout', if the "Steam Linux Runtime 1.0 (scout)" 25 | compatibility tool (formerly "Steam Linux Runtime") is selected for them. 26 | 27 | * [Steam Linux Runtime 1.0 (scout)](https://gitlab.steamos.cloud/steamrt/steamrt/-/blob/steamrt/scout/README.md), 28 | [app ID 1070560](https://steamdb.info/app/1070560/) 29 | can be used on an opt-in basis to run native Linux games in a 30 | container. It uses the same libraries as the traditional 31 | `LD_LIBRARY_PATH` runtime, but instead of using them as an overlay 32 | over the host machine, they are used as an overlay over a 33 | Steam Runtime 2 'soldier' container. 34 | 35 | Unofficial third-party builds of Proton might use the container runtime 36 | like the official Proton 5.13, or they might use the traditional 37 | `LD_LIBRARY_PATH` runtime like the official Proton 5.0, or they might 38 | do something else entirely. We cannot provide support for unofficial 39 | builds of Proton. 40 | 41 | The list of [known issues](steamlinuxruntime-known-issues.md) describes 42 | some issues that cannot be fixed immediately, with workarounds where 43 | available. 44 | 45 | If you encounter other issues, please report them to the Steam Runtime's 46 | issue tracker: . 47 | 48 | Essential information 49 | --------------------- 50 | 51 | We will need to know some information about your system. Please make sure 52 | to include full system information in your report. 53 | In the desktop Steam user interface, this can be copied from 54 | *Help -> Steam Runtime Diagnostics*. Wait for the diagnostic tool to run, 55 | then click on *Copy* to copy it to the clipboard, and paste it into a 56 | text editor. The same information is also saved in a file named 57 | `steam-runtime-system-info-*.txt` in `~/.steam/root/logs`. 58 | 59 | In Big Picture mode or on the Steam Deck, the same information is in 60 | *Menu -> Settings -> System*: scroll to the end, and click on 61 | *Run Diagnostics*. 62 | 63 | When reporting bugs in the container runtime, please include a debug 64 | log. The easiest way to get this is: 65 | 66 | * Completely exit from Steam 67 | 68 | * Run a terminal emulator such as GNOME Terminal, Konsole or xterm 69 | 70 | * Run Steam with the `STEAM_LINUX_RUNTIME_LOG` environment variable 71 | set to 1, for example: 72 | 73 | STEAM_LINUX_RUNTIME_LOG=1 steam 74 | 75 | You can leave Steam running with this setting permanently if you're 76 | testing multiple games. 77 | 78 | * Run the game, or do whatever else is necessary to reproduce the bug 79 | 80 | * Find the Steam Library directory where the runtime is installed, 81 | typically `~/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier` 82 | for Steam Runtime 2 'soldier' or 83 | `~/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper` 84 | for Steam Runtime 3 'sniper' 85 | 86 | * Version numbers for some important runtime components are in `VERSIONS.txt` 87 | 88 | * The log file is in the `var/` directory and named `slr-app*-*.log` 89 | for Steam games, or `slr-non-steam-game-*.log` if we cannot identify 90 | a Steam app ID for the game. 91 | 92 | * For native Linux games that use scout, the version number in 93 | `~/.steam/root/ubuntu12_32/steam-runtime/version.txt` is also important 94 | 95 | For Proton games, you can combine `STEAM_LINUX_RUNTIME_LOG=1` with 96 | `PROTON_LOG=1` to capture a Proton log file too. 97 | 98 | You can censor the system information and the log (usernames, directory 99 | names etc.) if you need to, as long as it's obvious what you have 100 | edited. For example, replacing names with `XXX` or `REDACTED` is OK. 101 | If your report contains information about more than one Steam Library 102 | directory, please keep it obvious that they are different - for example 103 | replace one with `/media/REDACTED1` and the other with 104 | `/media/REDACTED2` in a consistent way. 105 | 106 | ### If no log is produced 107 | 108 | If pressure-vessel is crashing on startup and does not produce a log, 109 | please do this instead: 110 | 111 | * Completely exit from Steam 112 | 113 | * Run a terminal emulator such as GNOME Terminal, Konsole or xterm 114 | 115 | * Run Steam with the `STEAM_LINUX_RUNTIME_VERBOSE` environment variable 116 | set to 1 117 | 118 | * Capture Steam's output in a file 119 | 120 | * Run the game, or do whatever else is necessary to reproduce the bug 121 | 122 | * Exit from Steam 123 | 124 | For example, this command will leave Steam output in a file named 125 | `slr.log` in your home directory: 126 | 127 | STEAM_LINUX_RUNTIME_VERBOSE=1 steam 2>&1 | tee ~/slr.log 128 | 129 | Using a beta or an older version 130 | -------------------------------- 131 | 132 | Several branches of the Steam Linux Runtime are available. You can 133 | select a different branch from your Steam Library, in the same way 134 | you would for a game: follow the same procedure as 135 | , 136 | but instead of the properties of CS:GO, change the properties of the 137 | tool named *Steam Linux Runtime 3.0 (sniper)*, 138 | *Steam Linux Runtime 2.0 (soldier)* 139 | or *Steam Linux Runtime 1.0 (scout)*. 140 | 141 | The branches that are usually available are: 142 | 143 | * The default branch (SteamDB calls this `public`) is the recommended 144 | version for most people. 145 | 146 | * The `client_beta` branch can be used to get a preview of what will 147 | be in the next update to the default branch. It is either the same 148 | as the default branch, or a bit newer. 149 | 150 | Please use this in conjunction with the 151 | [Steam Client beta](https://support.steampowered.com/kb_article.php?ref=7021-eiah-8669), 152 | because it will sometimes rely on new Steam Client features that are not 153 | yet available in the non-beta client. 154 | 155 | If this branch doesn't work, please report a bug, then switch to 156 | the default branch. 157 | 158 | * The `previous_release` branch is an older version of the default 159 | branch. Only use this if the default branch is not working for you, 160 | and please report it as a bug if that happens. 161 | 162 | If something works in one branch but fails in another branch, that's 163 | very useful information to include in issue reports. Please be as clear 164 | as you can about which version works and which version fails. You can 165 | check the current version by looking at 166 | `SteamLinuxRuntime_sniper/VERSIONS.txt`, 167 | `SteamLinuxRuntime_soldier/VERSIONS.txt` or 168 | `SteamLinuxRuntime/VERSIONS.txt`. 169 | 170 | It is very useful if you can show us a Steam Runtime Diagnostics report 171 | and a log for the version that fails, then switch to the version that works 172 | (without changing anything else!) and capture a new Steam Runtime Diagnostics 173 | report and a new log, so that we can compare them. 174 | 175 | Common issues and workarounds 176 | ----------------------------- 177 | 178 | See the list of [known issues](steamlinuxruntime-known-issues.md). 179 | 180 | Even more logging 181 | ----------------- 182 | 183 | Steam and pressure-vessel developers might also ask you to run Steam 184 | with `STEAM_LINUX_RUNTIME_VERBOSE=1`, `PRESSURE_VESSEL_VERBOSE=1`, 185 | `CAPSULE_DEBUG=all` or `G_MESSAGES_DEBUG=all`, which produce 186 | even more debug logging that is sometimes useful. 187 | 188 | Advanced debugging 189 | ------------------ 190 | 191 | If you know your way around a Linux system, including using terminal 192 | commands, there are a few things you can try to help us get more 193 | information about games that aren't working. 194 | 195 | ### The test-UI (steam-runtime-launch-options) 196 | 197 | pressure-vessel has a very basic user interface for testing and debugging. 198 | This is a control panel for advanced options, most of which will break 199 | games - if they were ready for general use, we would have enabled them 200 | for everyone already. Use it at your own risk! 201 | 202 | To enable this, install PyGObject and the GLib and GTK 3 203 | GObject-Introspection data (that's `python3-gi` and `gir1.2-gtk-3.0` on 204 | Debian-derived systems), then set a game's launch options to: 205 | 206 | steam-runtime-launch-options -- %command% 207 | 208 | This mode does not work in situations where pressure-vessel would have 209 | been run non-interactively, such as for *Help -> System Information* 210 | and Proton games. 211 | 212 | ### Getting a shell inside the container 213 | 214 | pressure-vessel has a mode where it will run an `xterm` instead of the 215 | game, so that you can explore the container interactively. To enable 216 | this, run Steam with the `PRESSURE_VESSEL_SHELL` environment variable 217 | set to `instead`, or set *Run an interactive shell* to 218 | *Instead of running the command* in [the test-UI](#test-ui). 219 | 220 | Inside the shell, the special array variable `$@` is set to the command 221 | that would have been used to run the game. You can use `"$@"` (including 222 | the double quotes!) to run the game inside the interactive shell. 223 | 224 | This mode does not work in situations where pressure-vessel would have 225 | been run non-interactively, such as for *Help -> Steam Runtime Diagnostics*. 226 | It partially works for Proton games: the shell will not open until the 227 | game's setup commands have finished. 228 | 229 | ### Changing the runtime version 230 | 231 | If you download a file named 232 | `com.valvesoftware.SteamRuntime.Platform-amd64,i386-soldier-runtime.tar.gz` 233 | from , 234 | you can use it as a runtime instead of the one provided by Steam. 235 | Create a new directory in `SteamLinuxRuntime_soldier`, for example 236 | `SteamLinuxRuntime_soldier/my_soldier_platform_0.20200604.0`, 237 | and unpack the tarball into that directory so that you have files like 238 | `SteamLinuxRuntime_soldier/my_soldier_platform_0.20200604.0/metadata` and 239 | `SteamLinuxRuntime_soldier/my_soldier_platform_0.20200604.0/files/bin/env`. 240 | Then select it from the list of runtimes in [the test-UI](#test-ui). 241 | 242 | For the "Steam Linux Runtime 1.0 (scout)" environment, the closest equivalent 243 | is to download a file named `steam-runtime.tar.xz` from 244 | from 245 | and unpack it into the `SteamLinuxRuntime` directory, so that you have 246 | files like `SteamLinuxRuntime/steam-runtime/version.txt`. This will be 247 | used in preference to the scout runtime that comes with Steam. 248 | 249 | ### SDK runtimes 250 | 251 | If you download a file named 252 | `com.valvesoftware.SteamRuntime.Sdk-amd64,i386-soldier-runtime.tar.gz` 253 | from , 254 | you can use it as a runtime. Create a new directory in 255 | `SteamLinuxRuntime_soldier`, for example `SteamLinuxRuntime_soldier/my_soldier_sdk_0.20200604.0`, 256 | and unpack the tarball into that directory so that you have files like 257 | `SteamLinuxRuntime_soldier/my_soldier_sdk_0.20200604.0/metadata` and 258 | `SteamLinuxRuntime_soldier/my_soldier_sdk_0.20200604.0/files/bin/env`. 259 | Then select it from the list of runtimes in [the test-UI](#test-ui). 260 | 261 | The SDK has some basic debugging tools like `strace`, `gdb` and `busybox`, 262 | as well as development tools like C compilers. 263 | 264 | To get detached debugging symbols for `gdb` backtraces, download 265 | `com.valvesoftware.SteamRuntime.Sdk-amd64,i386-soldier-debug.tar.gz` from 266 | the same directory as the SDK runtime. Unpack it in a temporary location, 267 | and rename its `files` directory to be `.../files/lib/debug` inside the 268 | SDK runtime, so that you get a 269 | `SteamLinuxRuntime_soldier/my_soldier_sdk_0.20200604.0/files/lib/debug/.build-id` 270 | directory. 271 | 272 | If you have detached debug symbols in `/usr/lib/debug` on your host 273 | system, you can use those to analyze backtraces that involve libraries 274 | that came from the host system, such as glibc and Mesa graphics drivers. 275 | To do that, either merge your host system's `/usr/lib/debug` into the SDK's 276 | `files/lib/debug`, or run `gdb` like this: 277 | 278 | gdb -iex \ 279 | 'set debug-file-directory /usr/lib/debug:/run/host/usr/lib/debug' \ 280 | ... 281 | 282 | This will work best if the host system also uses 283 | build-ID-based detached debug symbols, like Debian and Fedora. 284 | 285 | Alternatively, use versions of glibc and Mesa on the host system that 286 | were built with `gcc -g` and not stripped, such as Debian packages 287 | built with `DEB_BUILD_OPTIONS=nostrip`. 288 | -------------------------------------------------------------------------------- /doc/steamlinuxruntime-known-issues.md: -------------------------------------------------------------------------------- 1 | Common issues and workarounds 2 | ============================= 3 | 4 | Some issues involving the SteamLinuxRuntime framework and the 5 | pressure-vessel container-launcher are not straightforward to fix. 6 | Here are some that are likely to affect multiple users: 7 | 8 | Labelling of Steam Linux Runtime versions 9 | ----------------------------------------- 10 | 11 | The naming used for the various branches of the Steam Linux Runtime has 12 | not always been obvious. 13 | 14 | The term "Steam Play" is used in the Steam user interface to refer to 15 | all compatibility tools, including 16 | the Steam container runtime framework 17 | (a mechanism to run native Linux games on older or newer Linux distributions), 18 | Proton (a mechanism to run Windows games on Linux), 19 | and potentially other compatibility tools in future. 20 | 21 | The term "Steam Linux Runtime" is used in the Steam user interface to refer 22 | to the container runtime framework specifically. 23 | 24 | The "Steam Linux Runtime 1.0 (scout)" compatibility tool 25 | (application ID 1070560) 26 | combines Steam Runtime 1 libraries with a Steam Runtime 2 container, 27 | and is used to run historical native Linux games. 28 | Before September 2023, this was (confusingly) labelled "Steam Linux Runtime". 29 | The old name might still appear in some contexts. 30 | 31 | The "Steam Linux Runtime 2.0 (soldier)" tool (application ID 1391110) is 32 | used to run Proton 5.13 up to 7.0 and is also used internally 33 | by the "Steam Linux Runtime" tool. 34 | Before September 2023, this was labelled "Steam Linux Runtime - soldier". 35 | 36 | The "Steam Linux Runtime 3.0 (sniper)" tool (application ID 1628350) is 37 | used to run Proton 8.0 and some newer native Linux games. 38 | Before September 2023, this was labelled "Steam Linux Runtime - sniper". 39 | 40 | Disabling Steam Play disables all Steam Linux Runtime tools 41 | ----------------------------------------------------------- 42 | 43 | In Steam's global settings, there is an option to turn off all Steam Play 44 | compatibility tools. 45 | As well as disabling Proton, this also disables Steam Linux Runtime 3.0 46 | (sniper), which will result in games that require this runtime being 47 | launched in a way that does not work. 48 | This is a Steam client issue: it should not allow launching the affected 49 | games in this configuration. 50 | 51 | Games affected by this include Dota 2, Endless Sky and Retroarch. 52 | 53 | Workaround: in Steam's global Settings window, go to the Compatibility tab 54 | and ensure that "Enable Steam Play for supported titles" is checked. 55 | 56 | ([steam-for-linux#9852](https://github.com/ValveSoftware/steam-for-linux/issues/9852)) 57 | 58 | Switching Steam Linux Runtime branch sometimes requires a Steam restart 59 | ----------------------------------------------------------------------- 60 | 61 | When a game that was previously using an older runtime environment switches 62 | to Steam Linux Runtime 3.0 (sniper), sometimes the Steam client will 63 | continue to run that game in the older runtime until it is restarted. 64 | This is a Steam client issue: it should switch to the new runtime 65 | automatically. 66 | 67 | Games affected by this include Dota 2, Endless Sky and Retroarch. 68 | 69 | Workaround: allow Steam to download the updated game, then completely exit 70 | from Steam, and launch Steam again. This will only need to be done once: 71 | all subsequent game launches should work correctly. 72 | 73 | ([steam-for-linux#9835](https://github.com/ValveSoftware/steam-for-linux/issues/9835)) 74 | 75 | Forcing use of Steam Linux Runtime 1.0 (scout) for games requiring SLR 3 76 | ------------------------------------------------------------------------ 77 | 78 | It is currently possible for users to configure games to be run 79 | under Steam Linux Runtime 1.0 (scout), even if the game requires 80 | Steam Linux Runtime 3.0 (sniper), which often will not work. 81 | This is a Steam client issue: it should not allow this configuration. 82 | 83 | Games affected by this include Dota 2, Endless Sky and Retroarch. 84 | 85 | Workaround: in the game's Properties, go to the Compatibility tab and 86 | ensure that "Force the use of a specific compatibility tool" is unchecked. 87 | 88 | ([steam-for-linux#9844](https://github.com/ValveSoftware/steam-for-linux/issues/9844)) 89 | 90 | Flatpak app limitations 91 | ----------------------- 92 | 93 | Steam has been packaged as a Flatpak app by the Flathub community, but 94 | this Flatpak app is not officially supported by Valve. 95 | 96 | Using the Steam container runtimes from inside a Flatpak sandbox requires 97 | features that are not yet available in all Linux distributions. To use 98 | the container runtimes, you will need: 99 | 100 | * An operating system where 101 | [unprivileged users can create user namespaces](https://github.com/flatpak/flatpak/wiki/User-namespace-requirements#unprivileged-bubblewrap) 102 | (non-setuid bubblewrap) 103 | 104 | * Debian >= 11, but not Debian 10 or older 105 | * RHEL/CentOS >= 8, but not RHEL/CentOS 7 or older 106 | * Arch Linux with the default `linux` kernel, 107 | but not `linux-hardened` and `bubblewrap-suid` 108 | * Most other recent distributions, e.g. Ubuntu 109 | 110 | * Flatpak 1.12 or later 111 | 112 | * Ubuntu 18.04 and 20.04 users can get this from 113 | [the PPA](https://launchpad.net/~flatpak/+archive/ubuntu/stable/), 114 | and it is included in Ubuntu 22.04 LTS 115 | * Debian 11 users can get this from 116 | [official backports](https://backports.debian.org/Instructions/), 117 | and it is included in Debian 12 118 | 119 | As a workaround, users of older versions of Flatpak can try using 120 | [a community build of Proton](https://github.com/flathub/com.valvesoftware.Steam.CompatibilityTool.Proton) 121 | which uses the freedesktop.org runtime instead of Steam Runtime 2. 122 | 123 | ([#294](https://github.com/ValveSoftware/steam-runtime/issues/294), 124 | [Proton#4268](https://github.com/ValveSoftware/Proton/issues/4268), 125 | [Proton#4283](https://github.com/ValveSoftware/Proton/issues/4283), 126 | [com.valvesoftware.Steam#642](https://github.com/flathub/com.valvesoftware.Steam/issues/642), 127 | [flatpak#3797](https://github.com/flatpak/flatpak/issues/3797), 128 | [flatpak#4286](https://github.com/flatpak/flatpak/issues/4286)) 129 | 130 | Snap app limitations 131 | -------------------- 132 | 133 | Steam has been packaged as a Snap app by Canonical, but this Snap app is 134 | not officially supported by Valve. 135 | 136 | Using the Steam container runtimes from inside a Snap sandbox is 137 | relatively fragile, because its AppArmor profile depends on specific 138 | paths and operations. Some of the paths used are implementation details 139 | of Steam which can change over time, and some are likely to be different 140 | for different user configurations. 141 | 142 | In particular, installing the container runtimes into a Steam library 143 | outside `/home` is known not to work in the Snap app. 144 | 145 | ([#586](https://github.com/ValveSoftware/steam-runtime/issues/586), 146 | [#602](https://github.com/ValveSoftware/steam-runtime/issues/602), 147 | [steam-snap#27](https://github.com/canonical/steam-snap/issues/27), 148 | [steam-snap#126](https://github.com/canonical/steam-snap/issues/126), 149 | [steam-snap#289](https://github.com/canonical/steam-snap/issues/289)) 150 | 151 | Non-FHS operating systems 152 | ------------------------- 153 | 154 | Unusual directory layouts and `ld.so` names are not supported. 155 | The Debian/Ubuntu family, the Fedora/CentOS/Red Hat family, Arch Linux 156 | and openSUSE are most likely to work. 157 | 158 | Exherbo and ClearLinux have had issues in the past, but are currently 159 | believed to work successfully. The changes 160 | made to support these operating systems can be used as a basis to propose 161 | patches to make pressure-vessel work in other "almost-FHS" environments. 162 | 163 | NixOS has its own scripts to set up a FHS-compatible environment to run 164 | Steam. As of 2022, this should generally be compatible with pressure-vessel. 165 | Guix is in the same situation as NixOS. 166 | 167 | Other non-FHS distributions might also not work. 168 | We have prepared a document listing 169 | [assumptions made about the distribution][distro assumptions], which 170 | distribution developers might find useful. 171 | 172 | Workaround: don't enable Steam Linux Runtime or Proton 5.13 (or newer) 173 | on OSs with unusual directory layouts, or use the unofficial Flatpak app 174 | (requires Flatpak 1.12). 175 | 176 | [distro assumptions]: https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/distro-assumptions.md 177 | 178 | kernel.unprivileged\_userns\_clone 179 | ---------------------------------- 180 | 181 | The container runtime has the same 182 | [user namespace requirements](https://github.com/flatpak/flatpak/wiki/User-namespace-requirements) 183 | as Flatpak. 184 | Modern operating systems in their default configuration usually meet these 185 | requirements. 186 | 187 | On Debian 10 or older and SteamOS 2, either the `bubblewrap` package 188 | from the OS must be installed, or the `kernel.unprivileged_userns_clone` 189 | sysctl parameter must be set to 1. Debian 11 sets 190 | `kernel.unprivileged_userns_clone` to 1 by default. 191 | 192 | Similarly, on Arch Linux with the non-default `linux-hardened` 193 | kernel, either the `bubblewrap-suid` package must be installed, or the 194 | `kernel.unprivileged_userns_clone` sysctl parameter must be set to 1. 195 | 196 | If any other distributions use the `kernel.unprivileged_userns_clone` 197 | patch, they will have similar requirements. 198 | 199 | Note that if you are running Steam under Flatpak, a setuid version of 200 | `/usr/bin/bwrap` will not work: the `kernel.unprivileged_userns_clone` 201 | sysctl parameter must be set to 1 instead. 202 | 203 | ([#342](https://github.com/ValveSoftware/steam-runtime/issues/342), 204 | [#297](https://github.com/ValveSoftware/steam-runtime/issues/297)) 205 | 206 | vkBasalt with shaders in /usr/share 207 | ----------------------------------- 208 | 209 | The vkBasalt Vulkan layer crashes if told to load shaders that cannot 210 | be found. Configuring it to load shaders from `/usr/share` is not 211 | compatible with the Steam Linux Runtime container, because the container 212 | uses a different directory to provide its `/usr/share`. 213 | 214 | Workaround: copy the required shaders into your home directory and 215 | configure it to use them from that location, or disable vkBasalt with 216 | environment variable `DISABLE_VKBASALT=1`. 217 | 218 | ([#381](https://github.com/ValveSoftware/steam-runtime/issues/381), 219 | [vkBasalt#146](https://github.com/DadSchoorse/vkBasalt/issues/146)) 220 | 221 | Older NVIDIA drivers 222 | -------------------- 223 | 224 | Older versions of the proprietary NVIDIA drivers are incompatible with 225 | Proton, and have been observed to trigger crashes in the container runtime 226 | even when not using Proton. 227 | 228 | The 390.x drivers are known **not** to work with the container runtime. 229 | Unfortunately, this is the newest series supporting 230 | [GPUs based on the Fermi microarchitecture][fermi] (GFxxx, NVC0, 2010-2012), 231 | such as the GeForce GTX 470 and GTX 590, so users of Fermi or older GPUs 232 | will be unable to use the container runtime. 233 | 234 | [fermi]: https://sources.debian.org/src/nvidia-graphics-drivers/470.129.06-6~deb11u1/debian/end-of-life-390.list/ 235 | 236 | If your GPU is supported by a later NVIDIA driver version, please upgrade 237 | to the newer driver. 238 | For users of [GPUs based on the Kepler microarchitecture][kepler] 239 | (GKxxx, NVE0, 2012-2014), the [470.x legacy drivers][nvidia-archive] are 240 | recommended. 241 | For users of newer GPUs, either 470.x or a newer version is recommended. 242 | 243 | [kepler]: https://sources.debian.org/src/nvidia-graphics-drivers/470.129.06-6~deb11u1/debian/end-of-life-470.list/ 244 | [nvidia-archive]: https://www.nvidia.com/en-us/drivers/unix/ 245 | 246 | ([#420](https://github.com/ValveSoftware/steam-runtime/issues/420)) 247 | 248 | Multiple-GPU systems 249 | -------------------------------------------- 250 | 251 | Some systems have more than one GPU, typically a slower Intel or AMD 252 | integrated GPU built in to the CPU, and a faster NVIDIA or AMD discrete 253 | GPU as a separate module. 254 | 255 | The mechanism for selecting the correct Vulkan driver and GPU on Linux 256 | is not fully settled, and the container can interfere with this, resulting 257 | in the wrong GPU or driver being selected. This can result in the game 258 | either running more slowly than it should, or not running successfully 259 | at all. 260 | 261 | On desktop systems, if you intend to use the discrete GPU for everything, 262 | the simplest configuration is to configure the firmware (BIOS/EFI) so the 263 | discrete GPU is used, and connect the display to the discrete GPU. 264 | 265 | On laptops where the display is connected to the integrated GPU but a 266 | more powerful discrete GPU is also available (NVIDIA Optimus or AMD 267 | Switchable Graphics), the most reliable configuration seems to be to use 268 | PRIME GPU offloading (NVIDIA Prime Render Offload for NVIDIA devices, 269 | DRI PRIME for AMD devices). 270 | 271 | Some systems, such as Ubuntu, provide a graphical user interface for 272 | switching between Intel-only, NVIDIA-on-demand and NVIDIA-only modes on 273 | NVIDIA Optimus laptops. In recent versions this is based on PRIME GPU 274 | offloading, and the most reliable configuration seems to be to 275 | select NVIDIA-on-demand, then use the mechanisms described below to 276 | request that Steam and/or individual games run on the NVIDIA GPU. 277 | 278 | Recent versions of GNOME (GNOME Shell 3.38+) and KDE Plasma Desktop 279 | (KDE Frameworks 5.30+) have built-in support for marking applications to 280 | be run using a specific GPU. If Steam is run like this, then most games 281 | should also run on the same GPU, with no further action required. 282 | 283 | Marking applications to be run using a specific GPU works by setting the 284 | environment variables described below. If you run Steam from a terminal 285 | for debugging or development, you will need to set those environment 286 | variables manually. 287 | 288 | On recent NVIDIA systems, you can request NVIDIA Prime Render Offload 289 | for Vulkan by running either Steam or individual games with the environment 290 | variable `__NV_PRIME_RENDER_OFFLOAD=1` set. It might also be helpful to set 291 | `__VK_LAYER_NV_optimus=NVIDIA_only` (which specifically asks the Vulkan 292 | layer to use only NVIDIA GPUs) and `__GLX_VENDOR_LIBRARY_NAME=nvidia` 293 | (which does the same for OpenGL rather than Vulkan). For example, 294 | [Arch Linux's prime-run script](https://github.com/archlinux/svntogit-packages/tree/packages/nvidia-prime/trunk) 295 | implements this approach. 296 | 297 | Similarly, on recent Mesa systems, you can request DRI PRIME offloading by 298 | running Steam or individual games with the environment variable 299 | `DRI_PRIME=1` set. 300 | 301 | Using Bumblebee and Primus (`optirun`, `primusrun`, `pvkrun`, `primus_vk`) 302 | adds an extra layer of complexity that does not work reliably with the 303 | container runtime. We recommend using NVIDIA Prime Render Offload or 304 | DRI PRIME offloading instead, if possible. 305 | 306 | ([#312](https://github.com/ValveSoftware/steam-runtime/issues/312), 307 | [#352](https://github.com/ValveSoftware/steam-runtime/issues/352); 308 | maybe also 309 | [#340](https://github.com/ValveSoftware/steam-runtime/issues/340), 310 | [#341](https://github.com/ValveSoftware/steam-runtime/issues/341)) 311 | 312 | /usr/local 313 | ---------- 314 | 315 | pressure-vessel does not support having a Steam Library below `/usr`, 316 | including `/usr/local`. For example, `/usr/local/steam-library` will 317 | not work. 318 | 319 | Workaround: move the Steam Library to a different directory, 320 | perhaps using bind-mount to make enough space available in a suitable 321 | location. 322 | 323 | ([#288](https://github.com/ValveSoftware/steam-runtime/issues/288)) 324 | 325 | Steam Workshop outside the home directory 326 | ----------------------------------------- 327 | 328 | If a game has Steam Workshop support and is installed outside your 329 | home directory, it will not necessarily find the Steam Workshop content. 330 | 331 | Workaround: Move it to your home directory, as above. 332 | 333 | ([#257](https://github.com/ValveSoftware/steam-runtime/issues/257)) 334 | 335 | Non-Steam games 336 | --------------- 337 | 338 | Non-Steam games are not currently supported. 339 | 340 | Workaround: don't use Steam Linux Runtime for those games yet. 341 | 342 | ([#228](https://github.com/ValveSoftware/steam-runtime/issues/228)) 343 | 344 | Audio 345 | ----- 346 | 347 | The recommended audio framework is PulseAudio. Pipewire emulating a 348 | PulseAudio server should also work. Using ALSA or OSS might work, but 349 | is not really supported. JACK is not supported, because its IPC protocol 350 | is not compatible between different JACK versions, so there is no version 351 | of the JACK library that would be suitable for all host OSs. 352 | 353 | Workaround: use PulseAudio. 354 | 355 | ([#307](https://github.com/ValveSoftware/steam-runtime/issues/307), 356 | [#344](https://github.com/ValveSoftware/steam-runtime/issues/344)) 357 | 358 | Sharing directories with the container 359 | -------------------------------------- 360 | 361 | By default, most of the directories that might be used by a game are 362 | shared between the real system and the container: 363 | 364 | * your home directory 365 | * the Steam library containing the actual game 366 | * the directory containing Proton, if used 367 | * the installation directory for Steam itself 368 | * the shader cache 369 | * `/home` 370 | * `/media` 371 | * `/mnt` 372 | * `/opt` 373 | * `/run/media` 374 | * `/srv` 375 | 376 | Directories outside those areas are usually not shared with 377 | the container. In particular, this can affect games that ask you to browse 378 | for a directory to be used for storage, like Microsoft Flight Simulator, 379 | if your large storage directory is mounted at a custom location such 380 | as `/hdd`. 381 | 382 | You can force them to be shared by setting the environment variable 383 | `PRESSURE_VESSEL_FILESYSTEMS_RO` and/or `PRESSURE_VESSEL_FILESYSTEMS_RW` 384 | to a colon-separated list of paths. Paths in 385 | `PRESSURE_VESSEL_FILESYSTEMS_RO` are read-only and paths in 386 | `PRESSURE_VESSEL_FILESYSTEMS_RW` are read/write. 387 | 388 | Example: 389 | 390 | export PRESSURE_VESSEL_FILESYSTEMS_RO="$MANGOHUD_CONFIGFILE" 391 | export PRESSURE_VESSEL_FILESYSTEMS_RW="/hdd:/archival:/stuff/games" 392 | steam 393 | 394 | Symbolic links between directories 395 | ---------------------------------- 396 | 397 | Symbolic links that cross between directories tend to cause trouble for 398 | container frameworks. Consider using bind mounts instead, particularly 399 | for system-level directories (outside the home directory). 400 | 401 | If a directory that will be shared with the container is a symbolic link 402 | to some other directory, please make sure that the target of the symbolic 403 | link is also in a directory that is 404 | [shared with the container](#sharing-directories-with-the-container). 405 | 406 | When using Proton, please avoid using symbolic links to redirect part of 407 | an emulated Windows drive to a different location. This can easily break 408 | assumptions made by Windows games. 409 | 410 | ([#334](https://github.com/ValveSoftware/steam-runtime/issues/334)) 411 | 412 | Some directories will cause the container launcher to exit with an error 413 | if they are symbolic links. Please report these as bugs if they have not 414 | already been reported, but they are unlikely to be easy to fix (we already 415 | fixed the easier cases). Workaround: use bind mounts instead. 416 | 417 | ([#291](https://github.com/ValveSoftware/steam-runtime/issues/291), 418 | [#321](https://github.com/ValveSoftware/steam-runtime/issues/321), 419 | [#368](https://github.com/ValveSoftware/steam-runtime/issues/368)) 420 | 421 | Common issues and workarounds specific to 'scout' 422 | ------------------------------------------------- 423 | 424 | Using the Steam Runtime 1 `scout` runtime in a container is considered 425 | experimental, and is not expected to work for all games. Native Linux 426 | games that were compiled for Steam Runtime 1 `scout` are intended to be 427 | run in the older `LD_LIBRARY_PATH`-based Steam Runtime. 428 | 429 | ### Updating "Steam Linux Runtime 1.0 (scout)" compatibility tool 430 | 431 | Due to a Steam limitation, after updating to version 0.20210630.32 or 432 | later, it is necessary to exit from Steam completely and re-launch Steam, 433 | so that the updated compatibility tool configuration will be loaded. 434 | Until Steam has been restarted, trying to launch a game with the 435 | "Steam Linux Runtime 1.0 (scout)" compatibility tool will show an error message 436 | asking for a Steam restart. 437 | 438 | Reporting other issues 439 | ---------------------- 440 | 441 | Please report other issues you encounter to 442 | , making sure to include 443 | the information described in the 444 | [bug reporting guide](reporting-steamlinuxruntime-bugs.md). 445 | -------------------------------------------------------------------------------- /setup_chroot.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | SCRIPT="$(readlink -f "$0")" 4 | SCRIPTNAME="$(basename "$SCRIPT")" 5 | SCRIPT_DIR="$(dirname "$SCRIPT")" 6 | LOGFILE="" 7 | CHROOT_PREFIX="steamrt_" 8 | CHROOT_DIR="/var/chroots" 9 | CHROOT_NAME="" 10 | 11 | # exit on any script line that fails 12 | set -o errexit 13 | # bail on any unitialized variable reads 14 | set -o nounset 15 | # bail on failing commands before last pipe 16 | set -o pipefail 17 | 18 | # Output helpers 19 | COLOR_OFF="" 20 | COLOR_ON="" 21 | if [[ $(tput colors 2>/dev/null || echo 0) -gt 0 ]]; then 22 | COLOR_ON=$'\e[93;1m' 23 | COLOR_OFF=$'\e[0m' 24 | fi 25 | 26 | FORCE=0 27 | 28 | sh_quote () 29 | { 30 | local quoted 31 | if [ $# -gt 0 ]; then 32 | quoted="$(printf '%q ' "$@")" 33 | echo "${quoted:0:-1}" 34 | fi 35 | } 36 | 37 | prebuild_chroot() 38 | { 39 | local name 40 | 41 | # install some packages 42 | echo -e "\\n${COLOR_ON}Installing schroot...${COLOR_OFF}" 43 | sudo -E apt-get install -y schroot 44 | 45 | # Check if there are any active schroot sessions right now and warn if so... 46 | schroot_list=$(schroot --list --all-sessions | head -n 1) 47 | if [ -n "$schroot_list" ]; then 48 | tput setaf 3 49 | echo -e "\\nWARNING: Schroot says you have a currently active session!\\n" 50 | tput sgr0 51 | echo " ${schroot_list}" 52 | echo "" 53 | if [ ${FORCE} -eq 0 ]; then 54 | read -r -p "Are you sure you want to continue (y/n)? " 55 | if [[ "$REPLY" != [Yy] ]]; then 56 | echo -e "Cancelled...\\n" 57 | exit 1 58 | fi 59 | fi 60 | fi 61 | 62 | STEAM_RUNTIME_SPEW_WARNING= 63 | for var in "$@"; do 64 | if [ -n "$CHROOT_NAME" ]; then 65 | name="$CHROOT_NAME" 66 | else 67 | name="${CHROOT_PREFIX}${var/--/}" 68 | fi 69 | 70 | dirname="${CHROOT_DIR}/${name}" 71 | if [ -d "${dirname}" ]; then 72 | tput setaf 3 73 | STEAM_RUNTIME_SPEW_WARNING=1 74 | echo -e "About to remove ${dirname} and re-install..." 75 | tput sgr0 76 | fi 77 | done 78 | 79 | if [[ "$STEAM_RUNTIME_SPEW_WARNING" == "1" ]]; then 80 | if [ ${FORCE} -eq 0 ]; then 81 | read -r -p " This ok (y/n)? " 82 | if [[ "$REPLY" != [Yy] ]]; then 83 | echo -e "Cancelled...\\n" 84 | exit 1 85 | fi 86 | fi 87 | fi 88 | } 89 | 90 | copy_apt_settings () 91 | { 92 | local sysroot="$1" 93 | 94 | if [ "$1/" -ef / ]; then 95 | echo "Internal error: sysroot $1 is the same file as the real root" >&2 96 | exit 1 97 | fi 98 | 99 | # Copy over proxy settings from host machine 100 | echo -e "\\n${COLOR_ON}Adding proxy info to chroot (if set)...${COLOR_OFF}" 101 | set +o pipefail 102 | env | grep -i "_proxy=" | grep -v PERSISTENT_HISTORY_LAST | xargs -i echo export {} | sudo tee "$sysroot/etc/profile.d/steamrtproj.sh" 103 | env | grep -i "_proxy=" | grep -v PERSISTENT_HISTORY_LAST | xargs -i echo export {} | sudo tee -a "$sysroot/etc/environment" 104 | set -o pipefail 105 | sudo rm -rf "$sysroot/etc/apt/apt.conf" 106 | if [ -f /etc/apt/apt.conf ]; then sudo cp "/etc/apt/apt.conf" "$sysroot/etc/apt"; fi 107 | } 108 | 109 | untar_chroot () 110 | { 111 | # untar_chroot {--amd64 | --i386} TARBALL 112 | # Unpack a sysroot tarball for the specified architecture. 113 | 114 | case "$1" in 115 | "--i386" ) 116 | pkg="i386" 117 | personality="linux32" 118 | ;; 119 | "--amd64" ) 120 | pkg="amd64" 121 | personality="linux" 122 | ;; 123 | * ) 124 | echo "Error: Unrecognized argument: $1" 125 | exit 1 126 | ;; 127 | esac 128 | 129 | shift 130 | 131 | local tarball="$1" 132 | local name 133 | 134 | if [ -n "$CHROOT_NAME" ]; then 135 | name="$CHROOT_NAME" 136 | else 137 | name="${CHROOT_PREFIX}${pkg}" 138 | fi 139 | 140 | local sysroot="${CHROOT_DIR}/${name}" 141 | 142 | # blow away existing directories and recreate empty ones 143 | echo -e "\\n${COLOR_ON}Creating $sysroot..." 144 | sudo rm -rf "$sysroot" 145 | sudo mkdir -p "$sysroot" 146 | 147 | # Create our schroot .conf file 148 | echo -e "\\n${COLOR_ON}Creating /etc/schroot/chroot.d/${name}.conf...${COLOR_OFF}" 149 | printf '[%s]\ndescription=%s\ndirectory=%s\npersonality=%s\ngroups=sudo\nroot-groups=sudo\npreserve-environment=true\ntype=directory\n' "${name}" "${tarball##*/}" "${sysroot}" "${personality}" | sudo tee "/etc/schroot/chroot.d/${name}.conf" 150 | 151 | # Create our chroot 152 | echo -e "\\n${COLOR_ON}Unpacking the chroot...${COLOR_OFF}" 153 | sudo tar --auto-compress -C "$sysroot" -xf "$tarball" 154 | 155 | copy_apt_settings "$sysroot" 156 | 157 | # Implement --extra-apt-source 158 | if [ -n "${extra_apt_sources+set}" ]; then 159 | for line in "${extra_apt_sources[@]}"; do 160 | printf '%s\n' "$line" 161 | done > "$sysroot/etc/apt/sources.list.d/steamrt-extra.list" 162 | fi 163 | 164 | if [ -n "$(sudo find "$sysroot" -xdev '(' -uid +99 -o -gid +99 ')' -ls)" ]; then 165 | echo -e "\\n${COLOR_ON}Warning: these files might have incorrect uid mapping${COLOR_OFF}" >&2 166 | sudo find "$sysroot" -xdev '(' -uid +99 -o -gid +99 ')' -ls >&2 167 | fi 168 | } 169 | 170 | # https://stackoverflow.com/questions/64786/error-handling-in-bash 171 | function cleanup() 172 | { 173 | echo -e "\\nenv is:\\n$(env)\\n" 174 | echo "ERROR: ${SCRIPTNAME} just hit error handler." 175 | echo " BASH_COMMAND is \"${BASH_COMMAND}\"" 176 | echo " BASH_VERSION is $BASH_VERSION" 177 | echo " pwd is \"$(pwd)\"" 178 | echo " PATH is \"$PATH\"" 179 | echo "" 180 | 181 | tput setaf 3 182 | echo "A command returned error. See the logfile: ${LOGFILE}" 183 | tput sgr0 184 | } 185 | 186 | usage() 187 | { 188 | if [ "$1" -ne 0 ]; then 189 | exec >&2 190 | fi 191 | 192 | echo "Usage: $0 [--beta | --suite SUITE] [--name NAME] [--extra-apt-source 'deb http://MIRROR SUITE COMPONENT...'] [--output-dir ] [--logfile FILE] --tarball TARBALL --i386|--amd64" 193 | exit "$1" 194 | } 195 | 196 | main() 197 | { 198 | local getopt_temp 199 | getopt_temp="$(getopt -o '' --long \ 200 | 'force,amd64,beta,extra-apt-source:,i386,name:,output-dir:,logfile:,suite:,tarball:,help' \ 201 | -n "$0" -- "$@")" 202 | eval set -- "$getopt_temp" 203 | unset getopt_temp 204 | 205 | local arch= 206 | local -a setup_arguments=() 207 | local suite=scout 208 | local suite_suffix= 209 | local tarball= 210 | 211 | # Create a copy of the arguments 212 | local args=("$@") 213 | 214 | while [ "$#" -gt 0 ]; do 215 | case "$1" in 216 | (--force) 217 | FORCE=1 218 | shift 219 | ;; 220 | 221 | (--amd64|--i386) 222 | if [ -n "$arch" ] && [ "$arch" != "$1" ]; then 223 | echo "Error: $1 conflicts with $arch" >&2 224 | usage 2 225 | fi 226 | arch="$1" 227 | shift 228 | ;; 229 | 230 | (--beta) 231 | setup_arguments+=(--beta) 232 | suite_suffix=_beta 233 | shift 234 | ;; 235 | 236 | (--name) 237 | CHROOT_NAME="$2" 238 | shift 2 239 | ;; 240 | 241 | (--extra-apt-source) 242 | setup_arguments+=("$1" "$2") 243 | shift 2 244 | ;; 245 | 246 | (--help) 247 | usage 0 248 | ;; 249 | 250 | (--logfile) 251 | LOGFILE="$2" 252 | shift 2 253 | ;; 254 | 255 | (--output-dir) 256 | CHROOT_DIR="$2" 257 | shift 2 258 | ;; 259 | 260 | (--suite) 261 | suite="$2" 262 | setup_arguments+=(--suite "$2") 263 | shift 2 264 | ;; 265 | 266 | (--tarball) 267 | tarball="$2" 268 | shift 2 269 | ;; 270 | 271 | (--) 272 | shift 273 | break 274 | ;; 275 | 276 | (-*) 277 | usage 2 278 | ;; 279 | 280 | (*) 281 | # no non-option arguments are currently allowed 282 | usage 2 283 | break 284 | ;; 285 | esac 286 | done 287 | 288 | # Launch ourselves with script so we can time this and get a log file 289 | if [[ ! -v SETUP_CHROOT_LOGGING_STARTED ]]; then 290 | if command -v script >/dev/null; then 291 | export SETUP_CHROOT_LOGGING_STARTED=1 292 | export SHELL=/bin/bash 293 | if [ -z "$LOGFILE" ]; then 294 | LOGFILE="$(mktemp --tmpdir steam-runtime-setup-chroot-XXX.log)" 295 | fi 296 | script --return --command "time $SCRIPT $(sh_quote "${args[@]}")" "${LOGFILE}" 297 | exit $? 298 | else 299 | echo >&2 "!! 'script' command not found, will not auto-generate a log file" 300 | # Continue 301 | fi 302 | fi 303 | 304 | CHROOT_PREFIX="${CHROOT_PREFIX}${suite}${suite_suffix}_" 305 | 306 | if [ -z "$tarball" ]; then 307 | echo "This script no longer bootstraps chroots from first principles." >&2 308 | echo "Use --tarball to provide a pre-prepared sysroot." >&2 309 | usage 2 310 | fi 311 | 312 | if [ -z "$arch" ]; then 313 | usage 2 314 | fi 315 | 316 | # Building root(s) 317 | prebuild_chroot "$arch" 318 | trap cleanup EXIT 319 | untar_chroot "$arch" "$tarball" 320 | trap - EXIT 321 | 322 | echo -e "\\n${COLOR_ON}Done...${COLOR_OFF}" 323 | } 324 | 325 | main "$@" 326 | 327 | # vi: ts=4 sw=4 noexpandtab 328 | -------------------------------------------------------------------------------- /templates/COPYING: -------------------------------------------------------------------------------- 1 | 2 | This is a collection of software packages for the Steam Linux Runtime. 3 | 4 | Each individual package has its own licensing terms, typically in: 5 | usr/share/doc//copyright. 6 | 7 | The scripts used to build these packages can be found on GitHub: 8 | https://github.com/ValveSoftware/steam-runtime 9 | 10 | The source code and debug versions of the packages can be found here: 11 | https://repo.steampowered.com/PLACEHOLDER_URL 12 | 13 | 14 | The scripts and other documentation contributed by Valve are covered under 15 | the following copyright notice: 16 | 17 | Copyright (C) 2013 Valve Corporation 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy of these scripts 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: 20 | 21 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 22 | 23 | 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. 24 | -------------------------------------------------------------------------------- /templates/README.txt: -------------------------------------------------------------------------------- 1 | 2 | This is a collection of software packages for the Steam Linux Runtime. 3 | 4 | Each individual package has its own licensing terms, typically in: 5 | usr/share/doc//copyright. 6 | 7 | The scripts used to build these packages can be found on GitHub: 8 | https://github.com/ValveSoftware/steam-runtime 9 | 10 | The source code and debug versions of the packages can be found here: 11 | https://repo.steampowered.com/PLACEHOLDER_URL 12 | 13 | 14 | The scripts and other documentation contributed by Valve are covered under 15 | the following copyright notice: 16 | 17 | Copyright (C) 2013 Valve Corporation 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy of these scripts 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: 20 | 21 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 22 | 23 | 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. 24 | -------------------------------------------------------------------------------- /templates/common-licenses/Apache-2.0: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /templates/common-licenses/Artistic: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | The "Artistic License" 6 | 7 | Preamble 8 | 9 | The intent of this document is to state the conditions under which a 10 | Package may be copied, such that the Copyright Holder maintains some 11 | semblance of artistic control over the development of the package, 12 | while giving the users of the package the right to use and distribute 13 | the Package in a more-or-less customary fashion, plus the right to make 14 | reasonable modifications. 15 | 16 | Definitions: 17 | 18 | "Package" refers to the collection of files distributed by the 19 | Copyright Holder, and derivatives of that collection of files 20 | created through textual modification. 21 | 22 | "Standard Version" refers to such a Package if it has not been 23 | modified, or has been modified in accordance with the wishes 24 | of the Copyright Holder as specified below. 25 | 26 | "Copyright Holder" is whoever is named in the copyright or 27 | copyrights for the package. 28 | 29 | "You" is you, if you're thinking about copying or distributing 30 | this Package. 31 | 32 | "Reasonable copying fee" is whatever you can justify on the 33 | basis of media cost, duplication charges, time of people involved, 34 | and so on. (You will not be required to justify it to the 35 | Copyright Holder, but only to the computing community at large 36 | as a market that must bear the fee.) 37 | 38 | "Freely Available" means that no fee is charged for the item 39 | itself, though there may be fees involved in handling the item. 40 | It also means that recipients of the item may redistribute it 41 | under the same conditions they received it. 42 | 43 | 1. You may make and give away verbatim copies of the source form of the 44 | Standard Version of this Package without restriction, provided that you 45 | duplicate all of the original copyright notices and associated disclaimers. 46 | 47 | 2. You may apply bug fixes, portability fixes and other modifications 48 | derived from the Public Domain or from the Copyright Holder. A Package 49 | modified in such a way shall still be considered the Standard Version. 50 | 51 | 3. You may otherwise modify your copy of this Package in any way, provided 52 | that you insert a prominent notice in each changed file stating how and 53 | when you changed that file, and provided that you do at least ONE of the 54 | following: 55 | 56 | a) place your modifications in the Public Domain or otherwise make them 57 | Freely Available, such as by posting said modifications to Usenet or 58 | an equivalent medium, or placing the modifications on a major archive 59 | site such as uunet.uu.net, or by allowing the Copyright Holder to include 60 | your modifications in the Standard Version of the Package. 61 | 62 | b) use the modified Package only within your corporation or organization. 63 | 64 | c) rename any non-standard executables so the names do not conflict 65 | with standard executables, which must also be provided, and provide 66 | a separate manual page for each non-standard executable that clearly 67 | documents how it differs from the Standard Version. 68 | 69 | d) make other distribution arrangements with the Copyright Holder. 70 | 71 | 4. You may distribute the programs of this Package in object code or 72 | executable form, provided that you do at least ONE of the following: 73 | 74 | a) distribute a Standard Version of the executables and library files, 75 | together with instructions (in the manual page or equivalent) on where 76 | to get the Standard Version. 77 | 78 | b) accompany the distribution with the machine-readable source of 79 | the Package with your modifications. 80 | 81 | c) give non-standard executables non-standard names, and clearly 82 | document the differences in manual pages (or equivalent), together 83 | with instructions on where to get the Standard Version. 84 | 85 | d) make other distribution arrangements with the Copyright Holder. 86 | 87 | 5. You may charge a reasonable copying fee for any distribution of this 88 | Package. You may charge any fee you choose for support of this 89 | Package. You may not charge a fee for this Package itself. However, 90 | you may distribute this Package in aggregate with other (possibly 91 | commercial) programs as part of a larger (possibly commercial) software 92 | distribution provided that you do not advertise this Package as a 93 | product of your own. You may embed this Package's interpreter within 94 | an executable of yours (by linking); this shall be construed as a mere 95 | form of aggregation, provided that the complete Standard Version of the 96 | interpreter is so embedded. 97 | 98 | 6. The scripts and library files supplied as input to or produced as 99 | output from the programs of this Package do not automatically fall 100 | under the copyright of this Package, but belong to whoever generated 101 | them, and may be sold commercially, and may be aggregated with this 102 | Package. If such scripts or library files are aggregated with this 103 | Package via the so-called "undump" or "unexec" methods of producing a 104 | binary executable image, then distribution of such an image shall 105 | neither be construed as a distribution of this Package nor shall it 106 | fall under the restrictions of Paragraphs 3 and 4, provided that you do 107 | not represent such an executable image as a Standard Version of this 108 | Package. 109 | 110 | 7. C subroutines (or comparably compiled subroutines in other 111 | languages) supplied by you and linked into this Package in order to 112 | emulate subroutines and variables of the language defined by this 113 | Package shall not be considered part of this Package, but are the 114 | equivalent of input as in Paragraph 6, provided these subroutines do 115 | not change the language in any way that would cause it to fail the 116 | regression tests for the language. 117 | 118 | 8. Aggregation of this Package with a commercial distribution is always 119 | permitted provided that the use of this Package is embedded; that is, 120 | when no overt attempt is made to make this Package's interfaces visible 121 | to the end user of the commercial distribution. Such use shall not be 122 | construed as a distribution of this Package. 123 | 124 | 9. The name of the Copyright Holder may not be used to endorse or promote 125 | products derived from this software without specific prior written permission. 126 | 127 | 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR 128 | IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 129 | WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 130 | 131 | The End 132 | -------------------------------------------------------------------------------- /templates/common-licenses/BSD: -------------------------------------------------------------------------------- 1 | Copyright (c) The Regents of the University of California. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 3. Neither the name of the University nor the names of its contributors 13 | may be used to endorse or promote products derived from this software 14 | without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 | SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /templates/common-licenses/GFDL-1.2: -------------------------------------------------------------------------------- 1 | GNU Free Documentation License 2 | Version 1.2, November 2002 3 | 4 | 5 | Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 6 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 7 | Everyone is permitted to copy and distribute verbatim copies 8 | of this license document, but changing it is not allowed. 9 | 10 | 11 | 0. PREAMBLE 12 | 13 | The purpose of this License is to make a manual, textbook, or other 14 | functional and useful document "free" in the sense of freedom: to 15 | assure everyone the effective freedom to copy and redistribute it, 16 | with or without modifying it, either commercially or noncommercially. 17 | Secondarily, this License preserves for the author and publisher a way 18 | to get credit for their work, while not being considered responsible 19 | for modifications made by others. 20 | 21 | This License is a kind of "copyleft", which means that derivative 22 | works of the document must themselves be free in the same sense. It 23 | complements the GNU General Public License, which is a copyleft 24 | license designed for free software. 25 | 26 | We have designed this License in order to use it for manuals for free 27 | software, because free software needs free documentation: a free 28 | program should come with manuals providing the same freedoms that the 29 | software does. But this License is not limited to software manuals; 30 | it can be used for any textual work, regardless of subject matter or 31 | whether it is published as a printed book. We recommend this License 32 | principally for works whose purpose is instruction or reference. 33 | 34 | 35 | 1. APPLICABILITY AND DEFINITIONS 36 | 37 | This License applies to any manual or other work, in any medium, that 38 | contains a notice placed by the copyright holder saying it can be 39 | distributed under the terms of this License. Such a notice grants a 40 | world-wide, royalty-free license, unlimited in duration, to use that 41 | work under the conditions stated herein. The "Document", below, 42 | refers to any such manual or work. Any member of the public is a 43 | licensee, and is addressed as "you". You accept the license if you 44 | copy, modify or distribute the work in a way requiring permission 45 | under copyright law. 46 | 47 | A "Modified Version" of the Document means any work containing the 48 | Document or a portion of it, either copied verbatim, or with 49 | modifications and/or translated into another language. 50 | 51 | A "Secondary Section" is a named appendix or a front-matter section of 52 | the Document that deals exclusively with the relationship of the 53 | publishers or authors of the Document to the Document's overall subject 54 | (or to related matters) and contains nothing that could fall directly 55 | within that overall subject. (Thus, if the Document is in part a 56 | textbook of mathematics, a Secondary Section may not explain any 57 | mathematics.) The relationship could be a matter of historical 58 | connection with the subject or with related matters, or of legal, 59 | commercial, philosophical, ethical or political position regarding 60 | them. 61 | 62 | The "Invariant Sections" are certain Secondary Sections whose titles 63 | are designated, as being those of Invariant Sections, in the notice 64 | that says that the Document is released under this License. If a 65 | section does not fit the above definition of Secondary then it is not 66 | allowed to be designated as Invariant. The Document may contain zero 67 | Invariant Sections. If the Document does not identify any Invariant 68 | Sections then there are none. 69 | 70 | The "Cover Texts" are certain short passages of text that are listed, 71 | as Front-Cover Texts or Back-Cover Texts, in the notice that says that 72 | the Document is released under this License. A Front-Cover Text may 73 | be at most 5 words, and a Back-Cover Text may be at most 25 words. 74 | 75 | A "Transparent" copy of the Document means a machine-readable copy, 76 | represented in a format whose specification is available to the 77 | general public, that is suitable for revising the document 78 | straightforwardly with generic text editors or (for images composed of 79 | pixels) generic paint programs or (for drawings) some widely available 80 | drawing editor, and that is suitable for input to text formatters or 81 | for automatic translation to a variety of formats suitable for input 82 | to text formatters. A copy made in an otherwise Transparent file 83 | format whose markup, or absence of markup, has been arranged to thwart 84 | or discourage subsequent modification by readers is not Transparent. 85 | An image format is not Transparent if used for any substantial amount 86 | of text. A copy that is not "Transparent" is called "Opaque". 87 | 88 | Examples of suitable formats for Transparent copies include plain 89 | ASCII without markup, Texinfo input format, LaTeX input format, SGML 90 | or XML using a publicly available DTD, and standard-conforming simple 91 | HTML, PostScript or PDF designed for human modification. Examples of 92 | transparent image formats include PNG, XCF and JPG. Opaque formats 93 | include proprietary formats that can be read and edited only by 94 | proprietary word processors, SGML or XML for which the DTD and/or 95 | processing tools are not generally available, and the 96 | machine-generated HTML, PostScript or PDF produced by some word 97 | processors for output purposes only. 98 | 99 | The "Title Page" means, for a printed book, the title page itself, 100 | plus such following pages as are needed to hold, legibly, the material 101 | this License requires to appear in the title page. For works in 102 | formats which do not have any title page as such, "Title Page" means 103 | the text near the most prominent appearance of the work's title, 104 | preceding the beginning of the body of the text. 105 | 106 | A section "Entitled XYZ" means a named subunit of the Document whose 107 | title either is precisely XYZ or contains XYZ in parentheses following 108 | text that translates XYZ in another language. (Here XYZ stands for a 109 | specific section name mentioned below, such as "Acknowledgements", 110 | "Dedications", "Endorsements", or "History".) To "Preserve the Title" 111 | of such a section when you modify the Document means that it remains a 112 | section "Entitled XYZ" according to this definition. 113 | 114 | The Document may include Warranty Disclaimers next to the notice which 115 | states that this License applies to the Document. These Warranty 116 | Disclaimers are considered to be included by reference in this 117 | License, but only as regards disclaiming warranties: any other 118 | implication that these Warranty Disclaimers may have is void and has 119 | no effect on the meaning of this License. 120 | 121 | 122 | 2. VERBATIM COPYING 123 | 124 | You may copy and distribute the Document in any medium, either 125 | commercially or noncommercially, provided that this License, the 126 | copyright notices, and the license notice saying this License applies 127 | to the Document are reproduced in all copies, and that you add no other 128 | conditions whatsoever to those of this License. You may not use 129 | technical measures to obstruct or control the reading or further 130 | copying of the copies you make or distribute. However, you may accept 131 | compensation in exchange for copies. If you distribute a large enough 132 | number of copies you must also follow the conditions in section 3. 133 | 134 | You may also lend copies, under the same conditions stated above, and 135 | you may publicly display copies. 136 | 137 | 138 | 3. COPYING IN QUANTITY 139 | 140 | If you publish printed copies (or copies in media that commonly have 141 | printed covers) of the Document, numbering more than 100, and the 142 | Document's license notice requires Cover Texts, you must enclose the 143 | copies in covers that carry, clearly and legibly, all these Cover 144 | Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on 145 | the back cover. Both covers must also clearly and legibly identify 146 | you as the publisher of these copies. The front cover must present 147 | the full title with all words of the title equally prominent and 148 | visible. You may add other material on the covers in addition. 149 | Copying with changes limited to the covers, as long as they preserve 150 | the title of the Document and satisfy these conditions, can be treated 151 | as verbatim copying in other respects. 152 | 153 | If the required texts for either cover are too voluminous to fit 154 | legibly, you should put the first ones listed (as many as fit 155 | reasonably) on the actual cover, and continue the rest onto adjacent 156 | pages. 157 | 158 | If you publish or distribute Opaque copies of the Document numbering 159 | more than 100, you must either include a machine-readable Transparent 160 | copy along with each Opaque copy, or state in or with each Opaque copy 161 | a computer-network location from which the general network-using 162 | public has access to download using public-standard network protocols 163 | a complete Transparent copy of the Document, free of added material. 164 | If you use the latter option, you must take reasonably prudent steps, 165 | when you begin distribution of Opaque copies in quantity, to ensure 166 | that this Transparent copy will remain thus accessible at the stated 167 | location until at least one year after the last time you distribute an 168 | Opaque copy (directly or through your agents or retailers) of that 169 | edition to the public. 170 | 171 | It is requested, but not required, that you contact the authors of the 172 | Document well before redistributing any large number of copies, to give 173 | them a chance to provide you with an updated version of the Document. 174 | 175 | 176 | 4. MODIFICATIONS 177 | 178 | You may copy and distribute a Modified Version of the Document under 179 | the conditions of sections 2 and 3 above, provided that you release 180 | the Modified Version under precisely this License, with the Modified 181 | Version filling the role of the Document, thus licensing distribution 182 | and modification of the Modified Version to whoever possesses a copy 183 | of it. In addition, you must do these things in the Modified Version: 184 | 185 | A. Use in the Title Page (and on the covers, if any) a title distinct 186 | from that of the Document, and from those of previous versions 187 | (which should, if there were any, be listed in the History section 188 | of the Document). You may use the same title as a previous version 189 | if the original publisher of that version gives permission. 190 | B. List on the Title Page, as authors, one or more persons or entities 191 | responsible for authorship of the modifications in the Modified 192 | Version, together with at least five of the principal authors of the 193 | Document (all of its principal authors, if it has fewer than five), 194 | unless they release you from this requirement. 195 | C. State on the Title page the name of the publisher of the 196 | Modified Version, as the publisher. 197 | D. Preserve all the copyright notices of the Document. 198 | E. Add an appropriate copyright notice for your modifications 199 | adjacent to the other copyright notices. 200 | F. Include, immediately after the copyright notices, a license notice 201 | giving the public permission to use the Modified Version under the 202 | terms of this License, in the form shown in the Addendum below. 203 | G. Preserve in that license notice the full lists of Invariant Sections 204 | and required Cover Texts given in the Document's license notice. 205 | H. Include an unaltered copy of this License. 206 | I. Preserve the section Entitled "History", Preserve its Title, and add 207 | to it an item stating at least the title, year, new authors, and 208 | publisher of the Modified Version as given on the Title Page. If 209 | there is no section Entitled "History" in the Document, create one 210 | stating the title, year, authors, and publisher of the Document as 211 | given on its Title Page, then add an item describing the Modified 212 | Version as stated in the previous sentence. 213 | J. Preserve the network location, if any, given in the Document for 214 | public access to a Transparent copy of the Document, and likewise 215 | the network locations given in the Document for previous versions 216 | it was based on. These may be placed in the "History" section. 217 | You may omit a network location for a work that was published at 218 | least four years before the Document itself, or if the original 219 | publisher of the version it refers to gives permission. 220 | K. For any section Entitled "Acknowledgements" or "Dedications", 221 | Preserve the Title of the section, and preserve in the section all 222 | the substance and tone of each of the contributor acknowledgements 223 | and/or dedications given therein. 224 | L. Preserve all the Invariant Sections of the Document, 225 | unaltered in their text and in their titles. Section numbers 226 | or the equivalent are not considered part of the section titles. 227 | M. Delete any section Entitled "Endorsements". Such a section 228 | may not be included in the Modified Version. 229 | N. Do not retitle any existing section to be Entitled "Endorsements" 230 | or to conflict in title with any Invariant Section. 231 | O. Preserve any Warranty Disclaimers. 232 | 233 | If the Modified Version includes new front-matter sections or 234 | appendices that qualify as Secondary Sections and contain no material 235 | copied from the Document, you may at your option designate some or all 236 | of these sections as invariant. To do this, add their titles to the 237 | list of Invariant Sections in the Modified Version's license notice. 238 | These titles must be distinct from any other section titles. 239 | 240 | You may add a section Entitled "Endorsements", provided it contains 241 | nothing but endorsements of your Modified Version by various 242 | parties--for example, statements of peer review or that the text has 243 | been approved by an organization as the authoritative definition of a 244 | standard. 245 | 246 | You may add a passage of up to five words as a Front-Cover Text, and a 247 | passage of up to 25 words as a Back-Cover Text, to the end of the list 248 | of Cover Texts in the Modified Version. Only one passage of 249 | Front-Cover Text and one of Back-Cover Text may be added by (or 250 | through arrangements made by) any one entity. If the Document already 251 | includes a cover text for the same cover, previously added by you or 252 | by arrangement made by the same entity you are acting on behalf of, 253 | you may not add another; but you may replace the old one, on explicit 254 | permission from the previous publisher that added the old one. 255 | 256 | The author(s) and publisher(s) of the Document do not by this License 257 | give permission to use their names for publicity for or to assert or 258 | imply endorsement of any Modified Version. 259 | 260 | 261 | 5. COMBINING DOCUMENTS 262 | 263 | You may combine the Document with other documents released under this 264 | License, under the terms defined in section 4 above for modified 265 | versions, provided that you include in the combination all of the 266 | Invariant Sections of all of the original documents, unmodified, and 267 | list them all as Invariant Sections of your combined work in its 268 | license notice, and that you preserve all their Warranty Disclaimers. 269 | 270 | The combined work need only contain one copy of this License, and 271 | multiple identical Invariant Sections may be replaced with a single 272 | copy. If there are multiple Invariant Sections with the same name but 273 | different contents, make the title of each such section unique by 274 | adding at the end of it, in parentheses, the name of the original 275 | author or publisher of that section if known, or else a unique number. 276 | Make the same adjustment to the section titles in the list of 277 | Invariant Sections in the license notice of the combined work. 278 | 279 | In the combination, you must combine any sections Entitled "History" 280 | in the various original documents, forming one section Entitled 281 | "History"; likewise combine any sections Entitled "Acknowledgements", 282 | and any sections Entitled "Dedications". You must delete all sections 283 | Entitled "Endorsements". 284 | 285 | 286 | 6. COLLECTIONS OF DOCUMENTS 287 | 288 | You may make a collection consisting of the Document and other documents 289 | released under this License, and replace the individual copies of this 290 | License in the various documents with a single copy that is included in 291 | the collection, provided that you follow the rules of this License for 292 | verbatim copying of each of the documents in all other respects. 293 | 294 | You may extract a single document from such a collection, and distribute 295 | it individually under this License, provided you insert a copy of this 296 | License into the extracted document, and follow this License in all 297 | other respects regarding verbatim copying of that document. 298 | 299 | 300 | 7. AGGREGATION WITH INDEPENDENT WORKS 301 | 302 | A compilation of the Document or its derivatives with other separate 303 | and independent documents or works, in or on a volume of a storage or 304 | distribution medium, is called an "aggregate" if the copyright 305 | resulting from the compilation is not used to limit the legal rights 306 | of the compilation's users beyond what the individual works permit. 307 | When the Document is included in an aggregate, this License does not 308 | apply to the other works in the aggregate which are not themselves 309 | derivative works of the Document. 310 | 311 | If the Cover Text requirement of section 3 is applicable to these 312 | copies of the Document, then if the Document is less than one half of 313 | the entire aggregate, the Document's Cover Texts may be placed on 314 | covers that bracket the Document within the aggregate, or the 315 | electronic equivalent of covers if the Document is in electronic form. 316 | Otherwise they must appear on printed covers that bracket the whole 317 | aggregate. 318 | 319 | 320 | 8. TRANSLATION 321 | 322 | Translation is considered a kind of modification, so you may 323 | distribute translations of the Document under the terms of section 4. 324 | Replacing Invariant Sections with translations requires special 325 | permission from their copyright holders, but you may include 326 | translations of some or all Invariant Sections in addition to the 327 | original versions of these Invariant Sections. You may include a 328 | translation of this License, and all the license notices in the 329 | Document, and any Warranty Disclaimers, provided that you also include 330 | the original English version of this License and the original versions 331 | of those notices and disclaimers. In case of a disagreement between 332 | the translation and the original version of this License or a notice 333 | or disclaimer, the original version will prevail. 334 | 335 | If a section in the Document is Entitled "Acknowledgements", 336 | "Dedications", or "History", the requirement (section 4) to Preserve 337 | its Title (section 1) will typically require changing the actual 338 | title. 339 | 340 | 341 | 9. TERMINATION 342 | 343 | You may not copy, modify, sublicense, or distribute the Document except 344 | as expressly provided for under this License. Any other attempt to 345 | copy, modify, sublicense or distribute the Document is void, and will 346 | automatically terminate your rights under this License. However, 347 | parties who have received copies, or rights, from you under this 348 | License will not have their licenses terminated so long as such 349 | parties remain in full compliance. 350 | 351 | 352 | 10. FUTURE REVISIONS OF THIS LICENSE 353 | 354 | The Free Software Foundation may publish new, revised versions 355 | of the GNU Free Documentation License from time to time. Such new 356 | versions will be similar in spirit to the present version, but may 357 | differ in detail to address new problems or concerns. See 358 | http://www.gnu.org/copyleft/. 359 | 360 | Each version of the License is given a distinguishing version number. 361 | If the Document specifies that a particular numbered version of this 362 | License "or any later version" applies to it, you have the option of 363 | following the terms and conditions either of that specified version or 364 | of any later version that has been published (not as a draft) by the 365 | Free Software Foundation. If the Document does not specify a version 366 | number of this License, you may choose any version ever published (not 367 | as a draft) by the Free Software Foundation. 368 | 369 | 370 | ADDENDUM: How to use this License for your documents 371 | 372 | To use this License in a document you have written, include a copy of 373 | the License in the document and put the following copyright and 374 | license notices just after the title page: 375 | 376 | Copyright (c) YEAR YOUR NAME. 377 | Permission is granted to copy, distribute and/or modify this document 378 | under the terms of the GNU Free Documentation License, Version 1.2 379 | or any later version published by the Free Software Foundation; 380 | with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. 381 | A copy of the license is included in the section entitled "GNU 382 | Free Documentation License". 383 | 384 | If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, 385 | replace the "with...Texts." line with this: 386 | 387 | with the Invariant Sections being LIST THEIR TITLES, with the 388 | Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. 389 | 390 | If you have Invariant Sections without Cover Texts, or some other 391 | combination of the three, merge those two alternatives to suit the 392 | situation. 393 | 394 | If your document contains nontrivial examples of program code, we 395 | recommend releasing these examples in parallel under your choice of 396 | free software license, such as the GNU General Public License, 397 | to permit their use in free software. 398 | -------------------------------------------------------------------------------- /templates/common-licenses/GPL-1: -------------------------------------------------------------------------------- 1 | 2 | GNU GENERAL PUBLIC LICENSE 3 | Version 1, February 1989 4 | 5 | Copyright (C) 1989 Free Software Foundation, Inc. 6 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 7 | 8 | Everyone is permitted to copy and distribute verbatim copies 9 | of this license document, but changing it is not allowed. 10 | 11 | Preamble 12 | 13 | The license agreements of most software companies try to keep users 14 | at the mercy of those companies. By contrast, our General Public 15 | License is intended to guarantee your freedom to share and change free 16 | software--to make sure the software is free for all its users. The 17 | General Public License applies to the Free Software Foundation's 18 | software and to any other program whose authors commit to using it. 19 | You can use it for your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Specifically, the General Public License is designed to make 23 | sure that you have the freedom to give away or sell copies of free 24 | software, that you receive source code or can get it if you want it, 25 | that you can change the software or use pieces of it in new free 26 | programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of a such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must tell them their rights. 37 | 38 | We protect your rights with two steps: (1) copyright the software, and 39 | (2) offer you this license which gives you legal permission to copy, 40 | distribute and/or modify the software. 41 | 42 | Also, for each author's protection and ours, we want to make certain 43 | that everyone understands that there is no warranty for this free 44 | software. If the software is modified by someone else and passed on, we 45 | want its recipients to know that what they have is not the original, so 46 | that any problems introduced by others will not reflect on the original 47 | authors' reputations. 48 | 49 | The precise terms and conditions for copying, distribution and 50 | modification follow. 51 | 52 | GNU GENERAL PUBLIC LICENSE 53 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 54 | 55 | 0. This License Agreement applies to any program or other work which 56 | contains a notice placed by the copyright holder saying it may be 57 | distributed under the terms of this General Public License. The 58 | "Program", below, refers to any such program or work, and a "work based 59 | on the Program" means either the Program or any work containing the 60 | Program or a portion of it, either verbatim or with modifications. Each 61 | licensee is addressed as "you". 62 | 63 | 1. You may copy and distribute verbatim copies of the Program's source 64 | code as you receive it, in any medium, provided that you conspicuously and 65 | appropriately publish on each copy an appropriate copyright notice and 66 | disclaimer of warranty; keep intact all the notices that refer to this 67 | General Public License and to the absence of any warranty; and give any 68 | other recipients of the Program a copy of this General Public License 69 | along with the Program. You may charge a fee for the physical act of 70 | transferring a copy. 71 | 72 | 2. You may modify your copy or copies of the Program or any portion of 73 | it, and copy and distribute such modifications under the terms of Paragraph 74 | 1 above, provided that you also do the following: 75 | 76 | a) cause the modified files to carry prominent notices stating that 77 | you changed the files and the date of any change; and 78 | 79 | b) cause the whole of any work that you distribute or publish, that 80 | in whole or in part contains the Program or any part thereof, either 81 | with or without modifications, to be licensed at no charge to all 82 | third parties under the terms of this General Public License (except 83 | that you may choose to grant warranty protection to some or all 84 | third parties, at your option). 85 | 86 | c) If the modified program normally reads commands interactively when 87 | run, you must cause it, when started running for such interactive use 88 | in the simplest and most usual way, to print or display an 89 | announcement including an appropriate copyright notice and a notice 90 | that there is no warranty (or else, saying that you provide a 91 | warranty) and that users may redistribute the program under these 92 | conditions, and telling the user how to view a copy of this General 93 | Public License. 94 | 95 | d) You may charge a fee for the physical act of transferring a 96 | copy, and you may at your option offer warranty protection in 97 | exchange for a fee. 98 | 99 | Mere aggregation of another independent work with the Program (or its 100 | derivative) on a volume of a storage or distribution medium does not bring 101 | the other work under the scope of these terms. 102 | 103 | 3. You may copy and distribute the Program (or a portion or derivative of 104 | it, under Paragraph 2) in object code or executable form under the terms of 105 | Paragraphs 1 and 2 above provided that you also do one of the following: 106 | 107 | a) accompany it with the complete corresponding machine-readable 108 | source code, which must be distributed under the terms of 109 | Paragraphs 1 and 2 above; or, 110 | 111 | b) accompany it with a written offer, valid for at least three 112 | years, to give any third party free (except for a nominal charge 113 | for the cost of distribution) a complete machine-readable copy of the 114 | corresponding source code, to be distributed under the terms of 115 | Paragraphs 1 and 2 above; or, 116 | 117 | c) accompany it with the information you received as to where the 118 | corresponding source code may be obtained. (This alternative is 119 | allowed only for noncommercial distribution and only if you 120 | received the program in object code or executable form alone.) 121 | 122 | Source code for a work means the preferred form of the work for making 123 | modifications to it. For an executable file, complete source code means 124 | all the source code for all modules it contains; but, as a special 125 | exception, it need not include source code for modules which are standard 126 | libraries that accompany the operating system on which the executable 127 | file runs, or for standard header files or definitions files that 128 | accompany that operating system. 129 | 130 | 4. You may not copy, modify, sublicense, distribute or transfer the 131 | Program except as expressly provided under this General Public License. 132 | Any attempt otherwise to copy, modify, sublicense, distribute or transfer 133 | the Program is void, and will automatically terminate your rights to use 134 | the Program under this License. However, parties who have received 135 | copies, or rights to use copies, from you under this General Public 136 | License will not have their licenses terminated so long as such parties 137 | remain in full compliance. 138 | 139 | 5. By copying, distributing or modifying the Program (or any work based 140 | on the Program) you indicate your acceptance of this license to do so, 141 | and all its terms and conditions. 142 | 143 | 6. Each time you redistribute the Program (or any work based on the 144 | Program), the recipient automatically receives a license from the original 145 | licensor to copy, distribute or modify the Program subject to these 146 | terms and conditions. You may not impose any further restrictions on the 147 | recipients' exercise of the rights granted herein. 148 | 149 | 7. The Free Software Foundation may publish revised and/or new versions 150 | of the General Public License from time to time. Such new versions will 151 | be similar in spirit to the present version, but may differ in detail to 152 | address new problems or concerns. 153 | 154 | Each version is given a distinguishing version number. If the Program 155 | specifies a version number of the license which applies to it and "any 156 | later version", you have the option of following the terms and conditions 157 | either of that version or of any later version published by the Free 158 | Software Foundation. If the Program does not specify a version number of 159 | the license, you may choose any version ever published by the Free Software 160 | Foundation. 161 | 162 | 8. If you wish to incorporate parts of the Program into other free 163 | programs whose distribution conditions are different, write to the author 164 | to ask for permission. For software which is copyrighted by the Free 165 | Software Foundation, write to the Free Software Foundation; we sometimes 166 | make exceptions for this. Our decision will be guided by the two goals 167 | of preserving the free status of all derivatives of our free software and 168 | of promoting the sharing and reuse of software generally. 169 | 170 | NO WARRANTY 171 | 172 | 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 173 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 174 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 175 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 176 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 177 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 178 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 179 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 180 | REPAIR OR CORRECTION. 181 | 182 | 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 183 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 184 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 185 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 186 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 187 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 188 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 189 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 190 | POSSIBILITY OF SUCH DAMAGES. 191 | 192 | END OF TERMS AND CONDITIONS 193 | 194 | Appendix: How to Apply These Terms to Your New Programs 195 | 196 | If you develop a new program, and you want it to be of the greatest 197 | possible use to humanity, the best way to achieve this is to make it 198 | free software which everyone can redistribute and change under these 199 | terms. 200 | 201 | To do so, attach the following notices to the program. It is safest to 202 | attach them to the start of each source file to most effectively convey 203 | the exclusion of warranty; and each file should have at least the 204 | "copyright" line and a pointer to where the full notice is found. 205 | 206 | 207 | Copyright (C) 19yy 208 | 209 | This program is free software; you can redistribute it and/or modify 210 | it under the terms of the GNU General Public License as published by 211 | the Free Software Foundation; either version 1, or (at your option) 212 | any later version. 213 | 214 | This program is distributed in the hope that it will be useful, 215 | but WITHOUT ANY WARRANTY; without even the implied warranty of 216 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 217 | GNU General Public License for more details. 218 | 219 | You should have received a copy of the GNU General Public License 220 | along with this program; if not, write to the Free Software 221 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA 222 | 223 | 224 | Also add information on how to contact you by electronic and paper mail. 225 | 226 | If the program is interactive, make it output a short notice like this 227 | when it starts in an interactive mode: 228 | 229 | Gnomovision version 69, Copyright (C) 19xx name of author 230 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 231 | This is free software, and you are welcome to redistribute it 232 | under certain conditions; type `show c' for details. 233 | 234 | The hypothetical commands `show w' and `show c' should show the 235 | appropriate parts of the General Public License. Of course, the 236 | commands you use may be called something other than `show w' and `show 237 | c'; they could even be mouse-clicks or menu items--whatever suits your 238 | program. 239 | 240 | You should also get your employer (if you work as a programmer) or your 241 | school, if any, to sign a "copyright disclaimer" for the program, if 242 | necessary. Here a sample; alter the names: 243 | 244 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 245 | program `Gnomovision' (a program to direct compilers to make passes 246 | at assemblers) written by James Hacker. 247 | 248 | , 1 April 1989 249 | Ty Coon, President of Vice 250 | 251 | That's all there is to it! 252 | -------------------------------------------------------------------------------- /templates/common-licenses/GPL-2: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /templates/common-licenses/LGPL: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /templates/common-licenses/LGPL-3: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /templates/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This is a script which runs programs in the Steam runtime 4 | 5 | set -e 6 | set -u 7 | set -o pipefail 8 | 9 | # The top level of the runtime tree 10 | STEAM_RUNTIME=$(cd "${0%/*}" && pwd) 11 | # Note that we put the Steam runtime first 12 | # If ldd on a program shows any library in the system path, then that program 13 | # may not run in the Steam runtime. 14 | export STEAM_RUNTIME 15 | 16 | log () { 17 | echo "run.sh[$$]: $*" >&2 || : 18 | } 19 | 20 | # Make sure we have something to run 21 | if [ "$1" = "" ]; then 22 | log "Usage: $0 program [args]" 23 | exit 1 24 | fi 25 | 26 | # Save the system paths, they might be useful later 27 | if [ -z "${SYSTEM_PATH-}" ]; then 28 | export SYSTEM_PATH="${PATH-}" 29 | fi 30 | if [ -z "${SYSTEM_LD_LIBRARY_PATH-}" ]; then 31 | export SYSTEM_LD_LIBRARY_PATH="${LD_LIBRARY_PATH-}" 32 | fi 33 | 34 | if [ -z "${SYSTEM_ZENITY-}" ]; then 35 | # Prefer host zenity binary if available 36 | SYSTEM_ZENITY="$(command -v zenity || true)" 37 | export SYSTEM_ZENITY 38 | if [ -z "${SYSTEM_ZENITY}" ]; then 39 | export STEAM_ZENITY="zenity" 40 | else 41 | export STEAM_ZENITY="${SYSTEM_ZENITY}" 42 | fi 43 | fi 44 | 45 | set_bin_path() 46 | { 47 | local arch 48 | local unique_steam_runtime_paths 49 | 50 | unique_steam_runtime_paths= 51 | 52 | case "$(uname -m)" in 53 | (*64) 54 | arch=amd64 55 | ;; 56 | (*) 57 | arch=i386 58 | ;; 59 | esac 60 | 61 | # Keep this in sync with setup.sh 62 | for rt_path in "$STEAM_RUNTIME/$arch/bin" "$STEAM_RUNTIME/$arch/usr/bin" "$STEAM_RUNTIME/usr/bin"; do 63 | case ":${PATH}:" in 64 | (*:${rt_path}:*) 65 | # rt_path is already in PATH, ignore 66 | ;; 67 | 68 | (*) 69 | # rt_path is not in PATH, save it and then prepend it to PATH 70 | unique_steam_runtime_paths="${unique_steam_runtime_paths}${rt_path}:" 71 | ;; 72 | esac 73 | done 74 | 75 | # Prepend the Steam Runtime's paths 76 | export PATH="${unique_steam_runtime_paths}${PATH}" 77 | } 78 | 79 | set_bin_path 80 | 81 | if [[ "${STEAM_RUNTIME_PREFER_HOST_LIBRARIES-}" == "0" ]]; then 82 | log "STEAM_RUNTIME_PREFER_HOST_LIBRARIES=0 is deprecated, and no longer has an effect." 83 | fi 84 | 85 | if host_library_paths="$(steam-runtime-identify-library-abi --ldconfig-paths --one-line --quiet)"; then 86 | # Code below assumes a trailing ":" 87 | host_library_paths="${host_library_paths}:" 88 | else 89 | log "steam-runtime-identify-library-abi --ldconfig-paths failed, falling back to ldconfig" 90 | host_library_paths= 91 | exit_status=0 92 | ldconfig_output=$(/sbin/ldconfig -XNv 2> /dev/null; exit $?) || exit_status=$? 93 | if [[ $exit_status != 0 ]]; then 94 | log "Warning: An unexpected error occurred while executing \"/sbin/ldconfig -XNv\", the exit status was $exit_status" 95 | fi 96 | 97 | while read -r line; do 98 | # If line starts with a leading / and contains :, it's a new path prefix 99 | if [[ "$line" =~ ^/.*: ]] 100 | then 101 | library_path_prefix=$(echo "$line" | cut -d: -f1) 102 | 103 | host_library_paths=$host_library_paths$library_path_prefix: 104 | fi 105 | done <<< "$ldconfig_output" 106 | fi 107 | 108 | host_library_paths="${LD_LIBRARY_PATH:+"${LD_LIBRARY_PATH}:"}$host_library_paths" 109 | 110 | host_library_paths="$STEAM_RUNTIME/pinned_libs_32:$STEAM_RUNTIME/pinned_libs_64:$host_library_paths" 111 | 112 | case "${DEBUGGER-}" in 113 | (valgrind* | callgrind* | helgrind* | drd* | memcheck*) 114 | if [ -z "${STEAM_RUNTIME_USE_LIBCURL_SHIM-}" ]; then 115 | export STEAM_RUNTIME_USE_LIBCURL_SHIM=1 116 | fi 117 | ;; 118 | esac 119 | 120 | case "${STEAM_RUNTIME_USE_LIBCURL_SHIM-}" in 121 | (1) 122 | host_library_paths="$STEAM_RUNTIME/libcurl_compat_32:$STEAM_RUNTIME/libcurl_compat_64:$host_library_paths" 123 | ;; 124 | (0 | '') 125 | ;; 126 | (*) 127 | log "Warning: \$STEAM_RUNTIME_USE_LIBCURL_SHIM should be 0, 1 or empty, not '$STEAM_RUNTIME_USE_LIBCURL_SHIM'" 128 | ;; 129 | esac 130 | 131 | # Always prefer host libraries over non-pinned Runtime libraries. 132 | # (In older versions this was conditional, but if we don't do this, 133 | # it usually breaks Mesa drivers' dependencies.) 134 | steam_runtime_library_paths="$host_library_paths$STEAM_RUNTIME/lib/i386-linux-gnu:$STEAM_RUNTIME/usr/lib/i386-linux-gnu:$STEAM_RUNTIME/lib/x86_64-linux-gnu:$STEAM_RUNTIME/usr/lib/x86_64-linux-gnu:$STEAM_RUNTIME/lib:$STEAM_RUNTIME/usr/lib" 135 | 136 | if [[ -n "${STEAM_COMPAT_INSTALL_PATH-}" && -n "${STEAM_COMPAT_FLAGS-}" ]]; then 137 | case ",$STEAM_COMPAT_FLAGS," in 138 | (*,search-cwd-first,*) 139 | steam_runtime_library_paths="${STEAM_COMPAT_INSTALL_PATH}:${steam_runtime_library_paths}" 140 | ;; 141 | (*,search-cwd,*) 142 | steam_runtime_library_paths="${steam_runtime_library_paths}:${STEAM_COMPAT_INSTALL_PATH}" 143 | ;; 144 | esac 145 | fi 146 | 147 | if [ "$1" = "--print-steam-runtime-library-paths" ]; then 148 | echo "$steam_runtime_library_paths" 149 | exit 0 150 | fi 151 | 152 | export LD_LIBRARY_PATH="$steam_runtime_library_paths" 153 | 154 | exec "$@" 155 | 156 | # vi: ts=4 sw=4 expandtab 157 | -------------------------------------------------------------------------------- /templates/scripts/README.txt: -------------------------------------------------------------------------------- 1 | 2 | check-program.sh 3 | ---------------- 4 | 5 | Usage: check-program.sh executable [executable...] 6 | 7 | This is a script to check to see if an executable or shared library has all 8 | of its runtime dependencies met by the Steam Linux Runtime. 9 | 10 | Note that the runtime does not provide an OpenGL implementation, so any 11 | warnings about OpenGL or 3D hardware libraries can be ignored. 12 | 13 | 14 | check-runtime-consistency.sh 15 | ---------------------------- 16 | 17 | Usage: check-runtime-consistency.sh 18 | 19 | This is a script to make sure that all of the libraries included in the 20 | runtime have their dependencies in the runtime. You can safely ignore 21 | any warnings about OpenGL or 3D hardware libraries. 22 | 23 | 24 | check-runtime-conflicts.sh 25 | -------------------------- 26 | 27 | Usage: check-runtime-conflicts.sh 28 | 29 | This is a script to look for multi-arch conflicts between packages included 30 | in the runtime. These warnings are not a problem, they're just a sanity check 31 | to see if the authors of the packages have completed the multi-arch process. 32 | 33 | -------------------------------------------------------------------------------- /templates/scripts/check-program.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script checks to make sure all library dependencies are in the runtime. 4 | 5 | # The top level of the runtime tree 6 | TOP=$(cd "${0%/*}/.." && echo ${PWD}) 7 | 8 | # Make sure we have something to run 9 | if [ "$1" = "" ]; then 10 | echo "Usage: $0 executable [executable...]" 11 | fi 12 | 13 | STATUS=0 14 | OUTPUT=`mktemp` 15 | for OBJECT in "$@"; do 16 | "${TOP}/run.sh" ldd "${OBJECT}" | fgrep -v "${TOP}" | fgrep "=>" | egrep '/|not found' >"${OUTPUT}" 17 | if [ -s "${OUTPUT}" ]; then 18 | echo "$1 depends on these libraries not in the runtime:" 19 | cat "${OUTPUT}" 20 | STATUS=1 21 | fi 22 | done 23 | rm -f "${OUTPUT}" 24 | 25 | exit ${STATUS} 26 | 27 | # vi: ts=4 sw=4 expandtab 28 | -------------------------------------------------------------------------------- /templates/scripts/check-runtime-conflicts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This script checks for file conflicts between runtime architectures 4 | # 5 | # If this script ever returns no output, it's safe to merge the architecture 6 | # directories into a single runtime. 7 | 8 | # The top level of the runtime tree 9 | TOP=$(cd "${0%/*}/.." && echo ${PWD}) 10 | cd "${TOP}" 11 | 12 | ARCHITECTURES="i386 amd64" 13 | OUTPUT="`mktemp`" 14 | 15 | echo "Checking for conflicts in $ARCHITECTURES" 16 | for arch in $ARCHITECTURES; do 17 | cd $arch 18 | for other in $ARCHITECTURES; do 19 | if [ "$arch" = "$other" ]; then 20 | continue 21 | fi 22 | 23 | find . -type f | while read file; do 24 | if [ -f "../$other/$file" ] && ! cmp "$file" "../$other/$file" >/dev/null; then 25 | echo "CONFLICT: $file" >>"$OUTPUT" 26 | fi 27 | done 28 | done 29 | cd .. 30 | done 31 | sort "$OUTPUT" | uniq 32 | rm -f "$OUTPUT" 33 | echo "Done!" 34 | -------------------------------------------------------------------------------- /templates/scripts/check-runtime-consistency.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Make sure the runtime has all necessary runtime dependencies 4 | 5 | # The top level of the runtime tree 6 | TOP=$(cd "${0%/*}/.." && echo ${PWD}) 7 | 8 | if [ "$1" ]; then 9 | CHECK_PATH="$1" 10 | else 11 | CHECK_PATH="${TOP}" 12 | fi 13 | 14 | STATUS=0 15 | find "${CHECK_PATH}" -type f | grep -v 'ld.*so' | \ 16 | while read file; do 17 | if ! (file "${file}" | fgrep " ELF " >/dev/null); then 18 | continue 19 | fi 20 | 21 | echo "Checking ${file}" 22 | if ! "${TOP}/scripts/check-program.sh" "${file}"; then 23 | STATUS=1 24 | fi 25 | done 26 | exit ${STATUS} 27 | 28 | # vi: ts=4 sw=4 expandtab 29 | -------------------------------------------------------------------------------- /templates/scripts/check-symlinks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script checks to make sure the runtime symlinks are correct 4 | 5 | # The top level of the runtime tree 6 | TOP=$(cd "${0%/*}/.." && echo ${PWD}) 7 | 8 | ARCHITECTURES="amd64 i386" 9 | 10 | STATUS=0 11 | for ARCH in ${ARCHITECTURES}; do 12 | find "${TOP}/${ARCH}" -type l | ( 13 | while read link; do 14 | target=$(readlink "${link}") 15 | case "${target}" in 16 | /*) 17 | echo "Absolute symlink: ${link} -> ${target}" 18 | NEED_FIX_SYMLINKS=true 19 | STATUS=1 20 | continue 21 | ;; 22 | esac 23 | if [ ! -e "${link}" ]; then 24 | echo "Missing link ${link} -> ${target}" 25 | STATUS=1 26 | fi 27 | done 28 | if [ "${NEED_FIX_SYMLINKS}" ]; then 29 | echo "You should run fix-symlinks.sh" 30 | fi 31 | ) 32 | done 33 | exit ${STATUS} 34 | 35 | # vi: ts=4 sw=4 expandtab 36 | -------------------------------------------------------------------------------- /templates/scripts/fix-debuglinks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script checks to make sure the runtime debug symlinks are correct 4 | 5 | # The top level of the runtime tree 6 | TOP=$(cd "${0%/*}/.." && echo ${PWD}) 7 | 8 | if [ "$1" ]; then 9 | ARCHITECTURES="$1" 10 | else 11 | ARCHITECTURES="amd64 i386" 12 | fi 13 | 14 | STATUS=0 15 | for ARCH in ${ARCHITECTURES}; do 16 | if [ ! -d "${TOP}/${ARCH}/usr/lib/debug" ]; then 17 | continue 18 | fi 19 | cd "${TOP}/${ARCH}/usr/lib/debug" 20 | find . -type f | while read file; do 21 | file="$(echo $file | sed 's,./,,')" 22 | buildid="$(readelf -n "${file}" | fgrep "Build ID" | awk '{print $3}')" 23 | link="$(echo "${buildid}" | sed "s,\(..\)\(.*\),.build-id/\1/\2.debug,")" 24 | mkdir -p "$(dirname "${link}")" 25 | ln -sf "../../${file}" "${link}" 26 | done 27 | done 28 | 29 | # vi: ts=4 sw=4 expandtab 30 | -------------------------------------------------------------------------------- /templates/scripts/fix-symlinks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script checks to make sure the runtime symlinks are correct 4 | 5 | # The top level of the runtime tree 6 | TOP=$(cd "${0%/*}/.." && echo ${PWD}) 7 | 8 | if [ "$1" ]; then 9 | ARCHITECTURES="$1" 10 | else 11 | ARCHITECTURES="amd64 i386" 12 | fi 13 | 14 | STATUS=0 15 | for ARCH in ${ARCHITECTURES}; do 16 | find "${TOP}/${ARCH}" -type l | while read link; do 17 | target=$(readlink "${link}") 18 | case "${target}" in 19 | /*) 20 | # Fix absolute symbolic links 21 | base=$(echo "${link}" | sed "s,${TOP}/${ARCH}/,,") 22 | count=$(echo "${base}" | awk -F/ '{print NF - 1}') 23 | i=0 24 | target=$(echo "${target}" | sed 's,/,,') 25 | while [ "$i" -lt "$count" ]; do 26 | target="../${target}" 27 | i=$(expr $i + 1) 28 | done 29 | #echo "Fixing $link -> $target" 30 | ln -sf "${target}" "${link}" 31 | ;; 32 | esac 33 | done 34 | done 35 | exit ${STATUS} 36 | 37 | # vi: ts=4 sw=4 expandtab 38 | -------------------------------------------------------------------------------- /templates/scripts/switch-runtime.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright © 2021 Collabora Ltd. 4 | # 5 | # SPDX-License-Identifier: MIT 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining 8 | # a copy of this software and associated documentation files (the 9 | # "Software"), to deal in the Software without restriction, including 10 | # without limitation the rights to use, copy, modify, merge, publish, 11 | # distribute, sublicense, and/or sell copies of the Software, and to 12 | # permit persons to whom the Software is furnished to do so, subject to 13 | # the following conditions: 14 | # 15 | # The above copyright notice and this permission notice shall be included 16 | # in all copies or substantial portions of the Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | 26 | set -e 27 | set -o pipefail 28 | set -u 29 | shopt -s nullglob 30 | 31 | me="$(readlink -f "$0")" 32 | here="${me%/*}" 33 | me="${me##*/}" 34 | 35 | log () { 36 | echo "${me}[$$]: $*" >&2 || : 37 | } 38 | 39 | undo_steamrt () { 40 | # Undo the Steam Runtime environment, but only if it's already in use. 41 | case "${STEAM_RUNTIME-}" in 42 | (/*) 43 | ;; 44 | (*) 45 | return 46 | ;; 47 | esac 48 | 49 | local default_path="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" 50 | unset LD_LIBRARY_PATH 51 | 52 | # Try not to fall back to the default_path if we don't have to 53 | case ":$PATH:" in 54 | (*:$STEAM_RUNTIME*) 55 | export PATH="$default_path" 56 | ;; 57 | esac 58 | 59 | case "$STEAM_ZENITY" in 60 | ($STEAM_RUNTIME/*) 61 | unset STEAM_ZENITY 62 | ;; 63 | esac 64 | 65 | unset STEAM_RUNTIME 66 | 67 | if [ -n "${SYSTEM_LD_LIBRARY_PATH+set}" ]; then 68 | export LD_LIBRARY_PATH="$SYSTEM_LD_LIBRARY_PATH" 69 | fi 70 | 71 | if [ -n "${SYSTEM_PATH+set}" ]; then 72 | export PATH="$SYSTEM_PATH" 73 | fi 74 | 75 | # Removing the Steam Runtime from the PATH might have eliminated our 76 | # ability to run zenity via PATH search, if the host system doesn't 77 | # have it 78 | if [ "${STEAM_ZENITY-}" = zenity ] && ! command -v zenity >/dev/null; then 79 | unset STEAM_ZENITY 80 | fi 81 | } 82 | 83 | # see sysexits.h 84 | EX_SOFTWARE () { 85 | exit 70 86 | } 87 | EX_USAGE () { 88 | exit 64 89 | } 90 | 91 | bootstrap () { 92 | local unpack_dir="$1" 93 | local steamrt="$2" 94 | 95 | case "$steamrt" in 96 | (.) 97 | log "--runtime with --unpack-dir must not start with a dot" 98 | EX_USAGE 99 | ;; 100 | 101 | ("") 102 | log "--runtime with --unpack-dir must be non-empty" 103 | EX_USAGE 104 | ;; 105 | 106 | (*/*) 107 | log "--runtime with --unpack-dir must be a single path component" 108 | EX_USAGE 109 | ;; 110 | esac 111 | 112 | # :? to make sure we error out if unpack_dir is somehow empty 113 | local tarball="${unpack_dir:?}/$steamrt.tar.xz" 114 | local reference="${unpack_dir:?}/$steamrt.tar.xz.checksum" 115 | local available="${unpack_dir:?}/$steamrt/checksum" 116 | local tmpdir="${unpack_dir:?}/$steamrt.new" 117 | 118 | if [ -e "$available" ] && cmp -s "$reference" "$available"; then 119 | # Runtime is unpacked and up to date, use it as-is 120 | "${unpack_dir:?}/$steamrt/setup.sh" >&2 121 | return 0 122 | fi 123 | 124 | # Compare strings instead of using md5sum -c, because older versions 125 | # of md5sum interpret a CRLF (DOS) line-ending as though the filename 126 | # to be checked was "steam-runtime.tar.xz\r" 127 | local expected actual 128 | expected="$(cat "$reference")" 129 | expected="${expected%% *}" 130 | actual="$(md5sum "$tarball")" 131 | actual="${actual%% *}" 132 | 133 | if [ "$expected" != "$actual" ]; then 134 | log "error: integrity check for $tarball failed" 135 | EX_SOFTWARE 136 | fi 137 | 138 | rm -fr "$tmpdir" 139 | mkdir "$tmpdir" 140 | # No progress bar here yet... we just assume the runtime is not too big 141 | tar -C "$tmpdir" -xf "$tarball" 142 | cp "$reference" "$tmpdir/$steamrt/checksum" 143 | rm -f "$available" 144 | rm -fr "${unpack_dir:?}/$steamrt" 145 | mv "${tmpdir:?}/$steamrt" "$unpack_dir" 146 | rmdir "$tmpdir" 147 | 148 | if ! cmp -s "$0" "${unpack_dir:?}/$steamrt/scripts/switch-runtime.sh"; then 149 | log "WARNING: $0 is out of sync. Update from $steamrt/scripts/switch-runtime.sh" 150 | fi 151 | 152 | "${unpack_dir:?}/$steamrt/setup.sh" --force >&2 153 | } 154 | 155 | usage () { 156 | local status="${1:-64}" # EX_USAGE by default 157 | 158 | if [ "${status}" -gt 0 ]; then 159 | exec >&2 160 | fi 161 | 162 | cat << EOF 163 | Usage: $me [OPTIONS...] [--] COMMAND [ARGUMENTS] 164 | 165 | Set up the LD_LIBRARY_PATH-based Steam Runtime and run COMMAND in it. 166 | 167 | Options: 168 | --runtime=RUNTIME Name or path of a runtime. 169 | If not an absolute path, taken to be 170 | relative to DIRECTORY if given, or 171 | relative to $me. 172 | [default: "steam-runtime"] 173 | --unpack-dir=DIRECTORY Unpack DIRECTORY/RUNTIME.tar.xz 174 | into DIRECTORY/RUNTIME if 175 | necessary, then use it. RUNTIME 176 | must be a single path component 177 | in this case. 178 | EOF 179 | exit "$status" 180 | } 181 | 182 | main () { 183 | local getopt_temp="help" 184 | local runtime=steam-runtime 185 | local unpack_dir= 186 | 187 | getopt_temp="$getopt_temp,runtime:" 188 | getopt_temp="$getopt_temp,unpack-dir:" 189 | getopt_temp="$(getopt -o '' --long "$getopt_temp" -n "$me" -- "$@")" 190 | eval "set -- $getopt_temp" 191 | unset getopt_temp 192 | 193 | while [ "$#" -gt 0 ] 194 | do 195 | case "$1" in 196 | (--help) 197 | usage 0 198 | ;; 199 | 200 | (--runtime) 201 | runtime="$2" 202 | shift 2 203 | ;; 204 | 205 | (--unpack-dir) 206 | if ! [ -d "$2" ]; then 207 | log "'$2' is not a directory" 208 | usage 209 | fi 210 | unpack_dir="$(readlink -f "$2")" 211 | shift 2 212 | ;; 213 | 214 | (--) 215 | shift 216 | break 217 | ;; 218 | 219 | (-*) 220 | log "unknown option: $1" 221 | usage 222 | ;; 223 | 224 | (*) 225 | break 226 | ;; 227 | esac 228 | done 229 | 230 | if [ "$#" -lt 1 ] 231 | then 232 | log "this script requires positional parameters" 233 | usage 234 | fi 235 | 236 | if [ -n "$unpack_dir" ]; then 237 | bootstrap "$unpack_dir" "$runtime" 238 | STEAM_RUNTIME="$unpack_dir/$runtime" 239 | else 240 | case "$runtime" in 241 | ("") 242 | exec "$@" 243 | # not reached 244 | ;; 245 | 246 | (/*) 247 | STEAM_RUNTIME="$runtime" 248 | ;; 249 | (*) 250 | STEAM_RUNTIME="$here/$runtime" 251 | ;; 252 | esac 253 | fi 254 | 255 | exec "$STEAM_RUNTIME/run.sh" "$@" 256 | } 257 | 258 | undo_steamrt 259 | main "$@" 260 | 261 | # vim:set sw=4 sts=4 et: 262 | -------------------------------------------------------------------------------- /tests/build-runtime.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (C) 2019 Collabora Ltd. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # (see COPYING) 6 | 7 | from __future__ import print_function 8 | 9 | import json 10 | import os 11 | import subprocess 12 | import sys 13 | import unittest 14 | 15 | try: 16 | import typing 17 | typing # silence pyflakes 18 | except ImportError: 19 | pass 20 | 21 | 22 | BUILD_RUNTIME = os.path.join( 23 | os.path.dirname(__file__), 24 | os.pardir, 25 | 'build-runtime.py', 26 | ) 27 | 28 | 29 | class TestBuildRuntime(unittest.TestCase): 30 | def setUp(self): 31 | # type: () -> None 32 | pass 33 | 34 | def test_default(self): 35 | j = subprocess.check_output([ 36 | BUILD_RUNTIME, 37 | '--archive=runtime/', 38 | '--dump-options', 39 | ]).decode('utf-8') 40 | o = json.loads(j) 41 | self.assertEqual(o['architectures'], ['amd64', 'i386']) 42 | self.assertEqual(o['packages_from'], []) 43 | self.assertEqual( 44 | sorted(o['metapackages']), 45 | sorted([ 46 | 'steamrt-libs', 47 | 'steamrt-ld-library-path', 48 | 'steamrt-legacy', 49 | ]), 50 | ) 51 | 52 | def test_architectures(self): 53 | j = subprocess.check_output([ 54 | BUILD_RUNTIME, 55 | '--archive=runtime/', 56 | '--dump-options', 57 | '--arch', 'mips', 58 | '--arch', 'mipsel', 59 | ]).decode('utf-8') 60 | o = json.loads(j) 61 | self.assertEqual(o['architectures'], ['mips', 'mipsel']) 62 | 63 | def test_packages_from(self): 64 | j = subprocess.check_output([ 65 | BUILD_RUNTIME, 66 | '--archive=runtime/', 67 | '--dump-options', 68 | '--packages-from', '/tmp/packages.txt', 69 | '--packages-from', 'foobar.txt', 70 | ]).decode('utf-8') 71 | o = json.loads(j) 72 | self.assertEqual( 73 | o['packages_from'], 74 | ['/tmp/packages.txt', 'foobar.txt'], 75 | ) 76 | 77 | def tearDown(self): 78 | # type: () -> None 79 | pass 80 | 81 | 82 | if __name__ == '__main__': 83 | sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'third-party')) 84 | from pycotap import TAPTestRunner 85 | unittest.main(verbosity=2, testRunner=TAPTestRunner) 86 | 87 | # vi: set sw=4 sts=4 et: 88 | -------------------------------------------------------------------------------- /tests/mypy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright © 2016-2018 Simon McVittie 3 | # Copyright © 2018 Collabora Ltd. 4 | # 5 | # SPDX-License-Identifier: MIT 6 | # (See build-runtime.py) 7 | 8 | set -e 9 | set -u 10 | 11 | export MYPYPATH="${PYTHONPATH:=$(pwd)}" 12 | 13 | i=0 14 | for script in \ 15 | build-runtime.py \ 16 | tests/*.py \ 17 | ; do 18 | i=$((i + 1)) 19 | if [ "${MYPY:="$(command -v mypy || echo false)"}" = false ]; then 20 | echo "ok $i - $script # SKIP mypy not found" 21 | elif "${MYPY}" \ 22 | --python-executable="${PYTHON:=python3}" \ 23 | --follow-imports=skip \ 24 | --ignore-missing-imports \ 25 | "$script"; then 26 | echo "ok $i - $script" 27 | else 28 | echo "not ok $i - $script # TODO mypy issues reported" 29 | fi 30 | done 31 | echo "1..$i" 32 | 33 | # vim:set sw=4 sts=4 et: 34 | -------------------------------------------------------------------------------- /tests/pycodestyle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright © 2016-2018 Simon McVittie 3 | # Copyright © 2018 Collabora Ltd. 4 | # 5 | # SPDX-License-Identifier: MIT 6 | # (See build-runtime.py) 7 | 8 | set -e 9 | set -u 10 | 11 | if [ "${PYCODESTYLE:=pycodestyle}" = false ] || \ 12 | [ -z "$(command -v "$PYCODESTYLE")" ]; then 13 | echo "1..0 # SKIP pycodestyle not found" 14 | exit 0 15 | fi 16 | 17 | echo "1..2" 18 | 19 | # E117: over-indented 20 | # W191: indentation contains tabs 21 | # E211: whitespace before ‘(‘ 22 | # E225: missing whitespace around operator 23 | # E231: missing whitespace after ‘,’, ‘;’, or ‘:’ 24 | # E501: line too long (82 > 79 characters) 25 | # W503: line break before binary operator 26 | if "${PYCODESTYLE}" \ 27 | --ignore=E117,W191,E211,E225,E231,E501,W503 \ 28 | build-runtime.py \ 29 | >&2; then 30 | echo "ok 1 - $PYCODESTYLE reported no issues" 31 | else 32 | echo "not ok 1 # TODO $PYCODESTYLE issues reported" 33 | fi 34 | 35 | if "${PYCODESTYLE}" \ 36 | tests/*.py \ 37 | >&2; then 38 | echo "ok 2 - $PYCODESTYLE reported no issues" 39 | else 40 | echo "not ok 2 # TODO $PYCODESTYLE issues reported" 41 | fi 42 | 43 | # vim:set sw=4 sts=4 et: 44 | -------------------------------------------------------------------------------- /tests/pyflakes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright © 2016-2018 Simon McVittie 3 | # Copyright © 2018 Collabora Ltd. 4 | # 5 | # SPDX-License-Identifier: MIT 6 | # (See build-runtime.py) 7 | 8 | set -e 9 | set -u 10 | 11 | if [ "${PYFLAKES:=pyflakes3}" = false ] || \ 12 | [ -z "$(command -v "$PYFLAKES")" ]; then 13 | echo "1..0 # SKIP pyflakes3 not found" 14 | elif "${PYFLAKES}" \ 15 | ./*.py \ 16 | tests/*.py \ 17 | >&2; then 18 | echo "1..1" 19 | echo "ok 1 - $PYFLAKES reported no issues" 20 | else 21 | echo "1..1" 22 | echo "not ok 1 # TODO $PYFLAKES issues reported" 23 | fi 24 | 25 | # vim:set sw=4 sts=4 et: 26 | -------------------------------------------------------------------------------- /tests/read-manifests.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (C) 2013 Valve Corporation 3 | # Copyright (C) 2018 Collabora Ltd. 4 | # 5 | # SPDX-License-Identifier: MIT 6 | # (see COPYING) 7 | 8 | from __future__ import print_function 9 | 10 | import sys 11 | from gzip import GzipFile 12 | 13 | from debian.deb822 import Packages, Sources 14 | from debian.debian_support import Version 15 | 16 | try: 17 | import typing 18 | typing # silence pyflakes 19 | except ImportError: 20 | pass 21 | 22 | 23 | class Source: 24 | def __init__( 25 | self, 26 | name, # type: str 27 | version, # type: Version 28 | stanza=None # type: typing.Optional[Sources] 29 | ): 30 | # type: (...) -> None 31 | self.name = name 32 | self.stanza = stanza 33 | self.version = version 34 | 35 | 36 | class Binary: 37 | def __init__( 38 | self, 39 | stanza, # type: Packages 40 | binary_version_marker=None # type: typing.Optional[str] 41 | ): # type: (...) -> None 42 | self.stanza = stanza 43 | self.name = stanza['package'] 44 | self.arch = stanza['architecture'] 45 | self.multiarch = stanza.get('multi-arch', 'no') 46 | self.version = Version(stanza['version']) 47 | source = stanza.get('source', self.name) 48 | 49 | if ' (' in source: 50 | self.source, tmp = source.split(' (', 1) 51 | source_version = tmp.rstrip(')') 52 | else: 53 | self.source = source 54 | source_version = str(self.version) 55 | 56 | self.built_source_version = Version(source_version) 57 | self.source_version = self.built_source_version 58 | 59 | if (binary_version_marker is not None 60 | and binary_version_marker in source_version): 61 | left, right = source_version.rsplit(binary_version_marker, 1) 62 | self.source_version = Version(left) 63 | 64 | def __str__(self): 65 | return '{}_{}_{}'.format(self.name, self.version, self.arch) 66 | 67 | def __repr__(self): 68 | return '<{} {}>'.format(self.__class__.__name__, self) 69 | 70 | 71 | class TapTest: 72 | def __init__(self): 73 | self.test_num = 0 74 | self.failed = False 75 | 76 | def ok(self, desc): 77 | self.test_num += 1 78 | print('ok %d - %s' % (self.test_num, desc)) 79 | 80 | def diag(self, text): 81 | print('# %s' % text) 82 | 83 | def not_ok(self, desc): 84 | self.test_num += 1 85 | print('not ok %d - %s' % (self.test_num, desc)) 86 | self.failed = True 87 | 88 | def done_testing(self): 89 | print('1..%d' % self.test_num) 90 | 91 | if self.failed: 92 | sys.exit(1) 93 | 94 | 95 | if __name__ == '__main__': 96 | import argparse 97 | 98 | parser = argparse.ArgumentParser() 99 | parser.add_argument( 100 | # Ignored for backwards compat 101 | '--packages-from', help=argparse.SUPPRESS, 102 | ) 103 | parser.add_argument( 104 | 'manifests', metavar='*.deb822.gz', nargs='*', 105 | help='Manifest files produced by build-runtime.py', 106 | ) 107 | args = parser.parse_args() 108 | 109 | # Don't fail if invoked without arguments 110 | if not args.manifests: 111 | print('1..0 # SKIP No manifest files provided') 112 | sys.exit(0) 113 | 114 | test = TapTest() 115 | 116 | last = None 117 | 118 | runtime_package_lists = set() 119 | source_lists = set() 120 | sdk_package_lists = set() 121 | 122 | for f in args.manifests: 123 | assert f.endswith('.deb822.gz') 124 | 125 | if '-sdk-chroot-' in f: 126 | sdk_package_lists.add(f) 127 | 128 | elif ( 129 | f.endswith('/sources.deb822.gz') 130 | or f.endswith('.sources.deb822.gz') 131 | ): 132 | source_lists.add(f) 133 | 134 | else: 135 | runtime_package_lists.add(f) 136 | 137 | sources = {} # type: typing.Dict[str, typing.Dict[str, Version]] 138 | 139 | for f in source_lists: 140 | with GzipFile(f, 'rb') as gzip_reader: 141 | for source_stanza in Sources.iter_paragraphs( 142 | sequence=gzip_reader, 143 | encoding='utf-8', 144 | ): 145 | source = Source( 146 | source_stanza['package'], 147 | Version(source_stanza['version']), 148 | stanza=source_stanza, 149 | ) 150 | sources.setdefault(source.name, {})[source.version] = source 151 | 152 | for f in runtime_package_lists: 153 | test.diag('Examining runtime %s...' % f) 154 | with GzipFile(f, 'rb') as gzip_reader: 155 | for binary_stanza in Packages.iter_paragraphs( 156 | sequence=gzip_reader, 157 | encoding='utf-8', 158 | ): 159 | binary = Binary(binary_stanza, binary_version_marker='+srt') 160 | 161 | if ( 162 | binary.source not in sources 163 | or binary.source_version not in sources[binary.source] 164 | ): 165 | test.not_ok( 166 | 'source package %s_%s for %s not found' 167 | % (binary.source, binary.source_version, binary.name) 168 | ) 169 | else: 170 | test.ok( 171 | '%s source package in Sources' % binary.name) 172 | 173 | test.done_testing() 174 | 175 | # vi: set sw=4 sts=4 et: 176 | -------------------------------------------------------------------------------- /tests/shellcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright © 2018-2019 Collabora Ltd 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # (See build-runtime.py) 6 | 7 | set -e 8 | set -u 9 | 10 | if ! command -v shellcheck >/dev/null 2>&1; then 11 | echo "1..0 # SKIP shellcheck not available" 12 | exit 0 13 | fi 14 | 15 | n=0 16 | for shell_script in \ 17 | tests/*.sh \ 18 | templates/*.sh \ 19 | templates/scripts/switch-runtime.sh \ 20 | ; do 21 | n=$((n + 1)) 22 | if shellcheck "$shell_script"; then 23 | echo "ok $n - $shell_script" 24 | else 25 | echo "not ok $n # TODO - $shell_script" 26 | fi 27 | done 28 | 29 | echo "1..$n" 30 | -------------------------------------------------------------------------------- /tests/third-party/pycotap.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding=utf-8 3 | 4 | # Copyright (c) 2015 Remko Tronçon (https://el-tramo.be) 5 | # Released under the MIT license 6 | # See COPYING for details 7 | 8 | 9 | import unittest 10 | import sys 11 | import base64 12 | if sys.hexversion >= 0x03000000: 13 | from io import StringIO 14 | else: 15 | from StringIO import StringIO 16 | 17 | # Log modes 18 | class LogMode(object) : 19 | LogToError, LogToDiagnostics, LogToYAML, LogToAttachment = range(4) 20 | 21 | 22 | class TAPTestResult(unittest.TestResult): 23 | def __init__(self, output_stream, error_stream, message_log, test_output_log): 24 | super(TAPTestResult, self).__init__(self, output_stream) 25 | self.output_stream = output_stream 26 | self.error_stream = error_stream 27 | self.orig_stdout = None 28 | self.orig_stderr = None 29 | self.message = None 30 | self.test_output = None 31 | self.message_log = message_log 32 | self.test_output_log = test_output_log 33 | self.output_stream.write("TAP version 13\n") 34 | self._set_streams() 35 | 36 | def printErrors(self): 37 | self.print_raw("1..%d\n" % self.testsRun) 38 | self._reset_streams() 39 | 40 | def _set_streams(self): 41 | self.orig_stdout = sys.stdout 42 | self.orig_stderr = sys.stderr 43 | if self.message_log == LogMode.LogToError: 44 | self.message = self.error_stream 45 | else: 46 | self.message = StringIO() 47 | if self.test_output_log == LogMode.LogToError: 48 | self.test_output = self.error_stream 49 | else: 50 | self.test_output = StringIO() 51 | 52 | if self.message_log == self.test_output_log: 53 | self.test_output = self.message 54 | sys.stdout = sys.stderr = self.test_output 55 | 56 | def _reset_streams(self): 57 | sys.stdout = self.orig_stdout 58 | sys.stderr = self.orig_stderr 59 | 60 | 61 | def print_raw(self, text): 62 | self.output_stream.write(text) 63 | self.output_stream.flush() 64 | 65 | def print_result(self, result, test, directive = None): 66 | self.output_stream.write("%s %d %s" % (result, self.testsRun, test.id())) 67 | if directive: 68 | self.output_stream.write(" # " + directive) 69 | self.output_stream.write("\n") 70 | self.output_stream.flush() 71 | 72 | def ok(self, test, directive = None): 73 | self.print_result("ok", test, directive) 74 | 75 | def not_ok(self, test): 76 | self.print_result("not ok", test) 77 | 78 | def startTest(self, test): 79 | super(TAPTestResult, self).startTest(test) 80 | 81 | def stopTest(self, test): 82 | super(TAPTestResult, self).stopTest(test) 83 | if self.message_log == self.test_output_log: 84 | logs = [(self.message_log, self.message, "output")] 85 | else: 86 | logs = [ 87 | (self.test_output_log, self.test_output, "test_output"), 88 | (self.message_log, self.message, "message") 89 | ] 90 | for log_mode, log, log_name in logs: 91 | if log_mode != LogMode.LogToError: 92 | output = log.getvalue() 93 | if len(output): 94 | if log_mode == LogMode.LogToYAML: 95 | self.print_raw(" ---\n") 96 | self.print_raw(" " + log_name + ": |\n") 97 | self.print_raw(" " + output.rstrip().replace("\n", "\n ") + "\n") 98 | self.print_raw(" ...\n") 99 | elif log_mode == LogMode.LogToAttachment: 100 | self.print_raw(" ---\n") 101 | self.print_raw(" " + log_name + ":\n") 102 | self.print_raw(" File-Name: " + log_name + ".txt\n") 103 | self.print_raw(" File-Type: text/plain\n") 104 | self.print_raw(" File-Content: " + base64.b64encode(output) + "\n") 105 | self.print_raw(" ...\n") 106 | else: 107 | self.print_raw("# " + output.rstrip().replace("\n", "\n# ") + "\n") 108 | log.truncate(0) 109 | 110 | def addSuccess(self, test): 111 | super(TAPTestResult, self).addSuccess(test) 112 | self.ok(test) 113 | 114 | def addError(self, test, err): 115 | super(TAPTestResult, self).addError(test, err) 116 | self.message.write(self.errors[-1][1] + "\n") 117 | self.not_ok(test) 118 | 119 | def addFailure(self, test, err): 120 | super(TAPTestResult, self).addFailure(test, err) 121 | self.message.write(self.failures[-1][1] + "\n") 122 | self.not_ok(test) 123 | 124 | def addSkip(self, test, reason): 125 | super(TAPTestResult, self).addSkip(test, reason) 126 | self.ok(test, "SKIP " + reason) 127 | 128 | def addExpectedFailure(self, test, err): 129 | super(TAPTestResult, self).addExpectedFailure(test, err) 130 | self.ok(test) 131 | 132 | def addUnexpectedSuccess(self, test): 133 | super(TAPTestResult, self).addUnexpectedSuccess(test) 134 | self.message.write("Unexpected success" + "\n") 135 | self.not_ok(test) 136 | 137 | 138 | class TAPTestRunner(object): 139 | def __init__(self, 140 | message_log = LogMode.LogToYAML, 141 | test_output_log = LogMode.LogToDiagnostics, 142 | output_stream = sys.stdout, error_stream = sys.stderr): 143 | self.output_stream = output_stream 144 | self.error_stream = error_stream 145 | self.message_log = message_log 146 | self.test_output_log = test_output_log 147 | 148 | def run(self, test): 149 | result = TAPTestResult( 150 | self.output_stream, 151 | self.error_stream, 152 | self.message_log, 153 | self.test_output_log) 154 | test(result) 155 | result.printErrors() 156 | 157 | return result 158 | -------------------------------------------------------------------------------- /ubuntu-archive-keyring.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ValveSoftware/steam-runtime/6e15b7cb7907ae4a8dc32678e1baf022fd392bc3/ubuntu-archive-keyring.gpg -------------------------------------------------------------------------------- /write-manifest: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright © 2016-2017 Simon McVittie 4 | # Copyright © 2017-2018 Collabora Ltd. 5 | # 6 | # SPDX-License-Identifier: MIT 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining 9 | # a copy of this software and associated documentation files (the 10 | # "Software"), to deal in the Software without restriction, including 11 | # without limitation the rights to use, copy, modify, merge, publish, 12 | # distribute, sublicense, and/or sell copies of the Software, and to 13 | # permit persons to whom the Software is furnished to do so, subject to 14 | # the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be included 17 | # in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | set -e 28 | set -u 29 | set -o pipefail 30 | 31 | me="$(basename "$0")" 32 | debug= 33 | 34 | usage () { 35 | local status="${1-2}" 36 | 37 | if [ "$status" -ne 0 ]; then 38 | exec >&2 39 | fi 40 | 41 | echo "$me: Usage" 42 | echo " $me SYSROOT" 43 | echo 44 | echo "Run this script as root." 45 | exit "$status" 46 | } 47 | 48 | getopt_temp="$(getopt -o '' --long \ 49 | 'help,debug' \ 50 | -n "$me" -- "$@")" 51 | 52 | eval set -- "$getopt_temp" 53 | unset getopt_temp 54 | 55 | while [ "$#" -gt 0 ]; do 56 | case "$1" in 57 | (--debug) 58 | debug=yes 59 | shift 60 | ;; 61 | 62 | (--help) 63 | usage 0 64 | # not reached 65 | ;; 66 | 67 | (--) 68 | shift 69 | break 70 | ;; 71 | 72 | (-*) 73 | echo "$me: unknown option: $1" >&2 74 | usage 2 75 | # not reached 76 | ;; 77 | 78 | (*) 79 | break 80 | ;; 81 | esac 82 | done 83 | 84 | if [ "x$(id -u)" != x0 ] || [ "$#" -ne 1 ]; then 85 | usage 2 86 | # not reached 87 | fi 88 | 89 | if [ -n "$debug" ]; then 90 | set -x 91 | fi 92 | 93 | sysroot="$1" 94 | cd "$sysroot" 95 | 96 | in_chroot () { 97 | chroot "$sysroot" "$@" 98 | } 99 | 100 | export DEBIAN_FRONTEND=noninteractive 101 | 102 | exec 3>"$sysroot/usr/manifest.dpkg" 103 | 104 | printf '#Package[:Architecture]\t#Version\t#Source\t#Installed-Size\n' >&3 105 | 106 | # ${} escapes here are for dpkg-query, not sh 107 | # shellcheck disable=SC2016 108 | dpkg_version="$(in_chroot dpkg-query -W -f '${Version}' dpkg)" 109 | 110 | if in_chroot dpkg --compare-versions "$dpkg_version" ge 1.16.2; then 111 | # shellcheck disable=SC2016 112 | in_chroot dpkg-query -W -f \ 113 | '${binary:Package}\t${Version}\t${Source}\t${Installed-Size}\n' \ 114 | | LC_ALL=C sort -u >&3 115 | # shellcheck disable=SC2016 116 | in_chroot dpkg-query -W -f '${binary:Package}\n' \ 117 | | LC_ALL=C sort -u \ 118 | | in_chroot xargs -d '\n' dpkg-query -s \ 119 | | gzip -9nc \ 120 | > "$sysroot/usr/manifest.deb822.gz" 121 | else 122 | # shellcheck disable=SC2016 123 | in_chroot dpkg-query -W -f \ 124 | '${Package}:${Architecture}\t${Version}\t${Source}\t${Installed-Size}\n' \ 125 | | LC_ALL=C sort -u >&3 126 | fi 127 | 128 | exec 3>"$sysroot/usr/manifest.dpkg.built-using" 129 | 130 | printf '#Built-Binary\t#Built-Using-Source\t#Built-Using-Version\n' >&3 131 | 132 | # shellcheck disable=SC2016 133 | in_chroot dpkg-query -W -f '${Package}\t${Built-Using}\n' | perl -ne ' 134 | chomp; 135 | die "Unable to parse dpkg-query output: $_\n" unless /^(\S+)\t(.*)$/; 136 | next unless $2; 137 | my $binary = $1; 138 | my @using = split /,/, $2; 139 | next unless @using; 140 | foreach my $using (@using) { 141 | $using =~ s/ //g; 142 | die "Unable to parse Built-Using: $using\n" 143 | unless $using =~ /^(\S+)\(=(\S+)\)$/; 144 | print "$binary\t$1\t$2\n"; 145 | } 146 | ' | LC_ALL=C sort -u >&3 147 | 148 | # vim:set sw=4 sts=4 et: 149 | --------------------------------------------------------------------------------