aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Garlick <pgarlick@tourbillion-technology.com>2017-10-26 13:44:14 +0100
committerPaul Garlick <pgarlick@tourbillion-technology.com>2017-10-26 13:44:14 +0100
commitaebd364a771946e1a088cebff24a16a063bbfc3b (patch)
tree46df2a30b806fb88ec5389102ecf97078402cc9b
parent2978ce8a71e8f4b60248d18a17ce1de455bbb467 (diff)
downloadtweed-aebd364a771946e1a088cebff24a16a063bbfc3b.tar.gz
update Nix shell function for 3D graphics applications
-rw-r--r--INSTALL.md25
1 files changed, 9 insertions, 16 deletions
diff --git a/INSTALL.md b/INSTALL.md
index d268dc1..f0c3f25 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -98,24 +98,17 @@ install the *TWEED* packages, use the following command:
$ nix-env -f tweed.nix -i
-Nix applications that use 3D graphics acceleration need help in finding the
-system libraries and drivers. The paths vary according to operating system and
-graphics card. For a CentOS 6 system, for example, with an Intel graphics card
-six extra paths need to be defined. This can be accomplished with an alias or
-a shell function. Using the shell function approach for the CentOS example,
-the following lines added to the .bashrc file provide a function that sets the
-necessary environment variables and runs the FreeCAD application:
+It is necessary to set an extra environment variable for Nix applications that
+use 3D graphics acceleration. The extra variable defines the path to the
+directory in the Nix store that contains the graphics drivers. This can
+conveniently be accomplished with an alias or a shell function. Using the
+shell function approach, for the FreeCAD application, the following lines added
+to the ~/.bashrc file provide a function that sets the necessary environment
+variable and runs the application:
freecad () {
- FONTCONFIG_PATH="$HOME/.nix-profile/etc/fonts/fonts.conf" \
- LIBGL_DRIVERS_PATH="/usr/lib64/dri" \
- LIB1="/lib64/libselinux.so.1" \
- LIB2="$HOME/.nix-profile/lib/libdrm.so" \
- LIB3="$HOME/.nix-profile/lib/libdrm_intel.so" \
- LIB4="$HOME/.nix-profile/lib/libdrm_radeon.so" \
- LIB5="$HOME/.nix-profile/lib/libpciaccess.so.0" \
- LD_PRELOAD=$LIB1:$LIB2:$LIB3:$LIB4:$LIB5 \
- FreeCAD
+ LIBGL_DRIVERS_PATH=$(nix-build --no-out-link -A mesa_drivers $HOME/.nix-defexpr/channels/nixpkgs)/lib/dri \
+ $HOME/.nix-profile/bin/FreeCAD
}