summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-eselect/eselect-xvmc/files/eselect-xvmc-0.4.eselect
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-eselect/eselect-xvmc/files/eselect-xvmc-0.4.eselect')
-rw-r--r--app-eselect/eselect-xvmc/files/eselect-xvmc-0.4.eselect198
1 files changed, 198 insertions, 0 deletions
diff --git a/app-eselect/eselect-xvmc/files/eselect-xvmc-0.4.eselect b/app-eselect/eselect-xvmc/files/eselect-xvmc-0.4.eselect
new file mode 100644
index 00000000000..2d6891fc00d
--- /dev/null
+++ b/app-eselect/eselect-xvmc/files/eselect-xvmc-0.4.eselect
@@ -0,0 +1,198 @@
+# -*-eselect-*- vim: ft=eselect
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESCRIPTION="Manage the XvMC implementation used by your system"
+MAINTAINER="{cardoe,ottxor}@gentoo.org"
+VERSION="0.4"
+
+init_XVMC_vars() {
+ get_libname() {
+ case ${OSTYPE} in
+ darwin*) echo ${1:+.}${1}.dylib ;;
+ *) echo .so${1:+.}${1} ;;
+ esac
+ }
+
+ XVMCLIBS=(
+ "libXvMCNVIDIA_dynamic$(get_libname 1)"
+ "libXvMC$(get_libname 1)"
+ "libviaXvMC$(get_libname 1)"
+ "libviaXvMCPro$(get_libname 1)"
+ "libchromeXvMC$(get_libname 1)"
+ "libchromeXvMCPro$(get_libname 1)"
+ "libXvMCVIA$(get_libname)"
+ "libXvMCVIAPro$(get_libname)"
+ "libI810XvMC$(get_libname 1)"
+ "/usr/lib/libIntelXvMC$(get_libname)"
+ "libAMDXvBA$(get_libname 1)"
+ )
+
+ XVMCPRETTY=(
+ "nvidia"
+ "xorg-x11"
+ "via"
+ "via-pro"
+ "openchrome"
+ "openchrome-pro"
+ "unichrome"
+ "unichrome-pro"
+ "intel-i810"
+ "intel-i915/i965"
+ "ati"
+ )
+}
+
+get_implementation_indices() {
+ local ret n
+ for (( n = 0; n < ${#XVMCLIBS[@]}; ++n )); do
+ [[ -e "${EROOT}/usr/lib/${XVMCLIBS[n]##*/}" ]] && ret+=($n)
+ done
+
+ echo ${ret[@]}
+}
+
+get_current_implementation_index() {
+ local n
+ if [[ -f "${EROOT}/etc/X11/XvMCConfig" ]]; then
+ local current=$(< "${EROOT}/etc/X11/XvMCConfig")
+ for (( n = 0; n < ${#XVMCLIBS[@]}; ++n )); do
+ if [[ "${XVMCLIBS[n]}" = "${current}" ]]; then
+ echo "${n}"
+ return
+ fi
+ done
+ fi
+
+ echo "-1"
+}
+
+set_new_implementation() {
+ echo -n "Switching to ${XVMCPRETTY[$1]} XvMC implementation..."
+ touch "${EROOT}/etc/X11/XvMCConfig" 2>&1 > /dev/null
+ if [[ $? -eq 0 ]]; then
+ echo "${XVMCLIBS[$1]}" > "${EROOT}/etc/X11/XvMCConfig"
+ chmod 644 "${EROOT}/etc/X11/XvMCConfig"
+ [[ ${EROOT} == "/" ]] && chown 0:0 "${EROOT}/etc/X11/XvMCConfig"
+ echo " done"
+ else
+ echo " failed!"
+ echo "Insufficient privileges"
+ fi
+}
+
+### list action
+
+## {{{ list stuff
+describe_list() {
+ echo "List Available XvMC implementations"
+}
+
+do_list() {
+ local output n
+ init_XVMC_vars
+ local avail=( $(get_implementation_indices) )
+ local current=$(get_current_implementation_index)
+ write_list_start \
+ "Available XvMC implementations ($(highlight '*') is current):"
+
+ for n in "${avail[@]}"; do
+ output[n]=${XVMCPRETTY[n]}
+ [[ ${current} -eq ${n} ]] \
+ && output[n]=$(highlight_marker "${output[n]}")
+ done
+ write_numbered_list -m "(none found)" "${output[@]}"
+
+ return 0
+}
+## }}}
+
+### show action
+
+## {{{ show stuff
+describe_show() {
+ echo "Print the current XvMC implementation."
+}
+
+do_show() {
+ init_XVMC_vars
+ local current=$(get_current_implementation_index)
+ write_list_start "Current XvMC implementation:"
+
+ if [[ ${current} -ne -1 ]]; then
+ echo "${XVMCPRETTY[current]}"
+ return 0
+ else
+ echo "(none)"
+ return 2
+ fi
+}
+## }}}
+
+### set action
+
+## {{{ set stuff
+describe_set() {
+ echo "Select the XvMC implementation"
+}
+
+describe_set_parameters() {
+ echo "<target>"
+}
+
+describe_set_options() {
+ echo "<target> : XvMC implementation to activate"
+ echo "--use-old : If an implementation is already set, use that one instead"
+}
+
+do_set() {
+ init_XVMC_vars
+ local current=$(get_current_implementation_index)
+ local avail=( $(get_implementation_indices) )
+ local n new action
+
+ while [[ ${#@} -gt 0 ]]; do
+ local opt=${1}
+ shift
+ case ${opt} in
+ --use-old)
+ if [[ ${current} -gt -1 ]]; then
+ (( ${current} < ${#XVMCPRETTY[@]} )) && action="old-implementation"
+ fi
+ ;;
+ *)
+ [[ -z ${action} ]] && action="set-implementation"
+
+ if is_number ${opt} ; then
+ new=${avail[opt - 1]}
+ if [[ -z ${new} ]]; then
+ die -q "Unrecognized option: ${opt}"
+ fi
+ elif has ${opt} ${XVMCPRETTY[@]}; then
+ for (( n = 0; n < ${#XVMCPRETTY[@]}; ++n )); do
+ [[ "${XVMCPRETTY[n]}" = "${opt}" ]] && new=${n}
+ done
+ else
+ die -q "Unrecognized option: ${opt}"
+ fi
+ ;;
+ esac
+ done
+
+ case ${action} in
+ old-implementation)
+ set_new_implementation ${current}
+ return $?
+ ;;
+ set-implementation)
+ if [[ -n ${new} ]]; then
+ set_new_implementation ${new}
+ return $?
+ else
+ die -q "Please specify an implementation to set"
+ fi
+ ;;
+ *)
+ die -q "Invalid usage of set action."
+ esac
+}