Magellan Linux

Diff of /trunk/opengl-update/opengl-update.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 617 by niro, Wed Nov 14 18:15:11 2007 UTC revision 632 by niro, Wed Nov 14 19:15:39 2007 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # Copyright 1999-2004 Gentoo Foundation  # Copyright 1999-2004 Gentoo Foundation
3  # Distributed under the terms of the GNU General Public License v2  # Distributed under the terms of the GNU General Public License v2
4  # $Header: /home/cvsd/magellan-cvs/magellan-src/opengl-update/opengl-update.sh,v 1.2 2007-11-14 18:15:11 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/opengl-update/opengl-update.sh,v 1.9 2007-11-14 19:15:39 niro Exp $
5  # Author:  Martin Schlemmer <azarah@gentoo.org>  # Author:  Martin Schlemmer <azarah@gentoo.org>
6  # Further modifications by Donnie Berkholz <spyderous@gentoo.org>  # Further modifications by Donnie Berkholz <spyderous@gentoo.org>
7  # Further modifications based off submissions to bug #54984 <cyfred@gentoo.org>  # Further modifications based off submissions to bug #54984 <cyfred@gentoo.org>
# Line 67  get_implementations() Line 67  get_implementations()
67   for dir in ${PREFIX}/lib{,32,64}/opengl/*   for dir in ${PREFIX}/lib{,32,64}/opengl/*
68   do   do
69   if [[ -d ${dir} ]] &&   if [[ -d ${dir} ]] &&
70   [[ ${dir##*/} != global ]]   [[ ${dir##*/} != global ]] &&
71   && ! hasq ${dir##*/} ${implems}   ! hasq ${dir##*/} ${implems}
72   then   then
73   implems=${implems:+${implems} }${dir##*/}   implems=${implems:+${implems} }${dir##*/}
74   fi   fi
# Line 106  Usage: ${0##*/} [<options>] <GL implemen Line 106  Usage: ${0##*/} [<options>] <GL implemen
106         --prefix=<val>:     Set the source prefix (default: /usr)         --prefix=<val>:     Set the source prefix (default: /usr)
107         --dst-prefix=<val>: Set the destination prefix (default: /usr)         --dst-prefix=<val>: Set the destination prefix (default: /usr)
108         --impl-headers:     Use headers provided by this implementation to         --impl-headers:     Use headers provided by this implementation to
109                             override golbal ones provided by opengl-update.                             override global ones provided by opengl-update.
110    
111  Usage: ${0##*/} --get-implementation  Usage: ${0##*/} --get-implementation
112         Print the current implementaion         Print the current implementaion
# Line 170  parse_options() Line 170  parse_options()
170    
171   --impl-headers) USE_PROFILE_HEADERS="yes" ;;   --impl-headers) USE_PROFILE_HEADERS="yes" ;;
172    
173   --help|-h|-?) ACION="usage" ;;   --help|-h|-?) ACTION="usage" ;;
174    
175   --version) ACTION="version" ;;   --version) ACTION="version" ;;
176    
# Line 197  parse_options() Line 197  parse_options()
197   done   done
198  }  }
199    
200  set-new-implementation()  set_new_implementation()
201  {  {
202   local GL_IMPLEM=${1}   local GL_IMPLEM=${1}
203   local GL_LOCAL   local GL_LOCAL
# Line 227  set-new-implementation() Line 227  set-new-implementation()
227   [[ -d ${PREFIX}/${LIBDIR}/opengl ]] || continue   [[ -d ${PREFIX}/${LIBDIR}/opengl ]] || continue
228   else   else
229   [[ -d ${PREFIX}/${LIBDIR}/opengl ]] &&   [[ -d ${PREFIX}/${LIBDIR}/opengl ]] &&
230   ! -h ${PREFIX}/${LIBDIR} ]] || continue   [[ ! -h ${PREFIX}/${LIBDIR} ]] || continue
231   fi   fi
232    
233   # Fallback on xorg if we don't have this implementation for this LIBDIR.   # Fallback on xorg if we don't have this implementation for this LIBDIR.
# Line 367  set-new-implementation() Line 367  set-new-implementation()
367    
368   done   done
369    
370   echo "LDPATH=\"${ldpath}\"" > ${ENV_D}   # put only one LDPATH per line!
371     local i
372     for i in $(echo ${ldpath} | sed "s:\::\ :g")
373     do
374     echo "LDPATH=\"${i}\"" >> ${ENV_D}
375     done
376   echo "OPENGL_PROFILE=\"${GL_IMPLEM}\"" >> ${ENV_D}   echo "OPENGL_PROFILE=\"${GL_IMPLEM}\"" >> ${ENV_D}
377    
378   env-rebuild   env-rebuild
# Line 385  DST_PREFIX="/usr" Line 390  DST_PREFIX="/usr"
390  AVAIL_IMPLEMS=$(get_implementations)  AVAIL_IMPLEMS=$(get_implementations)
391  CURRENT_GL_IMPLEM=$(get_current_implem)  CURRENT_GL_IMPLEM=$(get_current_implem)
392  USE_PROFILE_HEADERS="no"  USE_PROFILE_HEADERS="no"
393  VERSION="2.2.4"  VERSION="@@VERSION@@"
394    
395  parse_options ${@}  parse_options ${@}
396    
# Line 401  case ${ACTION} in Line 406  case ${ACTION} in
406   ;;   ;;
407    
408   old-implementation)   old-implementation)
409   set-new-implementation ${CURRENT_GL_IMPLEM}   set_new_implementation ${CURRENT_GL_IMPLEM}
410   exit $?   exit $?
411   ;;   ;;
412    
413   set-implementation)   set-implementation)
414   if [[ -n ${NEW_GL_IMPLEM} ]]   if [[ -n ${NEW_GL_IMPLEM} ]]
415   then   then
416   set-new-implementation ${NEW_GL_IMPLEM}   set_new_implementation ${NEW_GL_IMPLEM}
417   exit $?   exit $?
418   else   else
419   print_usage   print_usage

Legend:
Removed from v.617  
changed lines
  Added in v.632