Guest User

Untitled

a guest
Sep 19th, 2014
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.07 KB | None | 0 0
  1. VERSION=10.2.7
  2. DEMOVERS=8.1.0
  3. BUILD=${BUILD:-1}
  4.  
  5. NUMJOBS=${NUMJOBS:--j8}
  6.  
  7. # Be sure this list is up-to-date:
  8. DRI_DRIVERS="i915,i965,intel,nouveau,r200,radeon,swrast"
  9.  
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) export ARCH=i486 ;;
  13. arm*) export ARCH=arm ;;
  14. *) export ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17.  
  18. CWD=$(pwd)
  19. TMP=${TMP:-/tmp}
  20. PKG=$TMP/package-mesa
  21.  
  22. if [ "$ARCH" = "i486" ]; then
  23. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  24. LIBDIRSUFFIX=""
  25. elif [ "$ARCH" = "x86_64" ]; then
  26. SLKCFLAGS="-O2 -fPIC"
  27. LIBDIRSUFFIX="64"
  28. else
  29. SLKCFLAGS="-O2"
  30. LIBDIRSUFFIX=""
  31. fi
  32.  
  33. rm -rf $PKG
  34. mkdir -p $TMP $PKG
  35. cd $TMP
  36. rm -rf Mesa-${VERSION}
  37.  
  38. tar xvf $CWD/MesaLib-${VERSION}.tar.?z* || exit 1
  39. cd Mesa-$VERSION
  40.  
  41. # Let's kill the warning about operating on a dangling symlink:
  42. rm -f src/gallium/state_trackers/d3d1x/w32api
  43.  
  44. # Make sure ownerships and permissions are sane:
  45. chown -R root:root .
  46. find . \
  47. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  48. -exec chmod 755 {} \; -o \
  49. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  50. -exec chmod 644 {} \;
  51.  
  52. # Apply patches from git (and maybe elsewhere):
  53. # Patches obtained by:
  54. # git checkout origin/8.0
  55. # git format-patch 3d657b14b4cab98a2945904823e78cd8950944f4.. # 8.0.3 release
  56. if /bin/ls $CWD/patches/*.patch 1> /dev/null 2> /dev/null ; then
  57. for patch in $CWD/patches/*.patch ; do
  58. patch -p1 < $patch || exit 1 ;
  59. done
  60. fi
  61.  
  62. if [ ! -r configure ]; then
  63. autoreconf || exit 1
  64. fi
  65.  
  66. # Running autogen to avoid problems if our autotools don't match upstream's:
  67. ./autogen.sh
  68.  
  69. CFLAGS="$SLKCFLAGS" \
  70. ./configure \
  71. --prefix=/usr \
  72. --sysconfdir=/etc \
  73. --libdir=/usr/lib${LIBDIRSUFFIX} \
  74. --mandir=/usr/man \
  75. --docdir=/usr/doc/mesa-$VERSION \
  76. --with-dri-driverdir=/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri \
  77. --with-dri-drivers="$DRI_DRIVERS" \
  78. --with-gallium-drivers=r600,svga \
  79. --enable-gallium-llvm \
  80. --enable-vdpau \
  81. --enable-shared-glapi \
  82. --enable-xa \
  83. --enable-osmesa \
  84. --build=$ARCH-slackware-linux
  85.  
  86. # r300 requires llvm
  87. # Other gallium drivers:
  88. # galahad,i915,identity,llvmpipe,noop,nv50,nvc0,nvfx,rbug,softpipe,svga,trace
  89.  
  90. make $NUMJOBS || make || exit 1
  91. make install DESTDIR=$PKG || exit 1
  92.  
  93. # Now install the demos
  94. ( cd $TMP
  95. rm -rf mesa-demos-$DEMOVERS
  96. tar xvf $CWD/mesa-demos-$DEMOVERS.tar.?z* || exit 1
  97. cd mesa-demos-$DEMOVERS
  98. chown -R root:root .
  99. find . \
  100. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  101. -exec chmod 755 {} \; -o \
  102. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  103. -exec chmod 644 {} \;
  104. CFLAGS="$SLKCFLAGS" \
  105. ./configure \
  106. --prefix=/usr \
  107. --build=$ARCH-slackware-linux
  108. # Build and install gears and glinfo, as well as a few other demos
  109. make -C src/demos gears glinfo
  110. make -C src/xdemos \
  111. glthreads glxcontexts glxdemo glxgears glxgears_fbconfig \
  112. glxheads glxinfo glxpbdemo glxpixmap
  113. mkdir -p $PKG/usr/bin
  114. cp -a src/demos/{gears,glinfo} $PKG/usr/bin
  115. for i in glthreads glxcontexts glxdemo glxgears glxgears_fbconfig \
  116. glxheads glxinfo glxpbdemo glxpixmap ; do
  117. cp -a src/xdemos/$i $PKG/usr/bin ;
  118. done
  119. )
  120.  
  121. # Strip binaries:
  122. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  123. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  124.  
  125. find $PKG/usr/man -type f -exec gzip -9 {} \;
  126. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  127.  
  128. # Compress info files, if any:
  129. if [ -d $PKG/usr/info ]; then
  130. rm -f $PKG/usr/info/dir
  131. gzip -9 $PKG/usr/info/*
  132. fi
  133.  
  134. mkdir -p $PKG/usr/doc/Mesa-$VERSION/html
  135. cp -a \
  136. docs/COPYING* docs/relnotes-${VERSION}*.html docs/README* docs/GL* \
  137. $PKG/usr/doc/Mesa-$VERSION
  138. cp -a docs/*.html $PKG/usr/doc/Mesa-$VERSION/html
  139. rm -f $PKG/usr/doc/Mesa-$VERSION/html/relnotes*.html
  140.  
  141. mkdir -p $PKG/install
  142. cat $CWD/slack-desc > $PKG/install/slack-desc
  143.  
  144. cd $PKG
  145. /sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
Advertisement
Add Comment
Please, Sign In to add comment