Magellan Linux

Contents of /trunk/opengl-update-magellan/patches/opengl-update-2.2.4-magellanize.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (show annotations) (download)
Tue May 8 20:52:56 2007 UTC (17 years ago) by niro
File size: 4090 byte(s)
-import

1 --- opengl-update-2.2.4 2005-12-26 23:11:10.000000000 +0000
2 +++ opengl-update-2.2.4-magellan 2005-12-26 23:21:22.000000000 +0000
3 @@ -6,8 +6,12 @@
4 # Further modifications by Donnie Berkholz <spyderous@gentoo.org>
5 # Further modifications based off submissions to bug #54984 <cyfred@gentoo.org>
6 # Further modifications by Jeremy Huddleston <eradicator@gentoo.org>
7 +#
8 +# hacked for use with magellan-linux
9 +# <niro@magellan-linux.de>
10 +#
11
12 -. /etc/init.d/functions.sh
13 +. /etc/init.d/functions
14
15 hasq() {
16 local x
17 @@ -25,20 +29,11 @@
18
19 check_user() {
20 if [[ $(id -u) -ne 0 ]]; then
21 - eerror "${0}: Must be run as root."
22 + echo "${0}: Must be run as root."
23 exit 1
24 fi
25 }
26
27 -check_version() {
28 - if portageq has_version / 'x11-base/xorg-x11'; then
29 - if ! portageq has_version / '>=x11-base/xorg-x11-6.8.0-r4'; then
30 - eerror "This version requires >=x11-base/xorg-x11-6.8.0-r4"
31 - exit 1
32 - fi
33 - fi
34 -}
35 -
36 get_current_implem() {
37 local implem
38 if [[ -f ${ENV_D} ]]; then
39 @@ -104,7 +99,7 @@
40 $(echo ${AVAIL_IMPLEMS} | wc -w) available implementation${IMPLEM_PLURAL}: ${AVAIL_IMPLEMS}
41
42 Examples:
43 - ${0##*/} xorg-x11
44 + ${0##*/} xorg
45 This will setup things to use libGL.so from X.org.
46
47 ${0##*/} nvidia
48 @@ -123,7 +118,7 @@
49 --use-old)
50 if [[ -n "${ACTION}" ]]; then
51 ACTION="error"
52 - eerror "Invalid usage."
53 + echo "Invalid usage."
54 else
55 if [[ -n "${CURRENT_GL_IMPLEM}" ]] && hasq ${CURRENT_GL_IMPLEM} ${AVAIL_IMPLEMS}; then
56 ACTION="old-implementation"
57 @@ -133,7 +128,7 @@
58 --get-implementation)
59 if [[ -n "${ACTION}" ]]; then
60 ACTION="error"
61 - eerror "Invalid usage."
62 + echo "Invalid usage."
63 else
64 ACTION="get-implementation"
65 fi
66 @@ -159,14 +154,14 @@
67 if [[ "${ACTION}" != "old-implementation" ]]; then
68 if [[ -n "${ACTION}" ]]; then
69 ACTION="error"
70 - eerror "Invalid usage."
71 + echo "Invalid usage."
72 else
73 ACTION="set-implementation"
74 NEW_GL_IMPLEM="${opt}"
75 fi
76 fi
77 else
78 - eerror "Unrecognized option: ${opt}"
79 + echo "Unrecognized option: ${opt}"
80 ACTION="error"
81 fi
82 ;;
83 @@ -178,18 +173,17 @@
84 local GL_IMPLEM=${1}
85 local GL_LOCAL
86
87 - check_version
88 check_user
89
90 # Set a sane umask... bug #83115
91 umask 022
92
93 if ! hasq ${GL_IMPLEM} ${AVAIL_IMPLEMS}; then
94 - eerror "Invalid profile selected."
95 + echo "Invalid profile selected."
96 exit 1
97 fi
98
99 - ebegin "Switching to ${GL_IMPLEM} OpenGL interface"
100 + echo "Switching to ${GL_IMPLEM} OpenGL interface"
101 rm -f ${ENV_D} &> /dev/null
102
103 LIBDIRS="lib32 lib lib64"
104 @@ -202,9 +196,9 @@
105 [[ -d "${PREFIX}/${LIBDIR}/opengl" && ! -h "${PREFIX}/${LIBDIR}" ]] || continue
106 fi
107
108 - # Fallback on xorg-x11 if we don't have this implementation for this LIBDIR.
109 + # Fallback on xorg if we don't have this implementation for this LIBDIR.
110 if [[ ! -d ${PREFIX}/${LIBDIR}/opengl/"${GL_IMPLEM}" ]]; then
111 - GL_LOCAL="xorg-x11"
112 + GL_LOCAL="xorg"
113 else
114 GL_LOCAL="${GL_IMPLEM}"
115 fi
116 @@ -308,9 +302,9 @@
117 elif [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file} ]]; then
118 [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}
119 ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file}
120 - elif [[ -e ${PREFIX}/${LIBDIR}/opengl/xorg-x11/include/${file} ]]; then
121 + elif [[ -e ${PREFIX}/${LIBDIR}/opengl/xorg/include/${file} ]]; then
122 [[ -f "${file}" || ( -L "${file}" && ! -e "${file}" ) ]] && rm -f ${file}
123 - ln -s ${PREFIX}/${LIBDIR}/opengl/xorg-x11/include/${file}
124 + ln -s ${PREFIX}/${LIBDIR}/opengl/xorg/include/${file}
125 fi
126 done
127 popd &> /dev/null
128 @@ -323,9 +317,9 @@
129 echo "LDPATH=\"${ldpath}\"" > ${ENV_D}
130 echo "OPENGL_PROFILE=\"${GL_IMPLEM}\"" >> ${ENV_D}
131
132 - env-update
133 + env-rebuild
134
135 - eend 0
136 + return 0
137 }
138
139 ## START PROGRAM ##
140 @@ -338,7 +332,7 @@
141 AVAIL_IMPLEMS=$(get_implementations)
142 CURRENT_GL_IMPLEM=$(get_current_implem)
143 USE_PROFILE_HEADERS="no"
144 -VERSION="2.2.1"
145 +VERSION="2.2.4"
146
147 parse_options ${@}
148