# Tanım: xf86-input-evdev, synaptics, vmmouse, wacom,  xf86-video-ati, fbdev, intel, nouveau, vmware sürücüi
# URL: http://ftp.x.org/archive//individual
# Paketçi: milisarge
# Gerekler: mtdev xorg-libxvmc xorg-server xcb-util xorg-xkeyboard-config xorg-twm xorg-term xorg-xclock xorg-xinit libevdev
# Grup: sürücü

isim=xorg
surum=7.8
devir=1
section=driver
kaynak=()

derle() {
cat > list.md5 << "EOF"
0f209d13b39427c1a6d38d70059b1e8f  xf86-input-evdev-2.10.4.tar.bz2
58e5b7722a402114093bf193962d1e3a  xf86-input-synaptics-1.9.0.tar.bz2
85e2e464b7219c495ad3a16465c226ed  xf86-input-vmmouse-13.1.0.tar.bz2
4faa1d4bf6eb74f40dba8c5cb3c9c3e4  xf86-input-wacom-0.33.0.tar.bz2
f34d04a755e761e03b459155fa3ddcbb  xf86-video-ati-7.8.0.tar.bz2
3931c0e19d441cc576dc088f9eb9fd73  xf86-video-fbdev-0.4.4.tar.bz2
2d7b2917ef18c6e97a6f3817c3e9387b  xf86-video-nouveau-1.0.13.tar.bz2
316aaf97eb152eef71dac70c349fb8c7  xf86-video-openchrome-0.5.0.tar.bz2
a893c37c589f7a31cea929a5d896a0e2  xf86-video-vesa-2.3.4.tar.bz2
4c3912e4d8947f6c2fc1ee9e2f211d74  xf86-video-vmware-13.2.1.tar.bz2
EOF
unset MAKEFLAGS
for paket in $(grep -v '^#' list.md5 |cut -d " " -f 3)
	do
		paketdizini=$(echo $paket | sed 's/.tar.bz2//')
		paketismi=$(echo $paket | sed 's/.tar.bz2//')
		case $paketismi in
			xf86-input-wacom-[0-9]*)
				wget http://downloads.sourceforge.net/linuxwacom/$paket;;
			*)
				wget http://ftp.x.org/archive//individual/$section/$paket;;
		esac
		grep $paket list.md5 |md5sum -c -
		tar -xf $paket

		pushd $paketdizini
		case $paketismi in
		xf86-input-vmmouse-[0-9]*)
			./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
            --with-udev-rules-dir=/lib/udev/rules.d \
            --without-hal-callouts-dir \
            --without-hal-fdi-dir;;
		xf86-input-wacom-[0-9]*)
			./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-systemd-unit-dir=no;;
		*)
			./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var;;
		esac
		make
		make DESTDIR=$PKG install
		popd
	done

# Intel is a bit different
wget  ftp://anduin.linuxfromscratch.org/BLFS/xf86-video-intel/xf86-video-intel-20160902.tar.bz2
tar -xf xf86-video-intel-20160902.tar.bz2
cd xf86-video-intel
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-kms-only \
--enable-uxa 
make 
make DESTDIR=$PKG install
}
