recipe 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # Build recipe for xorg-server.
  2. #
  3. # Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
  4. # Copyright (c) 2017-2019, 2021-2023 Matias Fonzo, <selk@dragora.org>.
  5. #
  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
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  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.
  17. # Exit immediately on any error
  18. set -e
  19. program=xorg-server
  20. version=21.1.8
  21. release=1
  22. # Define a category for the output of the package name
  23. pkgcategory=xorg_xserver
  24. tarname=${program}-${version}.tar.gz
  25. # Remote source(s)
  26. fetch=https://www.x.org/releases/individual/xserver/$tarname
  27. description="
  28. A portable, network-transparent Window System.
  29. The X Window System is a network transparent window system which
  30. runs on a wide range of computing and graphics machines.
  31. "
  32. homepage=https://www.x.org
  33. license="MIT X Consortium"
  34. # Source documentation
  35. docs="COPYING ChangeLog README.md"
  36. docsdir="${docdir}/${program}-${version}"
  37. build()
  38. {
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. # Set sane permissions
  42. chmod -R u+w,go-w,a+rX-s .
  43. # Adjust headers (thanks to our team mate "mprodrigues")
  44. sed -i 's#termio.h#termios.h#' hw/xfree86/os-support/xf86_OSlib.h
  45. rm -rf BUILD
  46. mkdir BUILD
  47. cd BUILD
  48. CPPFLAGS="$QICPPFLAGS -D_GNU_SOURCE -D__gid_t=gid_t -D__uid_t=uid_t" \
  49. CFLAGS="$QICFLAGS " LDFLAGS="$QILDFLAGS -Wl,-z,lazy" \
  50. meson setup $configure_args \
  51. --libdir=/usr/lib${libSuffix} \
  52. --mandir=$mandir \
  53. --buildtype=release \
  54. --strip \
  55. -Dxorg=true \
  56. -Dxnest=true \
  57. -Dglamor=true \
  58. -Dbuilder_addr='dragora-users@nongnu.org' \
  59. -Dmodule_dir=/usr/lib${libSuffix}/xorg/modules \
  60. -Ddefault_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" \
  61. -Dglx=true \
  62. -Dsecure-rpc=false \
  63. -Dipv6=true \
  64. -Dxkb_dir=/usr/share/X11/xkb \
  65. -Dxkb_output_dir=/var/lib/xkb \
  66. -Dlisten_tcp=false \
  67. -Dlisten_unix=true \
  68. -Dlisten_local=true \
  69. -Dint10=x86emu \
  70. -Dsuid_wrapper=true \
  71. -Dhal=false \
  72. -Dsystemd_logind=false \
  73. -Dxf86bigfont=true \
  74. -Dxcsecurity=true \
  75. -Dmitshm=true \
  76. -Ddri1=true \
  77. -Ddri2=true \
  78. -Ddri3=true \
  79. ..
  80. ninja -j${jobs}
  81. DESTDIR="$destdir" ninja -j${jobs} install
  82. cd ..
  83. # Allow old behavior to terminate server keystroke
  84. cp -p "${worktree}/archive/xserver/00-keyboard.conf" \
  85. "${destdir}/usr/share/X11/xorg.conf.d"
  86. chmod 644 "${destdir}/usr/share/X11/xorg.conf.d/00-keyboard.conf"
  87. # Set the suid bit on the Xorg application.
  88. #
  89. # This will allow us to switch between tty1 and tty7 with the
  90. # Ctrl-Alt-F1 and Ctrl-Alt-F7 key combinations (see
  91. # recipes/xorg/app/xinit/recipe). Thanks to BLFS!
  92. chmod 4755 "${destdir}/usr/libexec/Xorg"
  93. # Compress and link man pages (if needed)
  94. if test -d "${destdir}/$mandir"
  95. then
  96. (
  97. cd "${destdir}/$mandir"
  98. find . -type f -exec lzip -9 {} +
  99. find . -type l | while read -r file
  100. do
  101. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  102. rm -- "$file"
  103. done
  104. )
  105. fi
  106. # Copy documentation
  107. mkdir -p "${destdir}/$docsdir"
  108. cp -p $docs "${destdir}/$docsdir"
  109. }