LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3610|回复: 25

【原创】ati-drivers-8.27.10.ebuild 率先支持 X.org 7.1 已进portage

[复制链接]
发表于 2006-8-2 00:36:59 | 显示全部楼层 |阅读模式
我两天前在 bugzilla 上提交, 已被接受, 此 ebuild 已进入官方, 不用从这下了.

怀疑以前官方的不能正常安装在 xorg 7.0 上 , 此 ebuild 修正此点.

如 midx 所说, ATIer这回可以微笑一下

ATI 早于 Nvidia 推出了支持 X.org 7.1 的驱动程序.

下面有 ebuild , 在 xorg 7.0 和 7.1 , gcc-4.1.1 , kernel-2.6.16 下编译,安装,运行通过.
最后是打包好的.

注意:
1. 使用之前
下载 ati-driver-installer-8.27.10-x86.run 到 /usr/portage/distfiles/
touch /usr/portage/distfiles/ati-driver-installer-8.27.10-x86_64.run 免得下载
用 64 位驱动的反过来
最好重新 digest

2. xorg-server-1.1.x 仍然 block ati-drivers
解决方法 1. 先卸载旧版 ati-drivers , 安装 xorg-7.1 , 再装新的驱动, 因为要 --nodeps, 装之前先满足依赖, 一般 ati-drivers 需要 acpid
  1. emerge -C ati-drivers
  2. emerge xorg-server xorg-x11
  3. emerge ati-drivers -pv
  4. emerge ati-drivers --nodeps
复制代码


解决方法 2.最好是如 midx 改 xorg-server 的 ebuild ,我怕麻烦, 没改
  1. $ diff /usr/portage/x11-base/xorg-server/xorg-server-1.1.1.ebuild /usr/local/portage-xgl-own/x11-base/xorg-server/xorg-server-1.1.1.ebuild
  2. 146c146
  3. <       !x11-drivers/ati-drivers"
  4. ---
  5. >       !<x11-drivers/ati-drivers-8.27.4"
