1 # Build recipe for xinit.
3 # Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
4 # Copyright (c) 2017-2019, 2021-2022 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
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tar.bz2
31 fetch=https://www.x.org/releases/individual/app/$tarname
34 X Window System initializer.
36 The xinit program is used to start the X Window System server and a
37 first client program on systems that are not using a display manager
38 such as xdm(1) or in environments that use multiple window systems.
41 homepage=https://www.x.org
42 license="MIT X Consortium"
44 # Source documentation
45 docs="COPYING ChangeLog README.md"
46 docsdir="${docdir}/${program}-${version}"
50 unpack "${tardir}/$tarname"
54 # We don't support systemd.
56 # Apply a patch from "Slackware Linux".
57 patch -Np1 -i "${worktree}/patches/xinit/xinit.remove.systemd.kludge.diff"
59 # Set sane permissions
60 chmod -R u+w,go-w,a+rX-s .
62 ./configure CPPFLAGS="$QICPPFLAGS" \
63 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
65 --libdir=/usr/lib${libSuffix} \
68 --with-xinitdir=/etc/X11/xinit
71 make -j${jobs} DESTDIR="$destdir" install
73 # Hence the X session starts on the first unused virtual terminal,
74 # which normally is vt7 (Thanks to BLFS!) ...
75 sed -e '/$serverargs $vtarg/ s/serverargs/: #&/' \
76 -i "${destdir}/usr/bin/startx"
78 # Delete default xinitrc for TWM, this is
79 # provided by the twm package now
81 rm -f "${destdir}/etc/X11/xinit/xinitrc"
83 # Insert our custom xserverrc file
85 mkdir -p "${destdir}/etc/X11/xinit"
86 cp -p "${worktree}/archive/xinit/xserverrc" \
87 "${destdir}/etc/X11/xinit"
88 chmod 644 "${destdir}/etc/X11/xinit/xserverrc"
89 touch "${destdir}/etc/X11/xinit/.graft-config"
91 # Compress and link man pages (if needed)
92 if test -d "${destdir}/$mandir"
95 cd "${destdir}/$mandir"
96 find . -type f -exec lzip -9 {} +
97 find . -type l | while read -r file
99 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
106 mkdir -p "${destdir}${docsdir}"
107 cp -p $docs "${destdir}${docsdir}"