about summary refs log tree commit diff
path: root/pkgs/tools/X11/bumblebee/config.patch
blob: 61b671f80c1ccddcb9a6e8b718c4e60874d4148e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- bumblebee-3.0/src/driver.c.orig	2012-02-03 14:51:10.282464426 +0100
+++ bumblebee-3.0/src/driver.c	2012-02-04 22:26:02.715498536 +0100
@@ -23,6 +23,7 @@
 #include "module.h"
 #include "bblogger.h"
 #include "driver.h"
+#include <stdlib.h>
 
 /**
  * Check what drivers are available and autodetect if possible. Driver, module
@@ -30,6 +31,7 @@
  */
 void driver_detect(void) {
   /* determine driver to be used */
+  set_string_value(&bb_config.driver, getenv("BUMBLEBEE_DRIVER"));
   if (*bb_config.driver) {
     bb_log(LOG_DEBUG, "Skipping auto-detection, using configured driver"
             " '%s'\n", bb_config.driver);
@@ -65,8 +67,8 @@
     }
   }
 
-  if (strcmp(bb_config.driver, "nvidia")) {
-    set_string_value(&bb_config.ld_path, CONF_LDPATH_NVIDIA);
-    set_string_value(&bb_config.mod_path, CONF_MODPATH_NVIDIA);
+  if (!strcmp(bb_config.driver, "nvidia")) {
+    set_string_value(&bb_config.ld_path, getenv("BUMBLEBEE_LDPATH_NVIDIA"));
+    set_string_value(&bb_config.mod_path, getenv("BUMBLEBEE_MODPATH_NVIDIA"));
   }
 }