Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 27th, 2010  |  syntax: Bash  |  size: 9.41 KB  |  views: 119  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. # Based on the original PKGBUILD of 'catalyst' and 'lib32-catalyst-utils'
  3. # Maintainer: Vi0L0 <vi0l093@gmail.com>
  4. # Contributor: Eduardo "kensai" Romero
  5. # Contributor: Anssi Hannula
  6. # Contributor: Stefan B├╝hler
  7. # Contributor: baghera
  8. # Contributor: Arlekino
  9. # Contributor: Mikko Seppala
  10. # Contributor: Manuel Gaul
  11. # Contributor: Armin Wehrfritz
  12.  
  13. _kernver=`uname -r`
  14.  
  15. pkgbase=catalyst
  16. if [ "${CARCH}" = "i686" ]; then
  17.   pkgname=('catalyst')
  18. fi
  19. if [ "${CARCH}" = "x86_64" ]; then
  20.   pkgname=('catalyst' 'lib32-catalyst')
  21. fi
  22. pkgver=10.6
  23. pkgrel=11
  24. arch=('i686' 'x86_64')
  25. url="http://www.ati.amd.com"
  26. license=('custom')
  27. source=(http://www2.ati.com/drivers/linux/ati-driver-installer-${pkgver/./-}-x86.x86_64.run
  28.     catalyst.sh lib32-catalyst.sh amdcccle.desktop atieventsd.sh fglrx-2.6.34-rc4.patch)
  29. md5sums=('089967a9aa86ad596884d82bb0b3a382'
  30.          'bdafe749e046bfddee2d1c5e90eabd83'
  31.          'd31f79782eb1042e1b45f2486c3b0d33'
  32.          '4efa8414a8fe9eeb50da38b5522ef81d'
  33.          'f729bf913613f49b0b9759c246058a87'
  34.          '5d464f7068fb45a9d2013cbd6a0b2021')
  35.  
  36.  
  37. build() {
  38.   ## Unpack archive
  39.     msg "Unpack archive ..."
  40.     /bin/sh ./ati-driver-installer-${pkgver/./-}-x86.x86_64.run --extract archive_files
  41.  
  42.   ## Build kernel modules
  43.     msg "Build kernel modules ..."
  44.     if [ "${CARCH}" = "x86_64" ]; then
  45.       BUILDARCH=x86_64
  46.       _archdir=x86_64
  47.     fi
  48.     if [ "${CARCH}" = "i686" ]; then
  49.       BUILDARCH=i386
  50.       _archdir=x86
  51.     fi
  52.  
  53.     #patching for kernel 2.6.34 or 2.6.35 support
  54.     if [ `uname -r |grep -c "2.6.34"` != 0 ] || [ `uname -r |grep -c "2.6.35"` != 0 ]; then
  55.       cd "${srcdir}/archive_files/"
  56.       patch -Np1 -i ../fglrx-2.6.34-rc4.patch || return 1
  57.     fi
  58.  
  59.     cd "${srcdir}/archive_files/common/lib/modules/fglrx/build_mod"
  60.     cp "${srcdir}/archive_files/arch/${_archdir}/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC4" . || return 1
  61.     cp 2.6.x/Makefile . || return 1
  62.  
  63.     make -C /lib/modules/${_kernver}/build SUBDIRS="`pwd`" ARCH=${BUILDARCH} modules || return 1
  64. }
  65.  
  66. package_catalyst() {
  67.   pkgdesc="AMD/ATI drivers for Radeon brand cards"
  68.   depends=('xorg-server<1.9.0' 'kernel26>=2.6.30' 'kernel26<2.6.36' 'kernel26-headers' 'netkit-bsd-finger' 'libstdc++5' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs')
  69.   conflicts=('catalyst-test' 'catalyst-utils' 'nvidia' 'libgl' 'catalyst-leaked' 'xf86-video-ati' 'xf86-video-radeonhd' 'ati-dri')
  70.   provides=('catalyst' 'catalyst-utils' 'libgl' "libatical=${pkgver}")
  71.   install=catalyst.install
  72.  
  73.   ## Install kernel modules
  74.     msg "Install kernel modules ..."
  75.     cd "${srcdir}/archive_files/common/lib/modules/fglrx/build_mod"
  76.     install -m755 -d "${pkgdir}/lib/modules/${_kernver}/video/"
  77.     install -m644 fglrx.ko "${pkgdir}/lib/modules/${_kernver}/video/" || return 1
  78.     install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  79.  
  80.     sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" $startdir/*.install
  81.  
  82.   ## Install userspace tools and libraries
  83.     msg "Install userspace tools and libraries ..."
  84.     # Create directories
  85.       install -m755 -d "${pkgdir}/etc/ati"
  86.       install -m755 -d "${pkgdir}/etc/rc.d"
  87.       install -m755 -d "${pkgdir}/etc/profile.d"
  88.       install -m755 -d "${pkgdir}/etc/acpi/events"
  89.  
  90.       install -m755 -d "${pkgdir}/usr/lib/xorg/modules/dri"
  91.       install -m755 -d "${pkgdir}/usr/lib/xorg/modules/drivers"
  92.       install -m755 -d "${pkgdir}/usr/lib/xorg/modules/extensions"
  93.       install -m755 -d "${pkgdir}/usr/lib/xorg/modules/linux"
  94.  
  95.       install -m755 -d "${pkgdir}/usr/bin"
  96.       install -m755 -d "${pkgdir}/usr/sbin"
  97.  
  98.       install -m755 -d "${pkgdir}/usr/include/X11/extensions"
  99.       install -m755 -d "${pkgdir}/usr/include/GL"
  100.  
  101.       install -m755 -d "${pkgdir}/usr/share/applications"
  102.       install -m755 -d "${pkgdir}/usr/share/ati/amdcccle"
  103.       install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  104.       install -m755 -d "${pkgdir}/usr/share/man/man8"
  105.       install -m755 -d "${pkgdir}/usr/share/pixmaps"
  106.  
  107.     # X.org driver
  108.       if [ "${CARCH}" = "i686" ]; then
  109.         cd "${srcdir}/archive_files/x750/usr/X11R6/lib/modules" || return 1
  110.       elif [ "${CARCH}" = "x86_64" ]; then
  111.         cd "${srcdir}/archive_files/x750_64a/usr/X11R6/lib64/modules" || return 1
  112.       fi
  113.  
  114.       #install -m644 *.a "${pkgdir}/usr/lib/xorg/modules/" || return 1
  115.       install -m755 *.so "${pkgdir}/usr/lib/xorg/modules/" || return 1
  116.       install -m755 drivers/*.so "${pkgdir}/usr/lib/xorg/modules/drivers/" || return 1
  117.       install -m755 linux/*.so "${pkgdir}/usr/lib/xorg/modules/linux/" || return 1
  118.       install -m755 extensions/libglx.so "${pkgdir}/usr/lib/xorg/modules/extensions/" || return 1
  119.       #install -m755 extensions/libdri.so "${pkgdir}/usr/lib/xorg/modules/extensions/libdri.ati" || return 1
  120.  
  121.     # Controlcenter / libraries
  122.       if [ "${CARCH}" = "i686" ]; then
  123.         cd "${srcdir}/archive_files/arch/x86/usr" || return 1
  124.         _lib=lib
  125.       elif [ "${CARCH}" = "x86_64" ]; then
  126.         cd "${srcdir}/archive_files/arch/x86_64/usr" || return 1
  127.         _lib=lib64
  128.       fi
  129.  
  130.       install -m755 X11R6/bin/* "${pkgdir}/usr/bin/" || return 1
  131.       install -m755 sbin/* "${pkgdir}/usr/sbin/" || return 1
  132.       install -m755 X11R6/${_lib}/*.so* "${pkgdir}/usr/lib/" || return 1
  133.       install -m644 X11R6/${_lib}/*.a "${pkgdir}/usr/lib/" || return 1 # really needed?
  134.       install -m644 X11R6/${_lib}/*.cap "${pkgdir}/usr/lib/" || return 1
  135.       install -m755 X11R6/${_lib}/modules/dri/*.so "${pkgdir}/usr/lib/xorg/modules/dri/" || return 1
  136.       install -m755 ${_lib}/*.so* "${pkgdir}/usr/lib/" || return 1
  137.  
  138.       ln -sf /usr/lib/xorg/modules/dri ${pkgdir}/usr/lib/dri
  139.       ln -sf libfglrx_dm.so.1.0 "${pkgdir}/usr/lib/libfglrx_dm.so.1"
  140.       ln -sf libfglrx_pp.so.1.0 "${pkgdir}/usr/lib/libfglrx_pp.so.1"
  141.       #ln -sf libfglrx_tvout.so.1.0 "${pkgdir}/usr/lib/libfglrx_tvout.so.1"
  142.       ln -sf libfglrx_gamma.so.1.0 "${pkgdir}/usr/lib/libfglrx_gamma.so.1"
  143.       ln -sf libGL.so.1.2 "${pkgdir}/usr/lib/libGL.so.1"
  144.       ln -sf libGL.so.1.2 "${pkgdir}/usr/lib/libGL.so"
  145.  
  146.       cd "${srcdir}"/archive_files/common
  147.       install -m644 etc/ati/* "${pkgdir}/etc/ati/" || return 1
  148.       chmod 755 "${pkgdir}/etc/ati/authatieventsd.sh" || return 1
  149.  
  150.       install -m644 usr/X11R6/include/X11/extensions/*.h "${pkgdir}/usr/include/X11/extensions/" || return 1
  151.       install -m644 usr/X11R6/bin/amdupdaterandrconfig "${pkgdir}/usr/bin/" || return 1
  152.       install -m644 usr/include/GL/*.h "${pkgdir}/usr/include/GL/" || return 1
  153.       install -m755 usr/sbin/*.sh "${pkgdir}/usr/sbin/" || return 1
  154.       install -m644 usr/share/ati/amdcccle/* "${pkgdir}/usr/share/ati/amdcccle/" || return 1 # ? what are these files for?
  155.       # install -m644 usr/share/gnome/apps/amdcccle.desktop "${pkgdir}/usr/share/applications/" || return 1
  156.       install -m644 usr/share/icons/*.xpm "${pkgdir}/usr/share/pixmaps/" || return 1
  157.       install -m644 usr/share/man/man8/*.8 "${pkgdir}/usr/share/man/man8/" || return 1
  158.       install -m644 "${srcdir}/amdcccle.desktop" "${pkgdir}/usr/share/applications/" || return 1
  159.  
  160.     # ACPI example files
  161.       install -m755 usr/share/doc/fglrx/examples/etc/acpi/*.sh "${pkgdir}/etc/acpi/" || return 1
  162.       sed -i -e 's/usr\/X11R6/usr/g' "${pkgdir}/etc/acpi/ati-powermode.sh" || return 1
  163.       install -m644 usr/share/doc/fglrx/examples/etc/acpi/events/* "${pkgdir}/etc/acpi/events/" || return 1
  164.  
  165.     # Add ATI Events Daemon launcher
  166.       install -m755 "${srcdir}/atieventsd.sh" "${pkgdir}/etc/rc.d/atieventsd" || return 1
  167.  
  168.     # thanks to cerebral, we dont need that damned symlink
  169.       install -m755 "${srcdir}/catalyst.sh" "${pkgdir}/etc/profile.d/" || return 1
  170.  
  171.     # License
  172.       install -m644 "${srcdir}/archive_files/ATI_LICENSE.TXT" "${pkgdir}/usr/share/licenses/${pkgname}/" || return 1
  173. }
  174.  
  175. package_lib32-catalyst() {
  176.   pkgdesc="AMD/ATI 32bit userspace libraries for Radeon brand cards."
  177.   groups=('lib32')
  178.   depends=('lib32-libxext' 'lib32-libdrm' 'lib32-libstdc++5' 'catalyst>=10.6')
  179.   conflicts=('lib32-libgl' 'lib32-nvidia-utils')
  180.   replaces=('lib32-catalyst-utils' 'lib32-ati-fglrx-utils' 'lib32-fglrx-utils')
  181.   provides=('lib32-libgl')
  182.  
  183.   cd ${srcdir}
  184.   install -D -m755 lib32-catalyst.sh ${pkgdir}/etc/profile.d/lib32-catalyst.sh || return 1
  185.  
  186.   ## Install 32bit userspace libraries (lib32)
  187.     msg "Install 32bit userspace libraries (lib32) ..."
  188.     cd "${srcdir}/archive_files/arch/x86/usr" || return 1
  189.     install -dm755 "${pkgdir}/opt/lib32/usr/lib/xorg/modules/dri" || return 1
  190.     install -m755 lib/*.so* "${pkgdir}/opt/lib32/usr/lib/" || return 1
  191.     install -m755 X11R6/lib/*.so* "${pkgdir}/opt/lib32/usr/lib" || return 1
  192.     install -m755 X11R6/lib/modules/dri/*.so "${pkgdir}/opt/lib32/usr/lib/xorg/modules/dri/" || return 1
  193.  
  194.     ln -sf libfglrx_dm.so.1.0 "${pkgdir}/opt/lib32/usr/lib/libfglrx_dm.so.1"
  195.     # ln -sf libfglrx_pp.so.1.0 "${pkgdir}/opt/lib32/usr/lib/libfglrx_pp.so.1"
  196.     # ln -sf libfglrx_tvout.so.1.0 "${pkgdir}/opt/lib32/usr/lib/libfglrx_tvout.so.1"
  197.     ln -sf libfglrx_gamma.so.1.0 "${pkgdir}/opt/lib32/usr/lib/libfglrx_gamma.so.1"
  198.     ln -sf libAMDXvBA.so.1.0 "${pkgdir}/opt/lib32/usr/lib/libAMDXvBA.so.1"
  199.     ln -sf libXvBAW.so.1.0 "${pkgdir}/opt/lib32/usr/lib/libXvBAW.so.1"
  200.     ln -sf libGL.so.1.2 "${pkgdir}/opt/lib32/usr/lib/libGL.so.1"
  201.     ln -sf libGL.so.1.2 "${pkgdir}/opt/lib32/usr/lib/libGL.so"
  202.     ln -sf libatiuki.so.1.0 "${pkgdir}/opt/lib32/usr/lib/libatiuki.so.1"
  203.     ln -sf libatiuki.so.1.0 "${pkgdir}/opt/lib32/usr/lib/libatiuki.so"
  204. }