Advertisement
Guest User

Untitled

a guest
Dec 18th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.21 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2013 Patrick J. Volkerding, Sebeka, MN, USA
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22.  
  23. PKGNAM=mesa
  24. VERSION=10.0.0
  25. DEMOVERS=8.1.0
  26. BUILD=${BUILD:-1}
  27.  
  28. NUMJOBS=${NUMJOBS:--j8}
  29.  
  30. # Be sure this list is up-to-date:
  31. DRI_DRIVERS="i915,i965,intel,nouveau,r200,radeon,swrast"
  32.  
  33. if [ -z "$ARCH" ]; then
  34. case "$( uname -m )" in
  35. i?86) export ARCH=i486 ;;
  36. arm*) export ARCH=arm ;;
  37. *) export ARCH=$( uname -m ) ;;
  38. esac
  39. fi
  40.  
  41. CWD=$(pwd)
  42. TMP=${TMP:-/tmp}
  43. PKG=$TMP/package-mesa
  44.  
  45. if [ "$ARCH" = "i486" ]; then
  46. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  47. LIBDIRSUFFIX=""
  48. elif [ "$ARCH" = "x86_64" ]; then
  49. SLKCFLAGS="-O2 -fPIC"
  50. LIBDIRSUFFIX="64"
  51. else
  52. SLKCFLAGS="-O2"
  53. LIBDIRSUFFIX=""
  54. fi
  55.  
  56. rm -rf $PKG
  57. mkdir -p $TMP $PKG
  58. cd $TMP
  59. rm -rf Mesa-${VERSION}
  60.  
  61. tar xvf $CWD/MesaLib-${VERSION}.tar.?z* || exit 1
  62. cd Mesa-$VERSION
  63.  
  64. # Let's kill the warning about operating on a dangling symlink:
  65. rm -f src/gallium/state_trackers/d3d1x/w32api
  66.  
  67. # Make sure ownerships and permissions are sane:
  68. chown -R root:root .
  69. find . \
  70. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  71. -exec chmod 755 {} \; -o \
  72. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  73. -exec chmod 644 {} \;
  74.  
  75. # Apply patches from git (and maybe elsewhere):
  76. # Patches obtained by:
  77. # git checkout origin/8.0
  78. # git format-patch 3d657b14b4cab98a2945904823e78cd8950944f4.. # 8.0.3 release
  79. if /bin/ls $CWD/patches/*.patch 1> /dev/null 2> /dev/null ; then
  80. for patch in $CWD/patches/*.patch ; do
  81. patch -p1 < $patch || exit 1 ;
  82. done
  83. fi
  84.  
  85. if [ ! -r configure ]; then
  86. autoreconf || exit 1
  87. fi
  88.  
  89. # Running autogen to avoid problems if our autotools don't match upstream's:
  90. ./autogen.sh
  91.  
  92. CFLAGS="$SLKCFLAGS" \
  93. ./configure \
  94. --prefix=/usr \
  95. --sysconfdir=/etc \
  96. --libdir=/usr/lib${LIBDIRSUFFIX} \
  97. --mandir=/usr/man \
  98. --docdir=/usr/doc/mesa-$VERSION \
  99. --with-dri-driverdir=/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri \
  100. --with-dri-drivers="$DRI_DRIVERS" \
  101. --with-gallium-drivers=r600,svga \
  102. --enable-gallium-llvm \
  103. # --enable-vdpau \
  104. --enable-shared-glapi \
  105. --enable-xa \
  106. --enable-osmesa \
  107. --build=$ARCH-slackware-linux
  108.  
  109. # r300 requires llvm
  110. # Other gallium drivers:
  111. # galahad,i915,identity,llvmpipe,noop,nv50,nvc0,nvfx,rbug,softpipe,svga,trace
  112.  
  113. make $NUMJOBS || make || exit 1
  114. make install DESTDIR=$PKG || exit 1
  115.  
  116. # Now install the demos
  117. ( cd $TMP
  118. rm -rf mesa-demos-$DEMOVERS
  119. tar xvf $CWD/mesa-demos-$DEMOVERS.tar.?z* || exit 1
  120. cd mesa-demos-$DEMOVERS
  121. chown -R root:root .
  122. find . \
  123. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  124. -exec chmod 755 {} \; -o \
  125. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  126. -exec chmod 644 {} \;
  127. CFLAGS="$SLKCFLAGS" \
  128. ./configure \
  129. --prefix=/usr \
  130. --build=$ARCH-slackware-linux
  131. # Build and install gears and glinfo, as well as a few other demos
  132. make -C src/demos gears glinfo
  133. make -C src/xdemos \
  134. glthreads glxcontexts glxdemo glxgears glxgears_fbconfig \
  135. glxheads glxinfo glxpbdemo glxpixmap
  136. mkdir -p $PKG/usr/bin
  137. cp -a src/demos/{gears,glinfo} $PKG/usr/bin
  138. for i in glthreads glxcontexts glxdemo glxgears glxgears_fbconfig \
  139. glxheads glxinfo glxpbdemo glxpixmap ; do
  140. cp -a src/xdemos/$i $PKG/usr/bin ;
  141. done
  142. )
  143.  
  144. # Strip binaries:
  145. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  146. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  147.  
  148. find $PKG/usr/man -type f -exec gzip -9 {} \;
  149. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  150.  
  151. # Compress info files, if any:
  152. if [ -d $PKG/usr/info ]; then
  153. rm -f $PKG/usr/info/dir
  154. gzip -9 $PKG/usr/info/*
  155. fi
  156.  
  157. mkdir -p $PKG/usr/doc/Mesa-$VERSION/html
  158. cp -a \
  159. docs/COPYING* docs/relnotes-${VERSION}*.html docs/README* docs/GL* \
  160. $PKG/usr/doc/Mesa-$VERSION
  161. cp -a docs/*.html $PKG/usr/doc/Mesa-$VERSION/html
  162. rm -f $PKG/usr/doc/Mesa-$VERSION/html/relnotes*.html
  163.  
  164. mkdir -p $PKG/install
  165. cat $CWD/slack-desc > $PKG/install/slack-desc
  166.  
  167. cd $PKG
  168. /sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement