Common tasks
============

Adding a library to the SDK
---------------------------

Suppose you want to add `libfoo-dev` to the SDK.

Install `libfoo-dev` in a `scout` container/chroot, and check what other
packages it pulls in, and where they came from (`scout` or `precise`).
Check that those packages have acceptable licensing terms.

If any of the new packages came from `precise`, import those source
packages from precise into OBS so that we get our own replacement binary
packages built.

Check whether you can install `libfoo-dev:amd64` and `libfoo-dev:i386`
in a `scout` container/chroot without needing to remove anything else.

Edit `debian/control` and add `libfoo-dev` to an appropriate `Depends`
list. If you can co-install the amd64 and i386 versions of it, add it
to `steamrt-libdevel`. If not, add it to `steamrt-libdevel-non-multiarch`.

If you want to be able to ship games that use this library unconditionally,
you'll need to provide the library in the runtime (see below).

Adding a library to the Platform
--------------------------------

Suppose you want to add `libFoo.so.1` to the runtime.

Install `libfoo1` (or whatever is the right package name) in a `scout`
container/chroot, and check what other packages it pulls in, and where
they came from (`scout` or `precise`).  Check that those packages have
acceptable licensing terms.

If any of the new packages came from `precise`, import those source
packages from precise into OBS so that we get our own replacement binary
packages built.

Check whether you can install `libfoo1:amd64` and `libfoo1:i386`
in a `scout` container/chroot without needing to remove anything else.
If you can't, improve the packaging until you can (install to Multi-Arch
directories and set `Multi-Arch: same`). We don't support libraries that
are not multi-arch co-installable.

Edit `abi/steam-runtime-abi.yaml` and add the new library and each of its
(recursive) dependencies. If the name of the package matches the SONAME,
you can just add it to the list as a string, similar to `libX11.so.6`. If
not, you'll have to add it as a dict that contains a `deb:` key, similar
to `libz.so.1` containing `deb: zlib1g`.

In most cases, the library and all its recursive dependencies will need
to be added to the runtime's ABI. In the rare situation where we want
to take a dependency from the host system, like glibc and Mesa, you'll
also need to edit `build-runtime.py` in the `steam-runtime` git repo to
make that work.

After editing `abi/steam-runtime-abi.yaml`, regenerate
the `abi/expectations` directory by running `make
maintainer-update-expectations` in a `scout` chroot or container.

If you want to be able to compile against this library without downloading
extra packages, you'll need to provide the library in the SDK (see above).
