# Description: Meta package to run steam-native
# URL: https://steampowered.com
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: brotli-32 cups-32 ibus libcaca-32 libcanberra-32 libidn133-32 libjpeg6-turbo-32 libnewt-32 libnl-32 libnm-32 libpng12-32 libsdl2-32 libtiff4-32 libudev0-shim-32 libva-32 openssl11-32 pipewire-32 rtmpdump-32 steam vulkan-loader-32 vulkan-validation-layers-32 xorg-libxscrnsaver-32
# Optional: apulse-32 libappindicator-sharp-32 pulseaudio-32

name=steam-native-runtime
version=1.0.0.75
release=2
source=(steam-native.sh)

build() {
  cp /usr/share/applications/steam.desktop steam-native.desktop
  sed '/^Icon=.*/i StartupWMClass=Steam' -i steam-native.desktop
  sed -r 's|(Name=Steam) \(Runtime\)|\1 (Native)|' -i steam-native.desktop
  sed -r 's|(/usr/bin/steam)-runtime|\1-native|' -i steam-native.desktop

  install -Dm 644 steam-native.desktop -t $PKG/usr/share/applications
  install -Dm 755 steam-native.sh $PKG/usr/bin/steam-native

  install -d $PKG/usr/lib/steam
  ln -s /usr/lib/libcurl.so.3 $PKG/usr/lib/steam/libcurl.so.3
  ln -s /usr/lib/libcurl.so.4.8.0 $PKG/usr/lib/steam/libcurl.so.4
  ln -s /usr/lib/libcurl.so.4.8.0 $PKG/usr/lib/steam/libcurl.so.4.8.0

  install -d $PKG/usr/lib32/steam
  ln -s /usr/lib32/libcurl.so.3 $PKG/usr/lib32/steam/libcurl.so.3
  ln -s /usr/lib32/libcurl.so.4.8.0 $PKG/usr/lib32/steam/libcurl.so.4
  ln -s /usr/lib32/libcurl.so.4.8.0 $PKG/usr/lib32/steam/libcurl.so.4.8.0
}
