mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

199 lines
5.5 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/x11/xfree86/xf_config.sh
  9. # ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. # extract and patch base
  23. xf_extract() {
  24. echo "Extracting source (for package version $ver) ..."
  25. for x in $xf_files ; do
  26. tar $taropt $archdir/$x
  27. done
  28. cd xc
  29. for x in $xf_patches ; do
  30. echo "Patching source ($x) ..."
  31. bunzip2 < $archdir/$x | patch -p1 -E
  32. done
  33. }
  34. # extract additional gl* stuff
  35. xf_extract_gl() {
  36. mkdir release ; ln -s ../.. release/xc
  37. tar $taropt $archdir/mangl.tar.bz2
  38. tar $taropt $archdir/manglu.tar.bz2
  39. tar $taropt $archdir/manglx.tar.bz2
  40. rm -rf release
  41. }
  42. # extract the Matrox HALlib (additional TV/DVI out support on x86)
  43. xf_extract_hallib() {
  44. echo "Extracting mgaHALlib (For Matrox (>G400) cards) ..."
  45. tar $taropt $archdir/mgadriver-$mga_version-src.tar.bz2
  46. cp mgadriver-$mga_version-src/4.3.0/mga/HALlib/mgaHALlib.a \
  47. programs/Xserver/hw/xfree86/drivers/mga/HALlib/mgaHALlib.a
  48. rm -rf mgadriver-$mga_version-src
  49. if [[ $arch == "x86" && $arch_machine != "x86_64" ]] ; then
  50. echo "Enabling Matrox HALlib (since this is x86) ..."
  51. cat >> config/cf/host.def << EOT
  52. /* Additional TV/DVI support since this is x86 */
  53. #define HaveMatroxHal YES
  54. EOT
  55. fi
  56. }
  57. # extract the GATOS drivers
  58. xf_extract_gatos() {
  59. echo "Extracting GATOS drivers (For ATI cards with video in/out) ..."
  60. tar $taropt $archdir/gatos-ati.$gatos_version.tar.bz2
  61. cd gatos-ati.$gatos_version
  62. for x in $confdir/*.patch.gatos ; do
  63. if [ -f $x ] ; then
  64. echo "Apply patch $x ..."
  65. patch -Nf -p1 < $x
  66. fi
  67. done
  68. cd ..
  69. }
  70. # build and install the GATOS drivers
  71. xf_build_install_gatos() {
  72. cd gatos-ati.$gatos_version
  73. # imake has to be in the path for xmkmf
  74. PATH="$PATH:/usr/X11/bin"
  75. ../config/util/xmkmf ..
  76. eval $MAKE
  77. eval $MAKE install
  78. cd ..
  79. }
  80. # apply the patches
  81. xf_patch() {
  82. cp -v programs/twm/system.twmrc programs/twm/system.twmrc.orig
  83. for x in $patchfiles ; do
  84. if [ -f $x ] ; then
  85. echo "Apply patch $x ..."
  86. patch -Nf -p1 < $x
  87. fi ; done
  88. find \( -name 'config.guess' -o -name 'config.sub' \) \
  89. -exec chmod +x '{}' ';'
  90. }
  91. # build the World
  92. xf_build() {
  93. eval $MAKE World
  94. cd nls ; eval $MAKE ; cd ..
  95. }
  96. # prepare the XFree86 dirtree
  97. xf_dirtree() {
  98. mkdir -p $root/etc/X11
  99. mkdir -p $root/usr/X11R6/lib/X11/fonts/TrueType
  100. if [ "$arch_sizeof_char_p" = 8 ] ; then
  101. ln -s lib $root/usr/X11R6/lib64
  102. fi
  103. rm -fv $root/usr/X11
  104. rm -fv $root/usr/bin/X11
  105. rm -fv $root/usr/lib/X11
  106. rm -fv $root/usr/include/X11
  107. ln -sv X11R6 $root/usr/X11
  108. ln -sv ../X11/bin $root/usr/bin/X11
  109. ln -sv ../X11/lib/X11 $root/usr/lib/X11
  110. ln -sv ../X11/include/X11 $root/usr/include/X11
  111. }
  112. # install the World
  113. xf_install() {
  114. eval $MAKE install
  115. eval $MAKE install.man
  116. cd nls ; eval $MAKE install ; cd ..
  117. rm -fv $root/etc/fonts/*.bak
  118. echo "Copy TWM config files ..."
  119. cp -v programs/twm/system.twmrc.orig \
  120. programs/twm/sample-twmrc/original.twmrc
  121. cp -v programs/twm/sample-twmrc/*.twmrc $root/usr/X11R6/lib/X11/twm/
  122. register_wm twm TWM /usr/X11/bin/twm
  123. echo "Copying default example configs ..."
  124. cp -fv $base/package/x11/xfree86/XF86Config.data \
  125. $root/etc/X11/XF86Config.example
  126. cp -fv $root/etc/X11/XF86Config{.example,}
  127. cp -fv $base/package/x11/xfree86/local.conf.data \
  128. $root/etc/fonts/local.conf
  129. echo "Installing xfs init script ..."
  130. install_init xfs $base/package/x11/xfree86/xfs.init
  131. register_xdm xdm 'X11 dislay manager' /usr/X11R6/bin/xdm
  132. echo "Installing the xdm start script (multiplexer) ..."
  133. cp $confdir/startxdm.sh $root/usr/X11R6/bin/startxdm
  134. chmod +x $root/usr/X11R6/bin/startxdm
  135. echo "Installing XFree86 Setup Script ..."
  136. cp -fv $base/package/x11/xfree86/stone_mod_xfree86.sh $root/etc/stone.d/mod_xfree86.sh
  137. echo "export WINDOWMANAGER=kde" > $root/etc/profile.d/windowmanager
  138. echo "Installing XFree86 Cron Script ..."
  139. cp -fv $base/package/x11/xfree86/xfree86.cron \
  140. $root/etc/cron.daily/80-xfree86
  141. chmod +x $root/etc/cron.daily/80-xfree86
  142. }
  143. # configure the World
  144. xf_config() {
  145. echo "Configuring XFree ..."
  146. cat >> config/cf/host.def << EOT
  147. /* Disable the internal zlib to use the system installed one */
  148. #define HasZlib YES
  149. /* Disable the internal expat library to use the system installed one */
  150. #define HasExpat YES
  151. /* Less warnings with recent gccs ... */
  152. #define DefaultCCOptions -ansi GccWarningOptions
  153. /* Make sure config files are always installed ... */
  154. #define InstallXinitConfig YES
  155. #define InstallXdmConfig YES
  156. #define InstallFSConfig YES
  157. /* do not install duplicate crap in /etc/X11 */
  158. #define UseSeparateConfDir NO
  159. EOT
  160. if [[ $arch == "x86" && $arch_machine != "x86_64" ]] ; then
  161. echo "Enabling Matrox HALlib (since this is x86) ..."
  162. cat >> config/cf/host.def << EOT
  163. /* Additional TV/DVI support since this is x86 */
  164. #define HaveMatroxHal YES
  165. EOT
  166. fi
  167. }