File PKGBUILD of Package miraclecast

# buildsys: automake, meson  KEEP on separate line!
buildsys='meson'



gitdate=20250630
gitrev=54c73b5
gitcomm=54c73b506bb3243bc2ff2ec7cda46d9074a3e70d
gitrel=git${gitdate}.${gitrev}



pkgname=miraclecast
pkgver=${gitdate}
pkgrel=0
pkgdesc='Wifi-Display / Miracast Implementation'
license=('LGPL-2.1-or-later AND GPL-2.0-only')
url='https://github.com/albfan/miraclecast'
arch=('i686' 'x86_64' 'armv6h' 'armv7h')

source=(
	"${gitcomm}.tar.gz"
)

sha256sums=(
	'SKIP'
)

# BUG readline<8.3
# https://github.com/albfan/miraclecast/issues/540
depends=(
	glib2
	gstreamer
	iproute2
	'readline<8.3'
	'systemd>=221'
)
makedepends=(
	automake
	gcc
	libtool
	meson
)
# optdepends=()
# options=()

backup=(
	etc/dbus-1/system.d/org.freedesktop.miracle.conf
)



prepare() {
	cd "${pkgname}-${gitcomm}"

	if   [[ 'meson' != "${buildsys}" ]]
	then
		autoreconf -fiv

		# Do not install miracle-omxplayer, it's deprecated
		# See https://github.com/popcornmix/omxplayer
		sed -i -e 's/miracle-omxplayer//' res/Makefile.am
	fi
}



build() {
	cd "${pkgname}-${gitcomm}"

	if   [[ 'meson' == "${buildsys}" ]]
	then
		meson setup \
			--buildtype debugoptimized \
			-Dip-binary=/usr/bin/ip \
			"builddir" && cd "builddir"
		meson compile
	else
		export IP_BINARY=/usr/bin/ip
		./configure
		make
	fi
}



check() {
	cd "${pkgname}-${gitcomm}"

	if   [[ 'meson' != "${buildsys}" ]]
	then
		make --keep-going check
	fi
}



package() {
	cd "${pkgname}-${gitcomm}"

	if   [[ 'meson' == "${buildsys}" ]]
	then
		cd "builddir"
		DESTDIR="${pkgdir}/" meson install
		cd ..
	else
		make DESTDIR="${pkgdir}/" install
	fi
}
openSUSE Build Service is sponsored by