x11-base/*: Update HOMEPAGE and EGIT_REPO_URI.
[gentoo.git] / x11-base / xorg-server / xorg-server-1.20.3.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 XORG_DOC=doc
7 inherit xorg-2 multilib versionator flag-o-matic
8 EGIT_REPO_URI="https://gitlab.freedesktop.org/xorg/xserver.git"
9
10 DESCRIPTION="X.Org X servers"
11 SLOT="0/${PV}"
12 if [[ ${PV} != 9999* ]]; then
13         KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
14 fi
15
16 IUSE_SERVERS="dmx kdrive wayland xephyr xnest xorg xvfb"
17 IUSE="${IUSE_SERVERS} debug +glamor ipv6 libressl minimal selinux +suid systemd +udev unwind xcsecurity"
18
19 CDEPEND=">=app-eselect/eselect-opengl-1.3.0
20         !libressl? ( dev-libs/openssl:0= )
21         libressl? ( dev-libs/libressl:0= )
22         >=x11-apps/iceauth-1.0.2
23         >=x11-apps/rgb-1.0.3
24         >=x11-apps/xauth-1.0.3
25         x11-apps/xkbcomp
26         >=x11-libs/libdrm-2.4.89
27         >=x11-libs/libpciaccess-0.12.901
28         >=x11-libs/libXau-1.0.4
29         >=x11-libs/libXdmcp-1.0.2
30         >=x11-libs/libXfont2-2.0.1
31         >=x11-libs/libxkbfile-1.0.4
32         >=x11-libs/libxshmfence-1.1
33         >=x11-libs/pixman-0.27.2
34         >=x11-libs/xtrans-1.3.5
35         >=x11-misc/xbitmaps-1.0.1
36         >=x11-misc/xkeyboard-config-2.4.1-r3
37         dmx? (
38                 x11-libs/libXt
39                 >=x11-libs/libdmx-1.0.99.1
40                 >=x11-libs/libX11-1.1.5
41                 >=x11-libs/libXaw-1.0.4
42                 >=x11-libs/libXext-1.0.99.4
43                 >=x11-libs/libXfixes-5.0
44                 >=x11-libs/libXi-1.2.99.1
45                 >=x11-libs/libXmu-1.0.3
46                 x11-libs/libXrender
47                 >=x11-libs/libXres-1.0.3
48                 >=x11-libs/libXtst-1.0.99.2
49         )
50         glamor? (
51                 media-libs/libepoxy[X]
52                 >=media-libs/mesa-18[egl,gbm]
53                 !x11-libs/glamor
54         )
55         kdrive? (
56                 >=x11-libs/libXext-1.0.5
57                 x11-libs/libXv
58         )
59         xephyr? (
60                 x11-libs/libxcb[xkb]
61                 x11-libs/xcb-util
62                 x11-libs/xcb-util-image
63                 x11-libs/xcb-util-keysyms
64                 x11-libs/xcb-util-renderutil
65                 x11-libs/xcb-util-wm
66         )
67         !minimal? (
68                 >=x11-libs/libX11-1.1.5
69                 >=x11-libs/libXext-1.0.5
70                 >=media-libs/mesa-18
71         )
72         udev? ( virtual/libudev:= )
73         unwind? ( sys-libs/libunwind )
74         wayland? (
75                 >=dev-libs/wayland-1.3.0
76                 media-libs/libepoxy
77                 >=dev-libs/wayland-protocols-1.1
78         )
79         >=x11-apps/xinit-1.3.3-r1
80         systemd? (
81                 sys-apps/dbus
82                 sys-apps/systemd
83         )"
84
85 DEPEND="${CDEPEND}
86         sys-devel/flex
87         >=x11-base/xorg-proto-2018.3
88         dmx? (
89                 doc? (
90                         || (
91                                 www-client/links
92                                 www-client/lynx
93                                 www-client/w3m
94                         )
95                 )
96         )"
97
98 RDEPEND="${CDEPEND}
99         selinux? ( sec-policy/selinux-xserver )
100         !x11-drivers/xf86-video-modesetting
101 "
102
103 PDEPEND="
104         xorg? ( >=x11-base/xorg-drivers-$(get_version_component_range 1-2) )"
105
106 REQUIRED_USE="!minimal? (
107                 || ( ${IUSE_SERVERS} )
108         )
109         minimal? ( !glamor !wayland )
110         xephyr? ( kdrive )"
111
112 UPSTREAMED_PATCHES=(
113 )
114
115 PATCHES=(
116         "${UPSTREAMED_PATCHES[@]}"
117         "${FILESDIR}"/${PN}-1.12-unloadsubmodule.patch
118         # needed for new eselect-opengl, bug #541232
119         "${FILESDIR}"/${PN}-1.18-support-multiple-Files-sections.patch
120 )
121
122 pkg_pretend() {
123         # older gcc is not supported
124         [[ "${MERGE_TYPE}" != "binary" && $(gcc-major-version) -lt 4 ]] && \
125                 die "Sorry, but gcc earlier than 4.0 will not work for xorg-server."
126 }
127
128 pkg_setup() {
129         if use wayland && ! use glamor; then
130                 ewarn "glamor is necessary for acceleration under Xwayland."
131                 ewarn "Performance may be unacceptable without it."
132         fi
133 }
134
135 src_configure() {
136         # localstatedir is used for the log location; we need to override the default
137         #       from ebuild.sh
138         # sysconfdir is used for the xorg.conf location; same applies
139         # NOTE: fop is used for doc generating; and I have no idea if Gentoo
140         #       package it somewhere
141         XORG_CONFIGURE_OPTIONS=(
142                 $(use_enable ipv6)
143                 $(use_enable debug)
144                 $(use_enable dmx)
145                 $(use_enable glamor)
146                 $(use_enable kdrive)
147                 $(use_enable unwind libunwind)
148                 $(use_enable wayland xwayland)
149                 $(use_enable !minimal record)
150                 $(use_enable !minimal xfree86-utils)
151                 $(use_enable !minimal dri)
152                 $(use_enable !minimal dri2)
153                 $(use_enable !minimal dri3)
154                 $(use_enable !minimal glx)
155                 $(use_enable xcsecurity)
156                 $(use_enable xephyr)
157                 $(use_enable xnest)
158                 $(use_enable xorg)
159                 $(use_enable xvfb)
160                 $(use_enable udev config-udev)
161                 $(use_with doc doxygen)
162                 $(use_with doc xmlto)
163                 $(use_with systemd systemd-daemon)
164                 $(use_enable systemd systemd-logind)
165                 $(usex suid $(use_enable systemd suid-wrapper) '--disable-suid-wrapper')
166                 $(usex suid $(use_enable !systemd install-setuid) '--disable-install-setuid')
167                 --enable-libdrm
168                 --sysconfdir="${EPREFIX}"/etc/X11
169                 --localstatedir="${EPREFIX}"/var
170                 --with-fontrootdir="${EPREFIX}"/usr/share/fonts
171                 --with-xkb-output="${EPREFIX}"/var/lib/xkb
172                 --disable-config-hal
173                 --disable-linux-acpi
174                 --without-dtrace
175                 --without-fop
176                 --with-os-vendor=Gentoo
177                 --with-sha1=libcrypto
178         )
179
180         xorg-2_src_configure
181 }
182
183 src_install() {
184         xorg-2_src_install
185
186         server_based_install
187
188         if ! use minimal && use xorg; then
189                 # Install xorg.conf.example into docs
190                 dodoc "${AUTOTOOLS_BUILD_DIR}"/hw/xfree86/xorg.conf.example
191         fi
192
193         newinitd "${FILESDIR}"/xdm-setup.initd-1 xdm-setup
194         newinitd "${FILESDIR}"/xdm.initd-11 xdm
195         newconfd "${FILESDIR}"/xdm.confd-4 xdm
196
197         # install the @x11-module-rebuild set for Portage
198         insinto /usr/share/portage/config/sets
199         newins "${FILESDIR}"/xorg-sets.conf xorg.conf
200
201         find "${ED}"/var -type d -empty -delete || die
202 }
203
204 pkg_postinst() {
205         # sets up libGL and DRI2 symlinks if needed (ie, on a fresh install)
206         eselect opengl set xorg-x11 --use-old
207 }
208
209 pkg_postrm() {
210         # Get rid of module dir to ensure opengl-update works properly
211         if [[ -z ${REPLACED_BY_VERSION} && -e ${EROOT}/usr/$(get_libdir)/xorg/modules ]]; then
212                 rm -rf "${EROOT}"/usr/$(get_libdir)/xorg/modules
213         fi
214 }
215
216 server_based_install() {
217         if ! use xorg; then
218                 rm "${ED}"/usr/share/man/man1/Xserver.1x \
219                         "${ED}"/usr/$(get_libdir)/xserver/SecurityPolicy \
220                         "${ED}"/usr/$(get_libdir)/pkgconfig/xorg-server.pc \
221                         "${ED}"/usr/share/man/man1/Xserver.1x
222         fi
223 }