# Maintainer: PktSurf <smlinux@pktsurf.in>
app=xorg-server
version=1.20.14
build=2sml
homepage="https://www.x.org/wiki/"
download="https://www.x.org/releases/individual/xserver/xorg-server-$version.tar.gz"
requires="eudev libgcrypt xtrans pixman libpciaccess libxv libxkbfile libxfont2 libxtst libxrender libxaw mesa "
desc="Display server implementing the Xorg protocol"

prepbuilddir() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions
 
  # Fix breakage with gcc 12 and above
  applypatch $srcdir/picture.c.patch
}

build() {
  ./configure \
    --prefix= \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --disable-static \
    --with-xkb-output="/var/lib/xkb" \
    --with-sha1=libgcrypt \
    --disable-docs \
    --disable-devel-docs \
    --enable-xwayland 

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
dd3375ded9355a65e8efc238c3c5348ec348e499aa5cba1a5a41d4a57c5ba6e7e8e15125146012455093f84b7b89ccfa0a34ecc462bd99fb39bf281f81228cd4  xorg-server-1.20.14.tar.lz
"
