### this file is sourced not run
PKGVER=2022.1
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=Xdialog-$PKGVER.tar.bz2
MD5SUM=1d6c3ea43eedd459d8c923e9fb0d126b
SRC_URL=http://distro.ibiblio.org/fatdog/source/900/$TARBALL
BUNDLE=

SLACKREQ='gtk2'
SLACKDESC="xdialog: xdialog 2.3.1-$PKGVER (UI for shell scripts)  
xdialog:  
xdialog: Xdialog is designed to be a drop in replacement for the \"dialog\" or 
xdialog: \"cdialog\" programs. It converts any terminal based program into a 
xdialog: program with an X-windows interface. The dialogs are easier to see 
xdialog: and use while adding even more functionalities (e.g. with the 
xdialog: treeview, the file selector, the edit box, the range box, the help 
xdialog: button/box).  
xdialog: 
xdialog: This a patched version from
xdialog: http://chiselapp.com/user/jamesbond/repository/xdialog/index
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/Xdialog* &&
	patch -Np1 -i ../pkg/fix-new-glibc.patch
}

### default pkg_package
### build
pkg_build() {
	export LDFLAGS="$LDFLAGS -Wl,--as-needed"
	CONFFLAGS="$CONFFLAGS --with-gtk2"
	MAKEFLAGS="" # cannot run parallel jobs

	pkg_build_autoconf && pkg_build_slackdesc &&
	mv /usr/bin/Xdialog{,-gtk12} &&
	ln -s Xdialog-gtk12 /usr/bin/Xdialog &&
	
	# install additional docs and bins
	cp -a samples /usr/share/doc/Xdialog-2.3.1 &&
	install -m 755 /tmp/pkg/g*sel /usr/bin
}


