Difference between pages "GNOME First Steps" and "Package:Eselect (OpenGL)"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
m
 
(describe 1.3* and the issues)
 
Line 1: Line 1:
=== What is GNOME? ===
{{Ebuild
|Summary=A Gentoo/Funtoo utility that allows the active OpenGL implementation on a system to be switched between a variety of installed options.
|CatPkg=app-admin/eselect-opengl
|Maintainer=
}}
== Introduction ==


"GNOME 3 is an easy and elegant way to use your computer. It is designed to put you in control and bring freedom to everybody. GNOME 3 is developed by the GNOME community, a diverse, international group of contributors that is supported by an independent, non-profit foundation." — [http://gnome.org GNOME]
Eselect (OpenGL) (also called <tt>eselect-opengl</tt>) is a module for [[Package:Eselect|Eselect]] that allows the OpenGL implementation on a Funtoo Linux or Gentoo Linux system to be switched between a variety of installed OpenGL implementations. It functions by creating an <tt>env.d</tt> file at <tt>/etc/env.d/03opengl</tt> which contains OpenGL settings, as well as managing symbolic links to OpenGL libraries and headers.  


=== Prerequisites ===
=== Sample env.d File ===


==== From a Clean Install ====
A sample <tt>env.d</tt> file for a multilib system with xorg-x11 OpenGL implementation may look like this:


Ensure that the [[X Window System]] is installed.
{{file|name=/etc/env.d/03opengl|desc=An example env.d file for eselect-opengl|body=
# Configuration file for eselect
# This file has been automatically generated.
LDPATH="/usr/lib32/opengl/xorg-x11/lib:/usr/lib64/opengl/xorg-x11/lib"
OPENGL_PROFILE="xorg-x11"
}}


=== Preparing to emerge ===
== Implementation ==


To get your system ready to emerge gnome, it is recommended that you first set the gnome profile mix-in. To accomplish this, do the following:
Eselect-opengl is implemented as a single bash-based [[Package:Eselect|Eselect]] module approximately 10K in size, installed at <tt>/usr/share/eselect/modules/opengl.eselect</tt>. One interfaces with this module via the main <tt>eselect</tt> command:


<console>
<console>
##r### ##b## eselect profile add funtoo/1.0/linux-gnu/mix-ins/gnome
# ##i##eselect opengl help
</console>
Manage the OpenGL implementation used by your system
By enabling the gnome mix-in, various USE and other settings will be optimized to provide you with a pain-free GNOME installation experience.
Usage: eselect opengl <action> <options>
 
=== Emerging ===
 
You are provided with two packages that will pull in this desktop environment:
 
* ''gnome''
 
{{fancynote|This is the "whole shabang" - pulls in a range of applications made for the gnome desktop environment including a few games, an archive manager, a system monitor, a web browser, a terminal, etc.}}
 
* ''gnome-light''
 
{{fancynote|As the name implies, this pulls in the base minimal you need to get a functioning GNOME Desktop Environment.}}
 
==== GNOME 3.14 from a clean install ====
 
===== gnome =====
 
To emerge ''gnome'' run the following command
 
<console>
# ##i## emerge gnome
</console>
 
===== gnome-light =====


To emerge ''gnome-light'' run the following command
##g##Standard actions:
  help                      Display help text
  usage                    Display usage information
  version                  Display version information


<console>
##g##Extra actions:
# ##i## emerge gnome-light
  list                      List the available OpenGL implementations.
  set <target>              Select the OpenGL implementation.
    <target>                  The profile to activate
    --use-old                If an implementation is already set, use that one instead
    --prefix=<val>            Set the source prefix (default: /usr)
    --dst-prefix=<val>        Set the destination prefix (default: /usr)
    --ignore-missing          Ignore missing files when setting a new implementation
  show                      Print the current OpenGL implementation.
</console>
</console>


==== Upgrading from GNOME 3.12 ====
== What is Switched ==
 
To update either ''gnome'' or ''gnome-light'' run the following command:


<console>
Using <tt>eselect opengl set</tt> causes the following symbolic links to be updated to point to the files corresponding to the OpenGL implementation that you chose:  
# ##i## emerge -vauDN world
</console>
 
=== Subsystems ===
 
==== Bluetooth ====
 
For bluetooth support, ensure that:
 
# Bluetooth support is enabled in your kernel (using modules is fine).
# Your bluetooth hardware is turned on.
# Add the <code>bluetooth</code> startup script to the default runlevel, and start it.
 
This can be done as follows:
 
<console>
# ##i##rc-update add bluetooth default
# ##i##rc
</console>
 
Once this is done, you should now be able to navigate to ''Settings'' -> ''Bluetooth'' and turn bluetooth on. The icon next to devices should now animate and you should be able to discover and add devices such as keyboards.
 
{{Note|1=
Additional kernel drivers may need to be enabled for certain input devices. For example, for the bluetooth Apple Magic Trackpad, the following option must be enabled in your kernel:
 
{{kernelop|title=Device Drivers,HID support,HID bus support,Special HID drivers|desc=
<M> Apple Magic Mouse/Trackpad multi-touch support
}}}}
 
==== Printing ====
 
To enable printing support, add <code>cupsd</code> to the default runlevel:
 
<console>
# ##i##rc-update add cupsd default
# ##i##rc
</console>
 
You should now be able to navigate to ''Settings'' -> ''Printers'' and add printers to your system, and print.
 
==== Scanning ====
 
To enable scanning support, add your user account to the <code>lp</code> group. This will allow your user to access the USB scanner.
 
Then, <code>emerge xsane</code>, and run it. It should be able to access your scanner.
 
=== Finishing Touches ===
 
==== X ====
 
===== Setting up xdm (GUI log-in) =====
 
Typically, you will want to use <code>gdm</code>, the GNOME display manager, to log in to GNOME. This will allow you to log in graphically, rather than using the text console.
 
To enable gdm, edit <code>/etc/conf.d/xdm</code> and set <code>DISPLAYMANAGER</code> to <code>gdm</code> instead of <code>xdm</code>. Then, perform the following steps to add <code>xdm</code> to the default runlevel, and have it start automatically from now on when your system starts:
 
{{Note|Funtoo's <code>/etc/init.d/xdm</code> initscript has been modified to start the requisite services <code>dbus</code>, <code>openrc-settingsd</code> and <code>consolekit</code> prior to starting <code>gdm</code>.}}
 
<console>
# ##i## rc-update add xdm default
</console>
 
Then, if you want to start it now do:
 
<console>
# ##i##rc
</console>


But you should reboot to avoid having an open login terminal.
* ''Libraries'' (32-bit and 64-bit):
** <tt>/usr/lib(64)/libGL.so.*</tt>
** <tt>/usr/lib(64)/libEGL.so.*</tt>
** <tt>/usr/lib/(32|64|)/libGLESv1.so.*</tt>
** <tt>/usr/lib/(32|64|)/libGLESv2.so.*</tt>
* ''C Headers'':
** <tt>/usr/include/GL/*</tt>
** <tt>/usr/include/EGL/*</tt>
** <tt>/usr/include/KHR/*</tt>
* <tt>/usr/lib(64|)/xorg/modules/extensions/libglx.so</tt>


===== Setting up xinitrc (text log-in) =====
The symbolic links point to an installed OpenGL implementation, stored inside <tt>/usr/lib(32|64|)/opengl/(implementation-name)</tt>. These files are structured as follows:


Adding the following to your <code>~/.xinitrc</code> file is sufficient:
* <tt>/usr/lib/opengl/(implementation-name)/lib</tt>
* <tt>/usr/lib/opengl/(implementation-name)/include/(GL|EGL|KHR)</tt>
* <tt>/usr/lib/opengl/(implementation-name)/extensions/libglx.so</tt>


<pre>
On multilib systems, ebuilds that provide an OpenGL implementation install 32-bit libraries in <tt>/usr/lib32/opengl/(implementation name)/lib</tt> and 64-bit libraries in <tt>/usr/lib64/opengl/(implementation name)/lib</tt>.
# Fix Missing Applications in Gnome
export XDG_MENU_PREFIX=gnome-


# Properly Launch the Desired X Session
== Criticisms ==
exec ck-launch-session gnome-session
</pre>


Additionaly, if you need support for different input sources, there is no longer a need to configure IBus or SCIM in your <code>.xinitrc</code> file as GNOME uses IBus natively. Simply configure it in the Control Center under Region & Language.
=== Violation of Build Consistency ===


=== Automatically Starting Applications at Login ===
As documented in {{Bug|FL-1309}}, sometimes packages fail to merge when the "wrong" eselect opengl implementation is selected. This violates Portage's ability to consistently build a package from source, assuming all its dependencies are satisfied. This could be classified as a design bug -- eselect-opengl is functioning as intended, but its underlying theory of operation is not correct.


When using an old-fashioned <code>.xinitrc</code>, starting up applications when X starts is relatively easy. When using GDM, this can still be accomplished, by using the <code>~/.xprofile</code> file. Here's my sample <code>.xprofile</code> to start <code>xflux</code> to dim the screen at night:
== eselect-opengl-1.3* experiment ==


<pre>
=== Introduction ===
xflux -z 87107
</pre>


{{Note|Remember to add a <code>&</code> at the end of any command that doesn't return to the shell prompt after running.}}
As a result of {{Bug|FL-1309}}, an experimental solution was implemented in eselect-opengl-1.3*. With this version, all packages are built unconditionally against xorg-x11 OpenGL implementation and the other implementations are used only in runtime.


=== games ===
The rationale for this design change is that:
Gnome has several games that can be added on to your install. By default most games are not included in gnome's emerge.
# There should be a consistent and repeatable build/linking process for all OpenGL applications.
# AMD and NVIDIA implementations of OpenGL are designed to be more of a "drop-in" runtime replacement for xorg-x11, rather than a standalone replacement for xorg-x11, and thus appear to exhibit more build-time bugs.


Users wishing to play games need to be added to the games group:
=== Implementation ===
{{console|body=###i## gpasswd -a $USER games}}


game list:
The new version of eselect-opengl switched two files:
;gnome-sudoku
* an env.d file <tt>000opengl</tt> specifying <tt>LDPATH</tt> for the run-time implementation override,
;gnome-mastermind
* an xorg.conf.d file overriding the ModulePath for custom glx xorg modules.
;gnome-nibbles
;gnome-robots
;gnome-chess
;gnome-hearts
;gnome-mahjongg
;gnome-mines
;gnome-klotski
;gnome-tetravex


game system emulators:
The env.d file has the same contents as the original one, except that the name was changed to ensure that the additional linker paths are added before the system paths where xorg-x11 libraries are installed.


;gnomeboyadvance
The xorg.conf.d sets ModulePaths for non-xorg module replacements (such as the nvidia glx module), if necessary.
;gnome-mud


=== Significant Known Issues (Workarounds Available) ===
=== Issues ===


[https://bugs.funtoo.org/browse/FL-1678 FL-1678]: Bluetooth interface gives wrong pairing key
The widespread testing of eselect-opengl-1.3* has proven some issues with the new design:


[https://bugs.funtoo.org/browse/FL-1687 FL-1687]: Wallpaper corruption when resuming from suspend
# xorg-server is unable to handle multiple occurences of <tt>Files</tt> section gracefully. Therefore, eselect-opengl's generated xorg.conf.d file collides with many user-defined configurations.
# There are rumors of arm mali's prioprietary OpenGL implementations requiring applications to be built against its own GLES headers.


[[Category:Desktop]]
{{EbuildFooter}}
[[Category:First Steps]]
[[Category:Official Documentation]]

Revision as of 11:26, January 18, 2015

Eselect (OpenGL)

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Introduction

Eselect (OpenGL) (also called eselect-opengl) is a module for Eselect that allows the OpenGL implementation on a Funtoo Linux or Gentoo Linux system to be switched between a variety of installed OpenGL implementations. It functions by creating an env.d file at /etc/env.d/03opengl which contains OpenGL settings, as well as managing symbolic links to OpenGL libraries and headers.

Sample env.d File

A sample env.d file for a multilib system with xorg-x11 OpenGL implementation may look like this:

   /etc/env.d/03opengl - An example env.d file for eselect-opengl
# Configuration file for eselect
# This file has been automatically generated.
LDPATH="/usr/lib32/opengl/xorg-x11/lib:/usr/lib64/opengl/xorg-x11/lib"
OPENGL_PROFILE="xorg-x11"

Implementation

Eselect-opengl is implemented as a single bash-based Eselect module approximately 10K in size, installed at /usr/share/eselect/modules/opengl.eselect. One interfaces with this module via the main eselect command:

root # eselect opengl help
Manage the OpenGL implementation used by your system
Usage: eselect opengl <action> <options>

root ##g##Standard actions:
  help                      Display help text
  usage                     Display usage information
  version                   Display version information

root ##g##Extra actions:
  list                      List the available OpenGL implementations.
  set <target>              Select the OpenGL implementation.
    <target>                  The profile to activate
    --use-old                 If an implementation is already set, use that one instead
    --prefix=<val>            Set the source prefix (default: /usr)
    --dst-prefix=<val>        Set the destination prefix (default: /usr)
    --ignore-missing          Ignore missing files when setting a new implementation
  show                      Print the current OpenGL implementation.

What is Switched

Using eselect opengl set causes the following symbolic links to be updated to point to the files corresponding to the OpenGL implementation that you chose:

  • Libraries (32-bit and 64-bit):
    • /usr/lib(64)/libGL.so.*
    • /usr/lib(64)/libEGL.so.*
    • /usr/lib/(32|64|)/libGLESv1.so.*
    • /usr/lib/(32|64|)/libGLESv2.so.*
  • C Headers:
    • /usr/include/GL/*
    • /usr/include/EGL/*
    • /usr/include/KHR/*
  • /usr/lib(64|)/xorg/modules/extensions/libglx.so

The symbolic links point to an installed OpenGL implementation, stored inside /usr/lib(32|64|)/opengl/(implementation-name). These files are structured as follows:

  • /usr/lib/opengl/(implementation-name)/lib
  • /usr/lib/opengl/(implementation-name)/include/(GL|EGL|KHR)
  • /usr/lib/opengl/(implementation-name)/extensions/libglx.so

On multilib systems, ebuilds that provide an OpenGL implementation install 32-bit libraries in /usr/lib32/opengl/(implementation name)/lib and 64-bit libraries in /usr/lib64/opengl/(implementation name)/lib.

Criticisms

Violation of Build Consistency

As documented in FL-1309, sometimes packages fail to merge when the "wrong" eselect opengl implementation is selected. This violates Portage's ability to consistently build a package from source, assuming all its dependencies are satisfied. This could be classified as a design bug -- eselect-opengl is functioning as intended, but its underlying theory of operation is not correct.

eselect-opengl-1.3* experiment

Introduction

As a result of FL-1309, an experimental solution was implemented in eselect-opengl-1.3*. With this version, all packages are built unconditionally against xorg-x11 OpenGL implementation and the other implementations are used only in runtime.

The rationale for this design change is that:

  1. There should be a consistent and repeatable build/linking process for all OpenGL applications.
  2. AMD and NVIDIA implementations of OpenGL are designed to be more of a "drop-in" runtime replacement for xorg-x11, rather than a standalone replacement for xorg-x11, and thus appear to exhibit more build-time bugs.

Implementation

The new version of eselect-opengl switched two files:

  • an env.d file 000opengl specifying LDPATH for the run-time implementation override,
  • an xorg.conf.d file overriding the ModulePath for custom glx xorg modules.

The env.d file has the same contents as the original one, except that the name was changed to ensure that the additional linker paths are added before the system paths where xorg-x11 libraries are installed.

The xorg.conf.d sets ModulePaths for non-xorg module replacements (such as the nvidia glx module), if necessary.

Issues

The widespread testing of eselect-opengl-1.3* has proven some issues with the new design:

  1. xorg-server is unable to handle multiple occurences of Files section gracefully. Therefore, eselect-opengl's generated xorg.conf.d file collides with many user-defined configurations.
  2. There are rumors of arm mali's prioprietary OpenGL implementations requiring applications to be built against its own GLES headers.