Skip to content
Snippets Groups Projects
heavy.yaml 5.88 KiB
Newer Older
Simon McVittie's avatar
Simon McVittie committed
---
# Copyright © 2013-2016 Valve Corporation
# Copyright © 2017-2019 Collabora Ltd.
Simon McVittie's avatar
Simon McVittie committed
# SPDX-License-Identifier: MIT
Simon McVittie's avatar
Simon McVittie committed
#
# 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:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

id_prefix: com.valvesoftware.SteamRuntime

add_packages:
  - steamrt-container
  - steamrt-libs
Simon McVittie's avatar
Simon McVittie committed

post_script: |
  for bin in xdg-email xdg-open; do
    if [ -e "/usr/libexec/flatpak-xdg-utils/$bin" ] && ! [ -e "/usr/bin/$bin" ]; then
      ln -fnsv "/usr/libexec/flatpak-xdg-utils/$bin" "/usr/bin/$bin"
    fi
  done

  if [ -e /usr/share/i18n/locales/en_US ]; then
    echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
    localedef -v -i en_US -c -f UTF-8 en_US.UTF-8 || :
    test -e /usr/lib/locale/locale-archive
  fi
  # Convert hard link to symlink, saving around 4M
  for python in python3.4 python3.5; do
    if cmp "/usr/bin/${python}m" "/usr/bin/${python}" \
      && ! [ -L "/usr/bin/${python}m" ] \
      && ! [ -L "/usr/bin/${python}" ] \
    ; then
      ln -fnsv "${python}" "/usr/bin/${python}m"
    fi
  done

  test -d /usr/lib/gconv
  test -d /usr/lib/locale
  test -d /usr/share/i18n
  test -d /usr/share/libdrm
  if dpkg-query -W steamrt-container-host-compat:amd64; then
    test -d /usr/lib64
    test -d /usr/lib64/gconv
    test -d /usr/lib64/locale
    test -d /usr/lib/x86_64-linux-gnu/gconv
    # Arch Linux uses a non-standard ELF interpreter for some binaries in
    # the glibc package. We can't create this from
    # steamrt-container-host-compat, because that breaks dpkg-shlibdeps.
    ln -fns /lib64/ld-linux-x86-64.so.2 /usr/lib/ld-linux-x86-64.so.2
    if ! [ -e /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 ] \
      && ! [ -L /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 ] \
    ; then
      install -d /usr/lib/x86_64-linux-gnu
      ln -s /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 \
        /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
    fi
    test -e /usr/x86_64-pc-linux-gnu/lib/ld-linux-x86-64.so.2
  fi
  if dpkg-query -W steamrt-container-host-compat:i386; then
    test -d /usr/lib32
    test -d /usr/lib32/gconv
    test -d /usr/lib32/locale
    test -d /usr/lib/i386-linux-gnu/gconv
    if ! [ -e /usr/lib/i386-linux-gnu/ld-linux.so.2 ] \
      && ! [ -L /usr/lib/i386-linux-gnu/ld-linux.so.2 ] \
    ; then
      install -d /usr/lib/i386-linux-gnu
      ln -s /lib/i386-linux-gnu/ld-linux.so.2 \
        /usr/lib/i386-linux-gnu/ld-linux.so.2
    fi
    test -e /usr/i686-pc-linux-gnu/lib/ld-linux.so.2
  # https://github.com/ValveSoftware/steam-runtime/issues/302
  # https://github.com/ValveSoftware/steam-for-linux/issues/6310
  for prefix in /usr /usr/local; do
    install -d "${prefix}/share/steam"
    ln -fns "/run/host${prefix}/share/steam/compatibilitytools.d" \
                     "${prefix}/share/steam/compatibilitytools.d"
  done
  add_packages_multiarch:
    - steamrt-container-host-compat
    - steamrt-libdevel

Simon McVittie's avatar
Simon McVittie committed
  add_packages:
    - steamrt-dev
    - steamrt-libdebug:
        debug_symbols: true
    - steamrt-libdebug-non-multiarch:
        debug_symbols: true
    - steamrt-libdevel-non-multiarch
  post_script: |

    for bin in \
      dos2unix \
      ifconfig \
      ip \
      nc \
      ping \
      ping6 \
      route \
      telnet \
      traceroute \
      traceroute6 \
      unix2dos \
      vi \
    ; do
      if [ -e /bin/busybox ] && ! [ -e "/bin/$bin" ] && ! [ -e "/usr/bin/$bin" ]; then
        ln -fnsv busybox "/bin/$bin"
      fi
    done

    for bin in \
      clang \
      clang++ \
    ; do
      ln -fnsv "/usr/lib/llvm-4.0/bin/$bin" /usr/bin
    done
    for bin in \
      asan_symbolize \
    ; do
      ln -fnsv "${bin}-4.0" "/usr/bin/${bin}"
    done
    arch="$(dpkg --print-architecture)"
    update-alternatives --set java "/usr/lib/jvm/java-8-openjdk-$arch/jre/bin/java"
    update-alternatives --set jexec "/usr/lib/jvm/java-8-openjdk-$arch/jre/lib/jexec"
    update-alternatives --set jjs "/usr/lib/jvm/java-8-openjdk-$arch/jre/bin/jjs"
    update-alternatives --set keytool "/usr/lib/jvm/java-8-openjdk-$arch/jre/bin/keytool"
    update-alternatives --set orbd "/usr/lib/jvm/java-8-openjdk-$arch/jre/bin/orbd"
    update-alternatives --set pack200 "/usr/lib/jvm/java-8-openjdk-$arch/jre/bin/pack200"
    update-alternatives --set policytool "/usr/lib/jvm/java-8-openjdk-$arch/jre/bin/policytool"
    update-alternatives --set rmid "/usr/lib/jvm/java-8-openjdk-$arch/jre/bin/rmid"
    update-alternatives --set rmiregistry "/usr/lib/jvm/java-8-openjdk-$arch/jre/bin/rmiregistry"
    update-alternatives --set servertool "/usr/lib/jvm/java-8-openjdk-$arch/jre/bin/servertool"
    update-alternatives --set tnameserv "/usr/lib/jvm/java-8-openjdk-$arch/jre/bin/tnameserv"
    update-alternatives --set unpack200 "/usr/lib/jvm/java-8-openjdk-$arch/jre/bin/unpack200"
    if [ -e /usr/lib/dbus-1.0/dbus-daemon-launch-helper ]; then
      chmod --changes 0644 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
      chown --changes root:root /usr/lib/dbus-1.0/dbus-daemon-launch-helper
    fi
Simon McVittie's avatar
Simon McVittie committed
...