Lines 113-126
Link Here
|
113 |
|
113 |
|
114 |
local libdir |
114 |
local libdir |
115 |
for libdir in $(list_libdirs); do |
115 |
for libdir in $(list_libdirs); do |
116 |
# Special case handling of lib32 because it can be a symlink to |
116 |
# Don't pass the same directory twice if we're using a profile with the symlink hack |
117 |
# emul libs |
117 |
[[ -d ${PREFIX}/${libdir}/opengl && ! -h ${PREFIX}/${libdir} ]] || continue |
118 |
# Kill this special case once amd64's 2004.3 crap is gone =) --eradicator |
|
|
119 |
if [[ ${libdir} = "lib32" ]] ; then |
120 |
[[ -d ${PREFIX}/${libdir}/opengl ]] || continue |
121 |
else |
122 |
[[ -d ${PREFIX}/${libdir}/opengl && ! -h ${PREFIX}/${libdir} ]] || continue |
123 |
fi |
124 |
|
118 |
|
125 |
# Fallback on xorg-x11 if we don't have this implementation for this libdir. |
119 |
# Fallback on xorg-x11 if we don't have this implementation for this libdir. |
126 |
local gl_local |
120 |
local gl_local |
Lines 169-222
Link Here
|
169 |
popd &> /dev/null |
163 |
popd &> /dev/null |
170 |
fi |
164 |
fi |
171 |
|
165 |
|
172 |
# Setup the includes |
166 |
# Setup the $LDPATH |
173 |
mkdir -p "${DST_PREFIX}/include/GL" || die "Failed to create ${DST_PREFIX}/include/GL" |
167 |
ldpath="${ldpath:+${ldpath}:}${PREFIX}/${libdir}/opengl/${gl_local}/lib" |
174 |
pushd "${DST_PREFIX}/include/GL" &> /dev/null |
|
|
175 |
for file in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h; do |
176 |
# IMPORTANT |
177 |
# It is preferable currently to use the standard glext.h file |
178 |
# however if an OpenGL provider must use a self produced glext.h |
179 |
# then it should be installed to ${gl_implem}/include and the user |
180 |
# can add the --impl-headers option to select it. |
181 |
|
182 |
if [[ "${USE_PROFILE_HEADERS}" == "yes" ]] ; then |
183 |
# Check the profile first. |
184 |
if [[ -e ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} ]] ; then |
185 |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
186 |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
187 |
fi |
188 |
|
189 |
ln -s ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
190 |
continue |
191 |
fi |
192 |
fi |
193 |
|
168 |
|
194 |
if [[ -e ${PREFIX}/${libdir}/opengl/global/include/${file} ]] ; then |
169 |
done |
|
|
170 |
|
171 |
# Determine native/default libdir |
172 |
local abi=$(portageq envvar DEFAULT_ABI) |
173 |
local default_libdir |
174 |
if [ -z ${abi} ] ; then |
175 |
default_libdir="lib" |
176 |
else |
177 |
default_libdir=$(portageq envvar LIBDIR_${abi}) |
178 |
fi |
179 |
|
180 |
# Setup the includes |
181 |
# Only want to do this once, for the default libdir |
182 |
mkdir -p "${DST_PREFIX}/include/GL" || die "Failed to create ${DST_PREFIX}/include/GL" |
183 |
pushd "${DST_PREFIX}/include/GL" &> /dev/null |
184 |
for file in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h; do |
185 |
# IMPORTANT |
186 |
# It is preferable currently to use the standard glext.h file |
187 |
# however if an OpenGL provider must use a self produced glext.h |
188 |
# then it should be installed to ${gl_implem}/include and the user |
189 |
# can add the --impl-headers option to select it. |
190 |
|
191 |
if [[ "${USE_PROFILE_HEADERS}" == "yes" ]] ; then |
192 |
# Check the profile first. |
193 |
if [[ -e ${PREFIX}/${default_libdir}/opengl/${gl_implem}/include/${file} ]] ; then |
195 |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
194 |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
196 |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
195 |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
197 |
fi |
196 |
fi |
198 |
|
197 |
|
199 |
ln -s ${PREFIX}/${libdir}/opengl/global/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
198 |
ln -s ${PREFIX}/${default_libdir}/opengl/${gl_implem}/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
200 |
elif [[ -e ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} ]] ; then |
199 |
continue |
201 |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
200 |
fi |
202 |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
201 |
fi |
203 |
fi |
|
|
204 |
|
202 |
|
205 |
ln -s ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
203 |
if [[ -e ${PREFIX}/${default_libdir}/opengl/global/include/${file} ]] ; then |
206 |
elif [[ -e ${PREFIX}/${libdir}/opengl/xorg-x11/include/${file} ]] ; then |
204 |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
207 |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
205 |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
208 |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
206 |
fi |
209 |
fi |
|
|
210 |
|
207 |
|
211 |
ln -s ${PREFIX}/${libdir}/opengl/xorg-x11/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
208 |
ln -s ${PREFIX}/${default_libdir}/opengl/global/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
|
|
209 |
elif [[ -e ${PREFIX}/${default_libdir}/opengl/${gl_implem}/include/${file} ]] ; then |
210 |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
211 |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
212 |
fi |
212 |
fi |
213 |
done |
|
|
214 |
popd &> /dev/null |
215 |
|
213 |
|
216 |
# Setup the $LDPATH |
214 |
ln -s ${PREFIX}/${default_libdir}/opengl/${gl_implem}/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
217 |
ldpath="${ldpath:+${ldpath}:}${PREFIX}/${libdir}/opengl/${gl_local}/lib" |
215 |
elif [[ -e ${PREFIX}/${default_libdir}/opengl/xorg-x11/include/${file} ]] ; then |
|
|
216 |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
217 |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
218 |
fi |
218 |
|
219 |
|
219 |
done |
220 |
ln -s ${PREFIX}/${default_libdir}/opengl/xorg-x11/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
|
|
221 |
fi |
222 |
done |
223 |
popd &> /dev/null |
220 |
|
224 |
|
221 |
store_config ${ENV_FILE} LDPATH "${ldpath}" |
225 |
store_config ${ENV_FILE} LDPATH "${ldpath}" |
222 |
store_config ${ENV_FILE} OPENGL_PROFILE "${gl_implem}" |
226 |
store_config ${ENV_FILE} OPENGL_PROFILE "${gl_implem}" |