#Packager: Didier Spaier <didier~at~slint~dot~fr>

pkgname=orca
pkgver=49.5
pkgrel=1slint

source=("$pkgname-$pkgver.tar.xz")
docs=("AUTHORS" "COPYING" "MAINTAINERS" "NEWS" "README" "orca-$pkgver.alpha.news")
url=http://live.gnome.org/Orca/
options=('nosrcpack')
slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"orca (screen reader)"
"Orca is a free, open source, flexible, and extensible screen reader."
"The xdesktop version is to be used in enviromments other than Gnome3."
""
"Homepage: http://live.gnome.org/Orca/"
)

build() {
	#git clone https://github.com/GNOME/orca.git
	#cd orca
	#git checkout 029cf5a
	cd ${pkgname}-${pkgver} || exit
	CFLAGS="$SLKCFLAGS" \
	CXXFLAGS="$SLKCFLAGS" \
	PYTHON=/usr/bin/python3.11 \
	meson setup --errorlogs \
		--buildtype=release \
		--infodir=/usr/info \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--mandir=/usr/man \
		--prefix=/usr \
		--sysconfdir=/etc \
		_build
	meson compile -C _build
	meson install -C _build --destdir=$PKG
	# No autostart but orca will be started:
	# - at system level by gdm or lightdm if wished
	# - by the user in graphical environments if ~/autostart/startorca.desktop
	#   shipped in the slint-user-settings package has not Hidden=true
	# The a11y parameters are copied from orcaprofile in ~/.profile
	# by usersettings during installation if sound was used, or by the
	# script orca-on shipped in the slint-misc package.
	rm -rf $startdir/pkg/etc/xdg
	mkdir -p $startdir/pkg/usr/share/orca
	chmod -R 755 $startdir/pkg/usr/share
	cp $startdir/orcaprofile $startdir/pkg/usr/share/orca/
	chmod -R 644 $startdir/pkg/usr/share/orca/orcaprofile
	(
	cd $startdir/pkg/usr/bin  || exit
	sed "s;#!/usr/bin/python3;#!/usr/bin/python3.11;" orca > bof
	mv bof orca
	chmod 755 $startdir/pkg/usr/bin/orca
	)
}
