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

# source: BLFS 8.2
TARBALL=motif-$PKGVER.tar.gz
MD5SUM=7572140bb52ba21ec2f0c85b2605e2b1
SRC_URL=http://downloads.sourceforge.net/motif/$TARBALL
BUNDLE=

SLACKREQ='libX11 freetype2 libjpeg-turbo fontconfig libpng'
SLACKDESC="motif: motif $PKGVER (Motif X11 Toolkit and WM)
motif: 
motif: Motif is both a graphical user interface (GUI) specification and the 
motif: widget toolkit for building applications that follow that 
motif: specification under the X Window System on Unix and Unix-like 
motif: operating systems. It is the toolkit for the Common Desktop 
motif: Environment and was thus the standard widget toolkit for Unix. 
motif: This package also contains the Motif Window Manager (MWM).
motif: 
motif: http://motif.ics.com/motif
motif: 
"
SLACKCONF=turbovnc

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	CONFFLAGS="$CONFFLAGS --disable-static \
		--enable-xft \
		--enable-jpeg \
		--enable-png" &&
	pkg_build_autoconf &&
	pkg_build_slackdesc &&

	# The default font is "fixed", as you can see in
	# clients/mwm/WmResource.c. But unfortunately this "fixed" font is mapped to
	# iso10646 font as you can see /usr/share/fonts/X11/misc/fonts.alias, and
	# mwm, being so old, doesn't understand iso10646 so all you see is garbage.
	# Use a font that it can understand. It's a bit ugly but it works and the font
	# is guaranteed to exit at all times.

	mkdir -p /etc/X11/app-defaults &&
	cat > /etc/X11/app-defaults/Mwm << "EOF"
!!! Ref: https://www.rpi.edu/dept/acm/doc/sample.mwm.Xdefaults
!!! Fixed font - may not exist in the future
Mwm*fontList:              -misc-fixed-medium-r-normal--15-*-*-*-*-*-iso8859-*
Mwm*client*title*fontList: -misc-fixed-medium-r-normal--15-*-*-*-*-*-iso8859-*
Mwm*icon*fontList:         -misc-fixed-medium-r-normal--15-*-*-*-*-*-iso8859-*

!!! Popular font - but ugly because motif doesn't support antialiasing
!Mwm*fontList:              -misc-dejavu sans mono-medium-r-normal--14-*-*-*-*-*-iso8859-*
!Mwm*client*title*fontList: -misc-dejavu sans mono-medium-r-normal--14-*-*-*-*-*-iso8859-*
!Mwm*icon*fontList:         -misc-dejavu sans mono-medium-r-normal--12-*-*-*-*-*-iso8859-*

!!! XFT font is only available for client use, not for window decoration unfortunately
!!! See: https://sourceforge.net/p/cdesktopenv/wiki/FontsWithXFT/
!*.renderTable: variable
!*.renderTable.variable.fontName: Sans
!*.renderTable.variable.fontSize: 8
!*.renderTable.variable.fontType: FONT_IS_XFT
EOF

}


