diff --git a/srcpkgs/umu-launcher/template b/srcpkgs/umu-launcher/template new file mode 100644 index 00000000000000..6cdc96ce56138c --- /dev/null +++ b/srcpkgs/umu-launcher/template @@ -0,0 +1,41 @@ +# Template file for 'umu-launcher' +pkgname=umu-launcher +version=1.4.4 +revision=1 +archs="x86_64 i686 aarch64" +hostmakedepends="cargo git hatchling python3-build python3-installer python3-pip python3-wheel scdoc" +makedepends="python3-pyzstd python3-urllib3 rust-std" +depends="bash curl desktop-file-utils hicolor-icon-theme diffutils python3 python3-pyzstd python3-urllib3 python3-xlib" +short_desc="Unified launcher for Windows games on Linux" +maintainer="Naiko " +license="GPL-3.0-only" +homepage="https://github.com/Open-Wine-Components/umu-launcher" +distfiles="https://github.com/Open-Wine-Components/umu-launcher/archive/${version}.tar.gz" +checksum=19767e226b0b937b1dcdcd00282eb31d1a7bb42ee01d54f6dae78e44ab8e3284 + +do_configure() { + ./configure.sh --prefix=/usr --use-system-pyzstd --use-system-urllib +} + +do_build() { + if [ "$CROSS_BUILD" ]; then + export CARGO_BUILD_TARGET="${RUST_TARGET}" + local target_env=$(echo "${RUST_TARGET}" | tr '[:lower:]-' '[:upper:]_') + export "CARGO_TARGET_${target_env}_LINKER"="${XBPS_CROSS_TRIPLET}-gcc" + + export PYO3_CROSS="1" + export PYO3_CROSS_PYTHON_VERSION="$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')" + export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib" + fi + make +} + +post_build() { + if [ "$CROSS_BUILD" ]; then + mv -f "builddir/${RUST_TARGET}/release/libumu_delta.so" builddir/release/ + fi +} + +do_install() { + make DESTDIR=${DESTDIR} install +}