recipes: xorg: Add IPv6 support, reconfiguring some components
[dragora.git] / recipes / xorg / xserver / recipe
blob5d26683e1f2c828e8d537f6253fedf4c02bfa9c7
1 # Build recipe for xorg-server.
3 # Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
4 # Copyright (c) 2017-2019, 2021 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
19 set -e
21 program=xorg-server
22 version=1.20.10
23 release=2
25 # Define a category for the output of the package name
26 pkgcategory=xorg_xserver
28 tarname=${program}-${version}.tar.bz2
30 # Remote source(s)
31 fetch=https://www.x.org/releases/individual/xserver/$tarname
33 description="
34 A portable, network-transparent Window System.
36 The X Window System is a network transparent window system which
37 runs on a wide range of computing and graphics machines.
40 homepage=https://www.x.org
41 license="MIT X Consortium"
43 # Source documentation
44 docs="COPYING ChangeLog README.md"
45 docsdir="${docdir}/${program}-${version}"
47 build()
49     unpack "${tardir}/$tarname"
51     cd "$srcdir"
53     # Set sane permissions
54     chmod -R u+w,go-w,a+rX-s .
56     # Adjust headers
57     sed -i '/^#include <asm\/page.h>/d' Xext/xf86bigfont.c
58     sed -i 's#termio.h#termios.h#' hw/xfree86/os-support/xf86_OSlib.h
60     ./configure \
61     CPPFLAGS="$QICPPFLAGS -D_GNU_SOURCE -D__gid_t=gid_t -D__uid_t=uid_t" \
62     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -Wl,-z,lazy" \
63      $configure_args \
64      --libdir=/usr/lib${libSuffix} \
65      --mandir=$mandir \
66      --docdir=$docsdir \
67      --enable-xf86bigfont \
68      --enable-xcsecurity \
69      --enable-kdrive \
70      --enable-config-udev \
71      --enable-glamor \
72      --enable-dri \
73      --enable-dri2 \
74      --enable-dri3 \
75      --enable-ipv6 \
76      --enable-unix-transport \
77      --enable-local-transport \
78      --enable-suid-wrapper \
79      --disable-systemd-logind \
80      --with-pic \
81      --with-int10=x86emu \
82      --with-sha1=libgcrypt \
83      --with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi:unscaled,/usr/share/fonts/X11/75dpi:unscaled,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/TTF,/usr/share/fonts/X11/OTF" \
84      --with-module-dir=/usr/lib${libSuffix}/xorg/modules \
85      --with-xkb-path=/etc/X11/xkb \
86      --with-xkb-output=/var/lib/xkb \
87      --with-os-name="GNU/Linux-Libre" \
88      --with-os-vendor="Dragora"
90     make -j${jobs} V=1
91     make -j${jobs} DESTDIR="$destdir" install-strip
93     # Allow old behavior to terminate server keystroke
94     cp -p "${worktree}/archive/xserver/00-keyboard.conf" \
95           "${destdir}/usr/share/X11/xorg.conf.d"
96     chmod 644 "${destdir}/usr/share/X11/xorg.conf.d/00-keyboard.conf"
98     # Set the suid bit on the Xorg application.
99     #
100     # This will allow us to switch between tty1 and tty7 with the
101     # Ctrl-Alt-F1 and Ctrl-Alt-F7 key combinations (see
102     # recipes/xorg/app/xinit/recipe).  Thanks to BLFS!
103     chmod 4755 "${destdir}/usr/libexec/Xorg"
105     # Compress and link man pages (if needed)
106     if test -d "${destdir}/$mandir"
107     then
108         (
109             cd "${destdir}/$mandir"
110             find . -type f -exec lzip -9 {} +
111             find . -type l | while read -r file
112             do
113                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
114                 rm -- "$file"
115             done
116         )
117     fi
119     # Copy documentation
120     mkdir -p "${destdir}${docsdir}"
121     cp -p $docs "${destdir}${docsdir}"