# Maintainer: Wilhelm Schuster _pkgname=moonraker pkgname="${_pkgname}-git" pkgver=r1952.27a0295 pkgrel=1 pkgdesc="HTTP frontend for Klipper 3D printer firmware" arch=(any) url="https://github.com/Arksine/moonraker" license=('GPL3') depends=(klipper python-tornado python-pillow python-pyserial-asyncio python-lmdb python-streaming-form-data python-distro python-inotify-simple python-libnacl python-paho-mqtt python-jinja python-dbus-next python-periphery curl) #checkdepends=("python-pytest>=7.0" python-pytest-asyncio python-pytest-timeout) makedepends=(git python-build python-installer python-wheel python-pdm) optdepends=("polkit: enable service and machine control through moonraker" "python-preprocess-cancellation: enables exclude object processing" "python-apprise: enable [notifier] module for sending notifications" "python-ldap3: [authorization] using LDAP" "python-msgspec: optional speedup" "python-uvloop: optional speedup" "python-zeroconf: enable zeroconf announcements" "wireless_tools: network detection") provides=("$_pkgname") conflicts=("$_pkgname") backup=('etc/klipper/moonraker.conf' 'var/opt/moonraker/systemd/moonraker.env') install=moonraker.install source=('git+https://github.com/Arksine/moonraker.git#branch=master' 'moonraker.install' 'moonraker.conf' 'moonraker.service' 'moonraker.env' 'moonraker.rules' 'sysusers.conf' 'tmpfiles.conf' 'moonraker-klipper.cfg') sha256sums=('SKIP' 'b118f346ec57228add79b9c37555adc5dbae4cb6de0e39659912376b5ad2e932' '16ac5116ff18e67b7334cf9baf4c404734aede0b1d56d5bed8bde90fbd926e8c' 'c9ab1efe9e225fddaaa20b82ff33d9b00c7e7fffe06d0a27502c17d5484131fc' '5611f1a48bb18d0d95a31eaead4f59d84c0ae5e3c407f3488770e2236b97c3bf' 'cef040e973a9bb697659d1506a37a5f829551d5cc96e3f81ff588d5bd67cf1d0' '549309fd129c8c665a5aed2d4229c20e5a9927f4fbdc937e0982db4785b9ee0d' '5106762365d6275a514897f5a6b42b2b08cbe941732670ac031d4f842679832b' 'b6c35114ab2886acbd9168bb4588c86d3baea91ab38eda67b5ef38327cd7b11f') pkgver() { cd "$srcdir/$_pkgname" printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } build() { cd "$srcdir/$_pkgname" # clean wheel before build to prevent subsequent package() runs from erroring # due to `dist/*.whl` expanding to multiple files (which `python -m install` # doesn't support) rm -f dist/*.whl python -m build --wheel --no-isolation } #check() { # cd "$srcdir/$_pkgname" # pytest #} package() { cd "$srcdir/$_pkgname" python -m installer --destdir="${pkgdir}" --prefix="/opt/$_pkgname" dist/*.whl rm -rf "$pkgdir/opt/$_pkgname/bin" # clean bin/moonraker as it doesn't work with /opt prefix install -Dm644 "$srcdir/moonraker.conf" "$pkgdir/etc/klipper/moonraker.conf" install -Dm644 "$srcdir/moonraker.service" "$pkgdir/usr/lib/systemd/system/moonraker.service" install -Dm644 "$srcdir/moonraker.env" "$pkgdir/var/opt/moonraker/systemd/moonraker.env" install -Dm644 "$srcdir/sysusers.conf" "$pkgdir/usr/lib/sysusers.d/moonraker.conf" install -Dm644 "$srcdir/tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/moonraker.conf" install -Dm644 "$srcdir/moonraker-klipper.cfg" "$pkgdir/usr/share/doc/moonraker/moonraker-klipper.cfg" # match directory owner/group and mode from [extra]/polkit install -d -o root -g 102 -m 0750 "$pkgdir"/usr/share/polkit-1/rules.d install -Dm644 "$srcdir/moonraker.rules" "$pkgdir/usr/share/polkit-1/rules.d/moonraker.rules" }