复制代码

  1. # Copyright 1999-2006 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-8.26.18-r1.ebuild,v 1.2 2006/07/09 17:24:02 lu_zero Exp $

  4. IUSE="acpi doc opengl"

  5. inherit eutils rpm multilib linux-mod linux-info toolchain-funcs

  6. DESCRIPTION="Ati precompiled drivers for r350, r300, r250 and r200 chipsets"
  7. HOMEPAGE="http://www.ati.com"
  8. SRC_URI="x86? ( mirror://gentoo/ati-driver-installer-${PV}-x86.run )
  9.          amd64? ( mirror://gentoo/ati-driver-installer-${PV}-x86_64.run )"

  10. LICENSE="ATI"
  11. KEYWORDS="-* ~amd64 ~x86"

  12. RDEPEND="|| ( x11-base/xorg-server virtual/x11 )
  13.          || ( x11-apps/xauth virtual/x11 )
  14.          !>=x11-base/xorg-server-1.0.99
  15.          app-admin/eselect-opengl
  16.          || ( sys-libs/libstdc++-v3 =sys-devel/gcc-3.3* )
  17.          acpi? ( sys-power/acpid )"

  18. DEPEND=">=virtual/linux-sources-2.4
  19.         ${RDEPEND}"

  20. PROVIDE="virtual/opengl"

  21. ATIBIN="${D}/opt/ati/bin"
  22. RESTRICT="nostrip multilib-pkg-force stricter"

  23. MODULE_NAMES="fglrx(video:${WORKDIR}/common/lib/modules/fglrx/build_mod)"

  24. QA_EXECSTACK_x86="usr/lib/xorg/modules/dri/fglrx_dri.so"
  25. QA_EXECSTACK_amd64="usr/lib64/xorg/modules/dri/fglrx_dri.so usr/lib32/xorg/modules/dri/fglrx_dri.so"
  26. QA_TEXTREL_x86="usr/lib/xorg/modules/dri/fglrx_dri.so usr/lib/opengl/ati/lib/libGL.so.1.2"
  27. QA_TEXTREL_amd64="usr/lib64/xorg/modules/dri/fglrx_dri.so usr/lib32/opengl/ati/lib/libGL.so.1.2 usr/lib32/xorg/modules/dri/fglrx_dri.so usr/lib32/xorg/modules/dri/atiogl_a_dri.so"

  28. choose_driver_paths() {
  29.         ARCH_DIR="${WORKDIR}/arch"
  30.         COMMON_DIR="${WORKDIR}/common"

  31.         #new modular X paths, 0 is a workaround.
  32.         if has_version "x11-base/xorg-server"; then
  33.                 # so we are using >= X.org 7.0
  34.                 if [ "$(get_version_component_range 2 ${X11_IMPLEM_V})" = 0 ]
  35.                 then
  36.                         BASE_DIR="${WORKDIR}/x690"
  37.                         xlibdir="xorg"
  38.                 elif [ "$(get_version_component_range 2 ${X11_IMPLEM_V})" = 1 ]
  39.                 then
  40.                         BASE_DIR="${WORKDIR}/x710"
  41.                         xlibdir="xorg"
  42.                 fi
  43.         else
  44.                 BASE_DIR="${WORKDIR}/x$(get_version_component_range 1 ${X11_IMPLEM_V})"
  45.                 xlibdir=""

  46.                 # Determine if we are facing X.org 6.8.99 aka 6.9
  47.                 if [ "$(get_version_component_range 1 ${X11_IMPLEM_V})" = 6 ] &&
  48.                    [ "$(get_version_component_range 2 ${X11_IMPLEM_V})" = 8 ] &&
  49.                    [ "$(get_version_component_range 3 ${X11_IMPLEM_V})" = 99 ]
  50.                 then
  51.                         BASE_DIR="${BASE_DIR}90"
  52.                 else
  53.                         BASE_DIR="${BASE_DIR}$(get_version_component_range 2 ${X11_IMPLEM_V})0"
  54.                 fi
  55.         fi

  56.         if use amd64 ; then
  57.                 BASE_DIR="${BASE_DIR}_64a"
  58.                 ARCH_DIR="${ARCH_DIR}/x86_64"
  59.         else
  60.                 ARCH_DIR="${ARCH_DIR}/x86"
  61.         fi
  62. }

  63. pkg_setup(){
  64.         #check kernel and sets up KV_OBJ
  65.         linux-mod_pkg_setup
  66.         local agp
  67.         ebegin "Checking for MTRR support enabled"
  68.         linux_chkconfig_present MTRR
  69.         eend $?
  70.         if [[ $? -ne 0 ]] ; then
  71.         ewarn "You don't have MTRR support enabled, the direct rendering"
  72.         ewarn "will not work."
  73.         fi

  74.         ebegin "Checking for AGP support enabled"
  75.         linux_chkconfig_present AGP
  76.         eend $?

  77.         if [[ $? -ne 0 ]] ; then

  78.                 ebegin "Checking for PCI Express support enabled"
  79.                 linux_chkconfig_present PCIEPORTBUS
  80.                 eend $?

  81.                 if [[ $? -ne 0 ]] ; then
  82.                         ewarn "If you don't have either AGP or PCI Express support enabled, direct rendering"
  83.                         ewarn "could work only using the internal support."
  84.                 fi

  85.         fi
  86.         ebegin "Checking for DRM support disabled"
  87.         ! linux_chkconfig_builtin DRM
  88.         eend $?
  89.         if [[ $? -ne 0 ]] ; then
  90.         ewarn "You have DRM support enabled builtin, the direct rendering"
  91.         ewarn "will not work."
  92.         fi

  93.         # Set up X11 implementation
  94.         if has_version "x11-base/xorg-server"; then
  95.                 X11_IMPLEM=xorg-x11
  96.                 X11_IMPLEM_V="$(best_version x11-base/xorg-x11)"
  97.                 X11_IMPLEM_V="${X11_IMPLEM_V/${X11_IMPLEM}-/}"
  98.                 X11_IMPLEM_V="${X11_IMPLEM_V##*\/}"
  99.         elif has_version "<x11-base/xorg-x11-6.8.99"; then
  100.                 X11_IMPLEM=xorg-x11
  101.                 X11_IMPLEM_V="$(best_version x11-base/xorg-x11)"
  102.                 X11_IMPLEM_V="${X11_IMPLEM_V/${X11_IMPLEM}-/}"
  103.                 X11_IMPLEM_V="${X11_IMPLEM_V##*\/}"
  104.         else
  105.                 X11_IMPLEM_P="$(best_version virtual/x11)"
  106.                 X11_IMPLEM="${X11_IMPLEM_P%-[0-9]*}"
  107.                 X11_IMPLEM="${X11_IMPLEM##*\/}"
  108.                 X11_IMPLEM_V="${X11_IMPLEM_P/${X11_IMPLEM}-/}"
  109.                 X11_IMPLEM_V="${X11_IMPLEM_V##*\/}"
  110.         fi
  111.         einfo "X11 implementation is ${X11_IMPLEM}"
  112.         einfo "X11 version is        ${X11_IMPLEM_V}"
  113.         choose_driver_paths
  114. }

  115. src_unpack() {
  116.         local OLDBIN="/usr/X11R6/bin"

  117.         ebegin "Unpacking Ati drivers"
  118.         sh ${DISTDIR}/${A} --extract ${WORKDIR} &> /dev/null
  119.         eend $? || die "unpack failed"

  120.         rm -rf ${ARCH_DIR}/usr/X11R6/bin/{fgl_glxgears,fireglcontrolpanel}

  121.         cd ${WORKDIR}/common/lib/modules/fglrx/build_mod

  122.         #if kernel_is ge 2 6 16; then
  123.         #        epatch ${FILESDIR}/${PN}-8.22.5-intermodule.patch
  124.         #        epatch ${FILESDIR}/${PN}-8.23.7-noiommu.patch
  125.         #        epatch ${FILESDIR}/${PN}-8.23.7-gcc41.patch
  126.         #fi
  127.         if use acpi
  128.         then
  129.                 sed -i \
  130.                 -e "s/\/var\/lib\/xdm\/authdir/\/etc\/X11\/xdm\/authdir/" \
  131.                 -e "s/\/var\/lib\/gdm/\/var\/gdm/" \
  132.                 -e "s/#ffff#/#ffff##:.*MIT-MAGIC-COOKIE/" \
  133.                 "${WORKDIR}/common/etc/ati/authatieventsd.sh" \
  134.                         || die "sed failed."
  135.         fi
  136. }

  137. src_compile() {
  138.         einfo "Building the DRM module..."
  139.         cd ${WORKDIR}/common/lib/modules/fglrx/build_mod
  140.         ln -s \
  141.         ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC$(gcc-major-version) \
  142.         || die "cannot find precompiled core"

  143.         if kernel_is 2 6
  144.         then
  145.                 set_arch_to_kernel
  146.                 addwrite "/usr/src/${FK}"
  147.                 cp 2.6.x/Makefile .
  148.                 export _POSIX2_VERSION="199209"
  149.                 if use_m ;
  150.                 then
  151.                         make -C ${KV_DIR} M="`pwd`" GCC_VER_MAJ=$(gcc-major-version) \
  152.                                 modules || ewarn "DRM module not built"
  153.                 else
  154.                         make -C ${KV_DIR} SUBDIRS="`pwd`" GCC_VER_MAJ=$(gcc-major-version) \
  155.                                 modules || ewarn "DRM module not built"
  156.                 fi
  157.                 set_arch_to_portage
  158.         else
  159.                 export _POSIX2_VERSION="199209"
  160.                 # That is the dirty way to avoid the id -u check
  161.                 sed -e 's:`id -u`:0:' \
  162.                         -e "s:\`uname -r\`:${KV_FULL}:" \
  163.                         -i make.sh
  164.                 chmod +x make.sh
  165.                 ./make.sh || ewarn "DRM module not built"
  166.         fi
  167. }

  168. pkg_preinst() {
  169.         # Clean the dynamic libGL stuff's home to ensure
  170.         # we don't have stale libs floating around ...
  171.         if [ -d "${ROOT}/usr/lib/opengl/ati" ]
  172.         then
  173.                 rm -rf ${ROOT}/usr/lib/opengl/ati/*
  174.         fi
  175. }

  176. src_install() {
  177.         local ATI_LIBGL_PATH=""
  178.         cd ${WORKDIR}/common/lib/modules/fglrx/build_mod
  179.         linux-mod_src_install

  180.         cd ${WORKDIR}

  181.         local native_dir
  182.         use x86 && native_dir="lib"
  183.         use amd64 && native_dir="lib64"

  184.         # Install the libs
  185.         # MULTILIB-CLEANUP: Fix this when FEATURES=multilib-pkg is in portage
  186.         local MLTEST=$(type dyn_unpack)
  187.         if [ "${MLTEST/set_abi/}" = "${MLTEST}" ] && has_multilib_profile; then
  188.                 local OABI=${ABI}
  189.                 for ABI in $(get_install_abis); do
  190.                         src_install-libs
  191.                 done
  192.                 ABI=${OABI}
  193.                 unset OABI
  194.         elif has_multilib_profile; then
  195.                 src_install-libs
  196.         elif use amd64; then
  197.                 src_install-libs lib $(get_multilibdir)
  198.                 src_install-libs lib64 $(get_libdir)
  199.         else
  200.                 src_install-libs
  201.         fi &> /dev/null

  202.         #apps, man pages, and conf files
  203.         exeinto /opt/ati/bin
  204.         doexe ${ARCH_DIR}/usr/X11R6/bin/*
  205.         if use acpi
  206.         then
  207.                 exeinto /opt/ati/sbin
  208.                 doexe ${ARCH_DIR}/usr/sbin/*
  209.                 insinto /opt/ati/man/man8
  210.                 doins common/usr/share/man/man8/*
  211.                 doinitd ${FILESDIR}/atieventsd.rc6 atieventsd
  212.                 dodir /etc/conf.d
  213.                 echo 'ATIEVENTSDOPTS=""' > ${D}/etc/conf.d/atieventsd
  214.         fi
  215.         #ati custom stuff
  216.         insinto /usr
  217.         doins -r ${WORKDIR}/common/usr/include

  218.         # doc's
  219.         if use doc; then
  220.                 dodir /usr/share/doc/fglrx
  221.                 cp -pPR common/usr/share/doc/fglrx/* \
  222.                         ${D}/usr/share/doc/fglrx
  223.         fi

  224.         #env.d entry
  225.         cp ${FILESDIR}/09ati ${T}/

  226.         if use acpi
  227.         then
  228.                 local ATIETC="${WORKDIR}/common/usr/share/doc/fglrx/examples/etc/acpi"
  229.                 exeinto /etc/acpi
  230.                 doexe ${ATIETC}/ati-powermode.sh
  231.                 insinto /etc/acpi/events
  232.                 doins ${ATIETC}/events/a-ac-aticonfig
  233.                 doins ${ATIETC}/events/a-lid-aticonfig
  234.         fi

  235.         #Work around hardcoded path in 32bit libGL.so on amd64, bug 101539
  236.         if has_multilib_profile && [ $(get_abi_LIBDIR x86) = "lib32" ] ; then
  237.                 ATI_LIBGL_PATH="/usr/lib/dri:/usr/$(get_libdir)/dri:/usr/lib32/${xlibdir}/modules/dri/:/usr/$(get_libdir)/${xlibdir}/modules/dri"
  238.         fi
  239.                 cat >>${T}/09ati <<EOF

  240. LIBGL_DRIVERS_PATH="\$LIBGL_DRIVERS_PATH:$ATI_LIBGL_PATH"
  241. EOF

  242.         doenvd ${T}/09ati
  243. }

  244. src_install-libs() {
  245.         local pkglibdir=lib
  246.         local inslibdir="$(get_libdir)/${xlibdir}"
  247.         ATI_LIBGL_PATH="${ATI_LIBGL_PATH}:/usr/$(get_libdir)/${xlibdir}/modules/dri"
  248.         if [ ${#} -eq 2 ]; then
  249.                 pkglibdir=${1}
  250.                 inslibdir=${2}
  251.         elif has_multilib_profile && [ "${ABI}" == "amd64" ]; then
  252.                 pkglibdir=lib64
  253.         fi

  254.         einfo "${pkglibdir} -> ${inslibdir}"

  255.         local ATI_ROOT="/usr/$(get_libdir)/opengl/ati"

  256.         # The GLX libraries
  257.         exeinto ${ATI_ROOT}/lib
  258.         doexe ${ARCH_DIR}/usr/X11R6/${pkglibdir}/libGL.so.1.2
  259.         dosym libGL.so.1.2 ${ATI_ROOT}/lib/libGL.so.1
  260.         dosym libGL.so.1.2 ${ATI_ROOT}/lib/libGL.so

  261.         # Don't do this... see bug #47598
  262.         #dosym libGL.so.1.2 ${ATI_ROOT}/lib/libMesaGL.so

  263.         # same as the xorg implementation
  264.         dosym ../${X11_IMPLEM}/extensions ${ATI_ROOT}/extensions
  265.         #Workaround
  266.         if use opengl ; then
  267.         sed -e "s:libdir=.*:libdir=${ATI_ROOT}/lib:" \
  268.                 /usr/$(get_libdir)/opengl/${X11_IMPLEM}/lib/libGL.la \
  269.                 > $D/${ATI_ROOT}/lib/libGL.la
  270.         dosym ../${X11_IMPLEM}/include ${ATI_ROOT}/include
  271.         fi
  272.         # X and DRI driver
  273.         if has_version "<x11-base/xorg-x11-6.8.0-r4"
  274.         then
  275.                 local X11_DIR="/usr/X11R6/"
  276.         else
  277.                 local X11_DIR="/usr/"
  278.         fi

  279.         local X11_LIB_DIR="${X11_DIR}${inslibdir}"

  280.         exeinto ${X11_LIB_DIR}/modules/drivers
  281.         # In X.org 6.8.99 / 6.9 this is a .so
  282.         doexe ${BASE_DIR}/usr/X11R6/${pkglibdir}/modules/drivers/fglrx_drv.*o

  283.         exeinto ${X11_LIB_DIR}/modules/dri
  284.         doexe ${ARCH_DIR}/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
  285.         doexe ${ARCH_DIR}/usr/X11R6/${pkglibdir}/modules/dri/atiogl_a_dri.so

  286.         exeinto ${X11_LIB_DIR}/modules/linux
  287.         # In X.org 6.8.99 / 6.9 this is a .so
  288.         if has_version ">=x11-base/xorg-x11-6.8.99" || \
  289.                 has_version "x11-base/xorg-server"
  290.         then
  291.                 doexe ${BASE_DIR}/usr/X11R6/${pkglibdir}/modules/linux/libfglrxdrm.so
  292.         else
  293.                 doexe ${BASE_DIR}/usr/X11R6/${pkglibdir}/modules/linux/libfglrxdrm.a
  294.         fi

  295.         if has_version ">=x11-base/xorg-x11-6.8.99" || \
  296.                 has_version "x11-base/xorg-server"
  297.         then
  298.                 cp -pPR ${ARCH_DIR}/usr/X11R6/${pkglibdir}/lib{fglrx_*,aticonfig} \
  299.                         ${D}/usr/$(get_libdir)
  300.         else
  301.                 cp -pPR ${ARCH_DIR}/usr/X11R6/${pkglibdir}/lib{fglrx_*,aticonfig.a} \
  302.                         ${D}/usr/$(get_libdir)
  303.         fi

  304.         #Not the best place
  305.         insinto ${X11_DIR}/include/X11/extensions
  306.         doins ${COMMON_DIR}/usr/X11R6/include/X11/extensions/fglrx_gamma.h

  307.         dodir /etc
  308.         cp -pPR ${COMMON_DIR}/etc/* ${D}/etc/
  309. }


  310. pkg_postinst() {
  311.         /usr/bin/eselect opengl set --use-old ati

  312.         echo
  313.         einfo "To switch to ATI OpenGL, run "eselect opengl set ati""
  314.         einfo "To change your xorg.conf you can use the bundled "aticonfig""
  315.         if use !opengl ; then
  316.         ewarn "You don't have the opengl useflag enabled, you won't be able to build"
  317.         ewarn "opengl applications nor use opengl driver features, if that isn't"
  318.         ewarn "the intended behaviour please add opengl to your useflag and issue"
  319.         ewarn "# emerge -Nu ati-drivers"
  320.         fi
  321.         echo
  322.         einfo "If you experience unexplained segmentation faults and kernel crashes"
  323.         einfo "with this driver and multi-threaded applications such as wine,"
  324.         einfo "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
  325.         # DRM module
  326.         linux-mod_pkg_postinst
  327. }

  328. pkg_postrm() {
  329.         linux-mod_pkg_postrm
  330.         /usr/bin/eselect opengl set --use-old xorg-x11
  331. }
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2006-8-2 02:41:15 | 显示全部楼层
glxgears 效果怎么样
回复 支持 反对

使用道具 举报

发表于 2006-8-2 08:18:18 | 显示全部楼层
被AMD收购之后变这么勤快了?哈哈
回复 支持 反对

使用道具 举报

发表于 2006-8-2 08:26:58 | 显示全部楼层
NVIDIA 的不支持 Xorg-7.1 么?好奇中。
回复 支持 反对

使用道具 举报

发表于 2006-8-2 11:05:46 | 显示全部楼层
装上了,但是有点不对劲。
glxgears得分才250多点,以前是2500多呀。没装这个驱动也有380左右。

可要说没有装成功呢,glxgears的画面明显非常顺畅,感觉上和以前的效果是一致的。用xorg 7.1里面的驱动,glxgears非常的卡。怎么回事呢?
回复 支持 反对

使用道具 举报

发表于 2006-8-2 11:09:56 | 显示全部楼层
portage已经有了。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-8-2 11:42:41 | 显示全部楼层
Post by lucida
portage已经有了。。。

我看了ebuild , 怀疑 portage 里的不能正常安装在 xorg 7.0 上.
回复 支持 反对

使用道具 举报

发表于 2006-8-2 15:30:20 | 显示全部楼层
ATI的开发勤快多了好象,8.28已经在开发中,,,不知道是否瞄准的是当前git里的X11R7.2?
回复 支持 反对

使用道具 举报

发表于 2006-8-2 15:41:27 | 显示全部楼层
看来RMS下次应该再去砸一次Nvidia的场子,哈哈
http://www.fsf.org/blogs/community/rms-ati-protest.html
回复 支持 反对

使用道具 举报

发表于 2006-8-2 21:48:02 | 显示全部楼层
ATI 长期以来都是反应缓慢的,好不容易反应快了一点。
相反 NVIDIA 反应一向都挺快的(除了对XEN),RMS 应该没那么快就跑去折腾 NVIDIA的。嘿嘿
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表