diff options
author | Christoph Junghans <ottxor@gentoo.org> | 2013-03-11 14:36:20 +0000 |
---|---|---|
committer | Christoph Junghans <ottxor@gentoo.org> | 2013-03-11 14:36:20 +0000 |
commit | eb29ee7a65037b0b2c95ab58d729277e342a7dab (patch) | |
tree | 64ba0a3d4b4fc443743f62d40c2f571d901051d3 /app-admin/eselect-xvmc | |
parent | sci-biology/allpathslg: Drop Andrey as maintainer so that bugs get assigned t... (diff) | |
download | gentoo-2-eb29ee7a65037b0b2c95ab58d729277e342a7dab.tar.gz gentoo-2-eb29ee7a65037b0b2c95ab58d729277e342a7dab.tar.bz2 gentoo-2-eb29ee7a65037b0b2c95ab58d729277e342a7dab.zip |
version bump (fixes bugs #393027, #292120 and #434518)
(Portage version: 2.2.0_alpha166/cvs/Linux x86_64, signed Manifest commit with key C2000586)
Diffstat (limited to 'app-admin/eselect-xvmc')
-rw-r--r-- | app-admin/eselect-xvmc/ChangeLog | 11 | ||||
-rw-r--r-- | app-admin/eselect-xvmc/eselect-xvmc-0.4.ebuild | 24 | ||||
-rw-r--r-- | app-admin/eselect-xvmc/files/eselect-xvmc-0.4.eselect | 198 | ||||
-rw-r--r-- | app-admin/eselect-xvmc/metadata.xml | 10 |
4 files changed, 237 insertions, 6 deletions
diff --git a/app-admin/eselect-xvmc/ChangeLog b/app-admin/eselect-xvmc/ChangeLog index 02388d6d0548..55086388c177 100644 --- a/app-admin/eselect-xvmc/ChangeLog +++ b/app-admin/eselect-xvmc/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-admin/eselect-xvmc -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-xvmc/ChangeLog,v 1.26 2012/08/27 17:33:27 armin76 Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-xvmc/ChangeLog,v 1.27 2013/03/11 14:36:20 ottxor Exp $ + +*eselect-xvmc-0.4 (11 Mar 2013) + + 11 Mar 2013; Christoph Junghans <ottxor@gentoo.org> +eselect-xvmc-0.4.ebuild, + +files/eselect-xvmc-0.4.eselect, metadata.xml: + version bump (fixes bugs #393027, #292120 and #434518) 27 Aug 2012; Raúl Porcel <armin76@gentoo.org> eselect-xvmc-0.3.ebuild: alpha/ia64/m68k/s390/sh/sparc stable wrt #424017 @@ -90,4 +96,3 @@ +files/eselect-xvmc-0.1.eselect, +metadata.xml, +eselect-xvmc-0.1.ebuild: Decided to write an eselect module for XvMCWrapper. First version. - diff --git a/app-admin/eselect-xvmc/eselect-xvmc-0.4.ebuild b/app-admin/eselect-xvmc/eselect-xvmc-0.4.ebuild new file mode 100644 index 000000000000..b54b45d9092c --- /dev/null +++ b/app-admin/eselect-xvmc/eselect-xvmc-0.4.ebuild @@ -0,0 +1,24 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-xvmc/eselect-xvmc-0.4.ebuild,v 1.1 2013/03/11 14:36:20 ottxor Exp $ + +EAPI=5 + +DESCRIPTION="Manages XvMC implementations" +HOMEPAGE="http://www.gentoo.org/" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" +IUSE="" + +DEPEND="" +RDEPEND="app-admin/eselect" + +S="${FILESDIR}" + +src_install() { + insinto /usr/share/eselect/modules + newins "${FILESDIR}"/${P}.eselect xvmc.eselect +} diff --git a/app-admin/eselect-xvmc/files/eselect-xvmc-0.4.eselect b/app-admin/eselect-xvmc/files/eselect-xvmc-0.4.eselect new file mode 100644 index 000000000000..eefd56675945 --- /dev/null +++ b/app-admin/eselect-xvmc/files/eselect-xvmc-0.4.eselect @@ -0,0 +1,198 @@ +# -*-eselect-*- vim: ft=eselect +# Copyright 1999-2013 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 +} diff --git a/app-admin/eselect-xvmc/metadata.xml b/app-admin/eselect-xvmc/metadata.xml index 877ed7af7da8..a0494aadf4b2 100644 --- a/app-admin/eselect-xvmc/metadata.xml +++ b/app-admin/eselect-xvmc/metadata.xml @@ -1,7 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> -<maintainer> - <email>cardoe@gentoo.org</email> -</maintainer> + <maintainer> + <email>ottxor@gentoo.org</email> + <name>Christoph Junghans</name> + </maintainer> + <maintainer> + <email>cardoe@gentoo.org</email> + </maintainer> </pkgmetadata> |