|
|
| |
local libdir | local libdir |
for libdir in $(list_libdirs); do | for libdir in $(list_libdirs); do |
# Special case handling of lib32 because it can be a symlink to |
# Don't pass the same directory twice if we're using a profile with the symlink hack |
# emul libs |
[[ -d ${PREFIX}/${libdir}/opengl && ! -h ${PREFIX}/${libdir} ]] || continue |
# Kill this special case once amd64's 2004.3 crap is gone =) --eradicator |
|
if [[ ${libdir} = "lib32" ]] ; then |
|
[[ -d ${PREFIX}/${libdir}/opengl ]] || continue |
|
else |
|
[[ -d ${PREFIX}/${libdir}/opengl && ! -h ${PREFIX}/${libdir} ]] || continue |
|
fi |
|
| |
# Fallback on xorg-x11 if we don't have this implementation for this libdir. | # Fallback on xorg-x11 if we don't have this implementation for this libdir. |
local gl_local | local gl_local |
|
|
popd &> /dev/null | popd &> /dev/null |
fi | fi |
| |
# Setup the includes |
# Setup the $LDPATH |
mkdir -p "${DST_PREFIX}/include/GL" || die "Failed to create ${DST_PREFIX}/include/GL" |
ldpath="${ldpath:+${ldpath}:}${PREFIX}/${libdir}/opengl/${gl_local}/lib" |
pushd "${DST_PREFIX}/include/GL" &> /dev/null |
|
for file in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h; do |
|
# IMPORTANT |
|
# It is preferable currently to use the standard glext.h file |
|
# however if an OpenGL provider must use a self produced glext.h |
|
# then it should be installed to ${gl_implem}/include and the user |
|
# can add the --impl-headers option to select it. |
|
|
|
if [[ "${USE_PROFILE_HEADERS}" == "yes" ]] ; then |
|
# Check the profile first. |
|
if [[ -e ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} ]] ; then |
|
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
|
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
|
fi |
|
|
|
ln -s ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
|
continue |
|
fi |
|
fi |
|
| |
if [[ -e ${PREFIX}/${libdir}/opengl/global/include/${file} ]] ; then |
done |
|
|
|
# Determine native/default libdir |
|
local abi=$(portageq envvar DEFAULT_ABI) |
|
local default_libdir |
|
if [ -z ${abi} ] ; then |
|
default_libdir="lib" |
|
else |
|
default_libdir=$(portageq envvar LIBDIR_${abi}) |
|
fi |
|
|
|
# Setup the includes |
|
# Only want to do this once, for the default libdir |
|
mkdir -p "${DST_PREFIX}/include/GL" || die "Failed to create ${DST_PREFIX}/include/GL" |
|
pushd "${DST_PREFIX}/include/GL" &> /dev/null |
|
for file in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h; do |
|
# IMPORTANT |
|
# It is preferable currently to use the standard glext.h file |
|
# however if an OpenGL provider must use a self produced glext.h |
|
# then it should be installed to ${gl_implem}/include and the user |
|
# can add the --impl-headers option to select it. |
|
|
|
if [[ "${USE_PROFILE_HEADERS}" == "yes" ]] ; then |
|
# Check the profile first. |
|
if [[ -e ${PREFIX}/${default_libdir}/opengl/${gl_implem}/include/${file} ]] ; then |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then | if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" | rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
fi | fi |
| |
ln -s ${PREFIX}/${libdir}/opengl/global/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
ln -s ${PREFIX}/${default_libdir}/opengl/${gl_implem}/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
elif [[ -e ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} ]] ; then |
continue |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
fi |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
fi |
fi |
|
| |
ln -s ${PREFIX}/${libdir}/opengl/${gl_implem}/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
if [[ -e ${PREFIX}/${default_libdir}/opengl/global/include/${file} ]] ; then |
elif [[ -e ${PREFIX}/${libdir}/opengl/xorg-x11/include/${file} ]] ; then |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
fi |
fi |
|
| |
ln -s ${PREFIX}/${libdir}/opengl/xorg-x11/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
ln -s ${PREFIX}/${default_libdir}/opengl/global/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
|
elif [[ -e ${PREFIX}/${default_libdir}/opengl/${gl_implem}/include/${file} ]] ; then |
|
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
|
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
fi | fi |
done |
|
popd &> /dev/null |
|
| |
# Setup the $LDPATH |
ln -s ${PREFIX}/${default_libdir}/opengl/${gl_implem}/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
ldpath="${ldpath:+${ldpath}:}${PREFIX}/${libdir}/opengl/${gl_local}/lib" |
elif [[ -e ${PREFIX}/${default_libdir}/opengl/xorg-x11/include/${file} ]] ; then |
|
if [[ -f ${file} || ( -L ${file} && ! -e ${file} ) ]] ; then |
|
rm -f "${file}" || die -q "Failed to delete ${DST_PREFIX}/include/GL/$(basename "${file}")" |
|
fi |
| |
done |
ln -s ${PREFIX}/${default_libdir}/opengl/xorg-x11/include/${file} || die -q "Failed to create ${DST_PREFIX}/include/GL/$(basename "${file}")" |
|
fi |
|
done |
|
popd &> /dev/null |
| |
store_config ${ENV_FILE} LDPATH "${ldpath}" | store_config ${ENV_FILE} LDPATH "${ldpath}" |
store_config ${ENV_FILE} OPENGL_PROFILE "${gl_implem}" | store_config ${ENV_FILE} OPENGL_PROFILE "${gl_implem}" |