diff options
Diffstat (limited to 'app-eselect/eselect-xvmc')
-rw-r--r-- | app-eselect/eselect-xvmc/Manifest | 5 | ||||
-rw-r--r-- | app-eselect/eselect-xvmc/eselect-xvmc-0.4.ebuild | 23 | ||||
-rw-r--r-- | app-eselect/eselect-xvmc/files/eselect-xvmc-0.4.eselect | 198 | ||||
-rw-r--r-- | app-eselect/eselect-xvmc/metadata.xml | 11 |
4 files changed, 237 insertions, 0 deletions
diff --git a/app-eselect/eselect-xvmc/Manifest b/app-eselect/eselect-xvmc/Manifest new file mode 100644 index 000000000000..c83d2ed18d94 --- /dev/null +++ b/app-eselect/eselect-xvmc/Manifest @@ -0,0 +1,5 @@ +AUX eselect-xvmc-0.4.eselect 4169 SHA256 8cdcac909f65a4980bd28bf410fb1747177de4e1d46c46d3569eb754e0b31d52 SHA512 d86d80b931d2aa6c085accf9a647745cffd56b496728162b1084eba2fbde981ac17d3d3758cef993427b4236330fcc21bf2fc52d2b50249764a65fc508121135 WHIRLPOOL 7fa5ae1c75108463e1897e03184941f8e0d26d213d5830af7233991566318e01ff82b7ad389f9d3800a9eeb0564fc707d84c3d4a9119e70a5860d1f359280ef4 +EBUILD eselect-xvmc-0.4.ebuild 563 SHA256 373cd37b0b6c32c0a52d2178feab100b1782d8abc371229c0e66e1d5aa16ebdc SHA512 9dc057d497eb906ab84e8a3037b4da3c065fc21dd290467f42bdb4a6dae835c071e8b45aca20293259c631491256e0809d41b172fd97aab23b558e63ab940193 WHIRLPOOL f4b4dcd51162f92eea5e08d7083e7863936627e9fc64991b8a13f885e4ee050c5ab31a8fb815d8b236c01f1b57fbaf4f65f95b8f233c3545b1a963932f8cbebd +MISC ChangeLog 2926 SHA256 abdf258045515710cfe51bc65da10ae1376cb8a6185e183c2e12fad037c7e057 SHA512 b3eae28123a6841f7f6f4cf431085c19a20c352f218485c9df10ce22c52375e6b30b1d451c2cc295bbba941973119b3bd0c553b6ca23f0c2926df7d129c0a011 WHIRLPOOL 5f1241eab21437397cacdd7498c4610682ff7f246e8452d53dac9af095d1233b39bdb6366b136a4c56c22dfddc60a8b88a8755cdeca59bc2c41a48156b475a4b +MISC ChangeLog-2015 5373 SHA256 626f150bf4b64777bf700957fb2c8de1dfb13b8e34fa187842589e0cd468411a SHA512 b29551b78dc195f2deb9cb95a039e9cdcaae0387f12f008fd1a5765ee067dacbd2f155abc9539ea584749959ab047c0b81e0a1ebc2dee9a5ac13364b02794816 WHIRLPOOL a00fdc949019e30373bd459dcf85e3eaec1684faac253342c44e3ad6ca9589170dd9255be54b3525c2b30c13b6e2933feec9f2c3a74ad46eeed35bac171103f8 +MISC metadata.xml 331 SHA256 33c6cb6cf537bbaf1472f1e9817025bb0622a1167c350defb923af5a7300d3bd SHA512 f4c7dc245325bf6b4b37c893183e3dd9c43c9f05046e231f31f7fcfce8ee9e4108c0f4aa231b7d8f0fb4206fdb80186cd54dfe03ea7a037f6a5d4a61cf3b0d0b WHIRLPOOL 2a1083c744e915ccb3e24f9a26f5c355477b66469f085fe20a53af30dd69db2ed1ca8b41494c0c4443a2625199d2702639010c1a69c7ae051e427bc5fd6d0c13 diff --git a/app-eselect/eselect-xvmc/eselect-xvmc-0.4.ebuild b/app-eselect/eselect-xvmc/eselect-xvmc-0.4.ebuild new file mode 100644 index 000000000000..36648b5744f4 --- /dev/null +++ b/app-eselect/eselect-xvmc/eselect-xvmc-0.4.ebuild @@ -0,0 +1,23 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +DESCRIPTION="Manages XvMC implementations" +HOMEPAGE="https://www.gentoo.org/" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-solaris" +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-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 000000000000..9c06d5ec4e64 --- /dev/null +++ b/app-eselect/eselect-xvmc/files/eselect-xvmc-0.4.eselect @@ -0,0 +1,198 @@ +# -*-eselect-*- vim: ft=eselect +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +DESCRIPTION="Manage the XvMC implementation used by your system" +MAINTAINER="{cardoe,junghans}@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-eselect/eselect-xvmc/metadata.xml b/app-eselect/eselect-xvmc/metadata.xml new file mode 100644 index 000000000000..10bc494a7e79 --- /dev/null +++ b/app-eselect/eselect-xvmc/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>junghans@gentoo.org</email> + <name>Christoph Junghans</name> + </maintainer> + <maintainer type="person"> + <email>cardoe@gentoo.org</email> + </maintainer> +</pkgmetadata> |