nixpkgs/pkgs/tools/X11/bumblebee/config.patch

31 lines
1 KiB
Diff
Raw Normal View History

--- 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"));
}
}