# Maintainer: Peter Jung <ptr1337@archlinux.org>
# Contributor: loathingkernel <loathingkernel _a_ gmail _d_ com>

pkgname=umu-launcher
pkgver=1.4.4
pkgrel=1
pkgdesc="This is the Unified Launcher for Windows Games on Linux, to run Proton with fixes outside of Steam"
arch=('x86_64')
url="https://github.com/Open-Wine-Components/umu-launcher"
license=('GPL-3.0-only')
depends=(
  bash
  desktop-file-utils
  diffutils
  hicolor-icon-theme
  curl
  dbus
  freetype2
  gdk-pixbuf2
  ttf-font
  zenity
  lsb-release
  nss
  usbutils
  xorg-xrandr
  vulkan-driver
  vulkan-icd-loader
  lsof
  python
  xdg-user-dirs
  glibc
  libxcrypt
  libxcrypt-compat
  gcc-libs
  python-xlib
  python-xxhash
  python-pyzstd
  python-cbor2
  python-urllib3
)
depends_x86_64=(
  lib32-glibc
  lib32-libxcrypt
  lib32-libxcrypt-compat
  lib32-libgl
  lib32-gcc-libs
  lib32-libx11
  lib32-libxss
  lib32-alsa-plugins
  lib32-libgpg-error
  lib32-nss
  lib32-vulkan-driver
  lib32-vulkan-icd-loader
)
makedepends=(
  cargo
  git
  scdoc
  python-build
  python-installer
  python-hatchling
  python-maturin
  python-pip
)
optdepends=(
  'python-truststore: Verify certificates using OS trust stores'
)
_commit=1031d247969a5e8417df378cf175faf6906aec2d
source=(
    "git+https://github.com/Open-Wine-Components/umu-launcher.git#commit=$_commit"
)
sha256sums=('68af736383c430c8168ee0894ae6beccad43d879f4c6dcb39879c074e2c83ae3')


prepare() {
  cd "$srcdir"/umu-launcher
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_HOME="${srcdir}"/umu-cargo
  cargo update
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  cd "$srcdir"/umu-launcher
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_HOME="${srcdir}"/umu-cargo
  ./configure.sh --prefix=/usr --use-system-pyzstd --use-system-urllib
  make
}

package() {
  cd "$srcdir"/umu-launcher
  make DESTDIR="$pkgdir" install
}

