summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 165ee95f8cc266a8fe5f9c590687e3d469f72685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Maintainer: Valentin Batz <valentin.batz+archlinux@posteo.de>

pkgname=mdns-browser
pkgver=1.0.7
pkgrel=1
pkgdesc="A cross platform mDNS browsing app written in Rust using tauri and leptos"
arch=('x86_64')
url="https://github.com/hrzlgnm/mdns-browser"
license=('MIT')
depends=('cairo' 'desktop-file-utils' 'gdk-pixbuf2' 'glib2' 'gtk3' 'hicolor-icon-theme' 'libsoup' 'pango' 'webkit2gtk-4.1' 'openssl')
conflicts=('mdns-browser-bin')
makedepends=('cargo' 'cargo-auditable' 'git' 'file' 'appmenu-gtk-module' 'libappindicator-gtk3' 'librsvg' 'base-devel' 'curl' 'wget' 'rust' 'rust-wasm' 'trunk')
options=('!strip' '!emptydirs')
source=("$pkgname-v$pkgver.tar.gz::https://github.com/hrzlgnm/$pkgname/archive/refs/tags/$pkgname-v$pkgver.tar.gz")
sha256sums=('6e250c1aa8089374d618241c768d61efe3993febfd3c3948389ff41d016866e0')
_builddir="$pkgname-$pkgname-v$pkgver"
prepare() {
    cd "$srcdir/$_builddir" || exit 1
    cargo --locked install tauri-cli@2.9.5
    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
    cargo fetch --locked --target wasm32-unknown-unknown
}
build() {
    cd "$srcdir/$_builddir" || exit 1
    # unfortunately LTOFLAGS -flto=auto set by /etc/makepkg.conf break linking as those are added to CFLAGS automatically
    # building will bail out with something like: undefined reference to 'ring_core_0_17_8_OPENSSL_ia32cap_P' when -flto=auto is set
    export CFLAGS="${CFLAGS//-flto=auto//}"
    # build the normal binary without bundling first
    cargo --locked --frozen auditable tauri build --no-bundle
    cargo --locked --frozen auditable tauri build -b deb --no-sign
}
check() {
    cd "$srcdir/$_builddir" || exit 1
    cargo test --locked --frozen --package=models --package=mdns-browser
}
package() {
    install -Dm755 "${srcdir}/${_builddir}/target/release/mdns-browser" "$pkgdir"/usr/bin/mdns-browser
    # Explicitly strip only the binary; !strip in options prevents makepkg's auto-strip phase which also generates 
    # a debug package, which is useless here, as the debug information only contains symbols and no debug info
    strip "$pkgdir"/usr/bin/mdns-browser
    # use the intermediate artifacts generated by the bundler for creating the .deb
    cd "${srcdir}/${_builddir}/target/release/bundle/deb/${pkgname}_${pkgver}_amd64/data" || exit 1
    install -Dm644 usr/share/applications/mdns-browser.desktop "$pkgdir"/usr/share/applications/mdns-browser.desktop
    install -Dm644 usr/share/icons/hicolor/128x128/apps/mdns-browser.png "$pkgdir"/usr/share/icons/hicolor/128x128/apps/mdns-browser.png
    install -Dm644 usr/share/icons/hicolor/256x256@2/apps/mdns-browser.png "$pkgdir"/usr/share/icons/hicolor/256x256@2/apps/mdns-browser.png
    install -Dm644 usr/share/icons/hicolor/32x32/apps/mdns-browser.png "$pkgdir"/usr/share/icons/hicolor/32x32/apps/mdns-browser.png
    install -Dm644 usr/share/licenses/mdns-browser/LICENSE "$pkgdir"/usr/share/licenses/mdns-browser/LICENSE
}