### this file is sourced not run
PKGVER=1.52.3 # anything newer requires gcr-4
PKGBUILD=1
PKGARCH=x86_64

# source: BLFS 12.1 (last version that supports gcr-3)
TARBALL=gvfs-$PKGVER.tar.xz
MD5SUM=f00859e6e910c0cbc5395a3e216f1fe3
SRC_URL=https://download.gnome.org/sources/gvfs/1.52/$TARBALL
BUNDLE=

SLACKREQ='dbus glib gcr libusb libsecret
libcdio libgudev gtk3 
avahi bluez libfuse3 libbluray libmtp
'
SLACKDESC="gvfs: gvfs $PKGVER (GIO Virtual Filesystem)
gvfs: 
gvfs: The Gvfs package is a userspace virtual filesystem designed to work 
gvfs: with the I/O abstractions of GLib's GIO library.
gvfs: 
gvfs: This is an EXPERIMENTAL package. There is no configuration, no
gvfs: init-script. Use it at your own risk.
gvfs: 
gvfs: 
gvfs: 
gvfs:
"
SLACKSUG='samba4 libsoup3 libgphoto2 libimobiledevice libcdio polkit
libnfs = 5.0.3-x86_64-1'
SLACKINSTALL='glib-compile-schemas ./usr/share/glib-2.0/schemas'

DEBUG= # yes to enable debug

### default pkg_download
### default pkg_prepare
### default pkg_package

### build
pkg_build() {
	cd /tmp/gvfs* &&

	export LANG=en_US.utf8 # this is required by python3, which is used by gtk-doc
	export CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS -DNDEBUG"

	# we want -g permanently, -O0 when debugging
	CFLAGS="$CFLAGS -g"
	[ $DEBUG ] && CFLAGS="$CFLAGS -O0"
	
	# appease gcc 12.2.x
	CFLAGS="$CFLAGS -Wno-declaration-after-statement" &&
	
	MESONFLAGS="$MESONFLAGS \
		-Dfuse=true         \
		-Dgphoto2=true      \
		-Dafc=true          \
		-Dbluray=true       \
		-Dnfs=false         \
		-Dmtp=true          \
		-Dsmb=true          \
		-Dtmpfilesdir=no    \
		-Ddnssd=true        \
		-Dgoa=false         \
		-Dgoogle=false      \
		-Dsystemduserunitdir=no \
		-Dman=true \
		-Dlogind=false      \
		-Dudisks2=false     \
	" &&
	pkg_build_meson &&

	# cleanup
	rm -f /usr/share/glib-2.0/schemas/gschemas.compiled &&
	rm -rf /usr/share/glib-2.0/codegen/ &&
	
	pkg_build_slackdesc
}


