nvidia-drivers-378.13.ebuild 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils flag-o-matic linux-info linux-mod multilib-minimal nvidia-driver \
  5. portability toolchain-funcs unpacker user udev
  6. NV_URI="http://us.download.nvidia.com/XFree86/"
  7. X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
  8. AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
  9. ARM_NV_PACKAGE="NVIDIA-Linux-armv7l-gnueabihf-${PV}"
  10. X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
  11. AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
  12. DESCRIPTION="NVIDIA Accelerated Graphics Driver"
  13. HOMEPAGE="http://www.nvidia.com/ http://www.nvidia.com/Download/Find.aspx"
  14. SRC_URI="
  15. amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
  16. amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
  17. arm? ( ${NV_URI}Linux-x86-ARM/${PV}/${ARM_NV_PACKAGE}.run )
  18. x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
  19. x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
  20. tools? (
  21. ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${PV}.tar.bz2
  22. )
  23. "
  24. LICENSE="GPL-2 NVIDIA-r2"
  25. SLOT="0/${PV%.*}"
  26. KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
  27. RESTRICT="bindist mirror"
  28. EMULTILIB_PKG="true"
  29. IUSE="acpi compat +driver gtk3 kernel_FreeBSD kernel_linux +kms multilib pax_kernel static-libs +tools uvm wayland +X"
  30. REQUIRED_USE="
  31. tools? ( X )
  32. static-libs? ( tools )
  33. "
  34. COMMON="
  35. app-eselect/eselect-opencl
  36. kernel_linux? ( >=sys-libs/glibc-2.6.1 )
  37. tools? (
  38. dev-libs/atk
  39. dev-libs/glib:2
  40. dev-libs/jansson
  41. gtk3? (
  42. x11-libs/gtk+:3
  43. )
  44. x11-libs/cairo
  45. x11-libs/gdk-pixbuf[X]
  46. x11-libs/gtk+:2
  47. x11-libs/libX11
  48. x11-libs/libXext
  49. x11-libs/libXrandr
  50. x11-libs/libXv
  51. x11-libs/libXxf86vm
  52. x11-libs/pango[X]
  53. )
  54. X? (
  55. >=app-eselect/eselect-opengl-1.0.9
  56. app-misc/pax-utils
  57. )
  58. "
  59. DEPEND="
  60. ${COMMON}
  61. kernel_linux? ( virtual/linux-sources )
  62. "
  63. RDEPEND="
  64. ${COMMON}
  65. acpi? ( sys-power/acpid )
  66. tools? ( !media-video/nvidia-settings )
  67. wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
  68. X? (
  69. <x11-base/xorg-server-1.19.99:=
  70. >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
  71. >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
  72. >=x11-libs/libvdpau-1.0[${MULTILIB_USEDEP}]
  73. sys-libs/zlib[${MULTILIB_USEDEP}]
  74. )
  75. "
  76. QA_PREBUILT="opt/* usr/lib*"
  77. S=${WORKDIR}/
  78. pkg_pretend() {
  79. if use amd64 && has_multilib_profile && \
  80. [ "${DEFAULT_ABI}" != "amd64" ]; then
  81. eerror "This ebuild doesn't currently support changing your default ABI"
  82. die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
  83. fi
  84. if use kernel_linux && kernel_is ge 4 10; then
  85. ewarn "Gentoo supports kernels which are supported by NVIDIA"
  86. ewarn "which are limited to the following kernels:"
  87. ewarn "<sys-kernel/gentoo-sources-4.10"
  88. ewarn "<sys-kernel/vanilla-sources-4.10"
  89. ewarn ""
  90. ewarn "You are free to utilize epatch_user to provide whatever"
  91. ewarn "support you feel is appropriate, but will not receive"
  92. ewarn "support as a result of those changes."
  93. ewarn ""
  94. ewarn "Do not file a bug report about this."
  95. ewarn ""
  96. fi
  97. # Since Nvidia ships many different series of drivers, we need to give the user
  98. # some kind of guidance as to what version they should install. This tries
  99. # to point the user in the right direction but can't be perfect. check
  100. # nvidia-driver.eclass
  101. nvidia-driver-check-warning
  102. # Kernel features/options to check for
  103. CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
  104. use x86 && CONFIG_CHECK+=" ~HIGHMEM"
  105. # Now do the above checks
  106. use kernel_linux && check_extra_config
  107. }
  108. pkg_setup() {
  109. # try to turn off distcc and ccache for people that have a problem with it
  110. export DISTCC_DISABLE=1
  111. export CCACHE_DISABLE=1
  112. if use driver && use kernel_linux; then
  113. MODULE_NAMES="nvidia(video:${S}/kernel)"
  114. use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel)"
  115. use kms && MODULE_NAMES+=" nvidia-modeset(video:${S}/kernel) nvidia-drm(video:${S}/kernel)"
  116. # This needs to run after MODULE_NAMES (so that the eclass checks
  117. # whether the kernel supports loadable modules) but before BUILD_PARAMS
  118. # is set (so that KV_DIR is populated).
  119. linux-mod_pkg_setup
  120. BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
  121. SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
  122. # linux-mod_src_compile calls set_arch_to_kernel, which
  123. # sets the ARCH to x86 but NVIDIA's wrapping Makefile
  124. # expects x86_64 or i386 and then converts it to x86
  125. # later on in the build process
  126. BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
  127. fi
  128. if use kernel_linux && kernel_is lt 2 6 9; then
  129. eerror "You must build this against 2.6.9 or higher kernels."
  130. fi
  131. # set variables to where files are in the package structure
  132. if use kernel_FreeBSD; then
  133. use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
  134. use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
  135. NV_DOC="${S}/doc"
  136. NV_OBJ="${S}/obj"
  137. NV_SRC="${S}/src"
  138. NV_MAN="${S}/x11/man"
  139. NV_X11="${S}/obj"
  140. NV_SOVER=1
  141. elif use kernel_linux; then
  142. NV_DOC="${S}"
  143. NV_OBJ="${S}"
  144. NV_SRC="${S}/kernel"
  145. NV_MAN="${S}"
  146. NV_X11="${S}"
  147. NV_SOVER=${PV}
  148. else
  149. die "Could not determine proper NVIDIA package"
  150. fi
  151. }
  152. src_prepare() {
  153. if use pax_kernel; then
  154. ewarn "Using PAX patches is not supported. You will be asked to"
  155. ewarn "use a standard kernel should you have issues. Should you"
  156. ewarn "need support with these patches, contact the PaX team."
  157. eapply "${FILESDIR}"/${PN}-375.20-pax.patch
  158. fi
  159. # Allow user patches so they can support RC kernels and whatever else
  160. eapply_user
  161. }
  162. src_compile() {
  163. # This is already the default on Linux, as there's no toplevel Makefile, but
  164. # on FreeBSD there's one and triggers the kernel module build, as we install
  165. # it by itself, pass this.
  166. cd "${NV_SRC}"
  167. if use kernel_FreeBSD; then
  168. MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
  169. LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
  170. elif use driver && use kernel_linux; then
  171. MAKEOPTS=-j1 linux-mod_src_compile
  172. fi
  173. if use tools; then
  174. emake -C "${S}"/nvidia-settings-${PV}/src \
  175. AR="$(tc-getAR)" \
  176. CC="$(tc-getCC)" \
  177. LIBDIR="$(get_libdir)" \
  178. NV_VERBOSE=1 \
  179. RANLIB="$(tc-getRANLIB)" \
  180. DO_STRIP= \
  181. build-xnvctrl
  182. emake -C "${S}"/nvidia-settings-${PV}/src \
  183. CC="$(tc-getCC)" \
  184. GTK3_AVAILABLE=$(usex gtk3 1 0) \
  185. LD="$(tc-getCC)" \
  186. LIBDIR="$(get_libdir)" \
  187. NVML_ENABLED=0 \
  188. NV_USE_BUNDLED_LIBJANSSON=0 \
  189. NV_VERBOSE=1 \
  190. DO_STRIP=
  191. fi
  192. }
  193. # Install nvidia library:
  194. # the first parameter is the library to install
  195. # the second parameter is the provided soversion
  196. # the third parameter is the target directory if it is not /usr/lib
  197. donvidia() {
  198. # Full path to library
  199. nv_LIB="${1}"
  200. # SOVER to use
  201. nv_SOVER="$(scanelf -qF'%S#F' ${nv_LIB})"
  202. # Where to install
  203. nv_DEST="${2}"
  204. # Get just the library name
  205. nv_LIBNAME=$(basename "${nv_LIB}")
  206. if [[ "${nv_DEST}" ]]; then
  207. exeinto ${nv_DEST}
  208. action="doexe"
  209. else
  210. nv_DEST="/usr/$(get_libdir)"
  211. action="dolib.so"
  212. fi
  213. # Install the library
  214. ${action} ${nv_LIB} || die "failed to install ${nv_LIBNAME}"
  215. # If the library has a SONAME and SONAME does not match the library name,
  216. # then we need to create a symlink
  217. if [[ ${nv_SOVER} ]] && ! [[ "${nv_SOVER}" = "${nv_LIBNAME}" ]]; then
  218. dosym ${nv_LIBNAME} ${nv_DEST}/${nv_SOVER} \
  219. || die "failed to create ${nv_DEST}/${nv_SOVER} symlink"
  220. fi
  221. dosym ${nv_LIBNAME} ${nv_DEST}/${nv_LIBNAME/.so*/.so} \
  222. || die "failed to create ${nv_LIBNAME/.so*/.so} symlink"
  223. }
  224. src_install() {
  225. if use driver && use kernel_linux; then
  226. linux-mod_src_install
  227. # Add the aliases
  228. # This file is tweaked with the appropriate video group in
  229. # pkg_preinst, see bug #491414
  230. insinto /etc/modprobe.d
  231. newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
  232. doins "${FILESDIR}"/nvidia-rmmod.conf
  233. # Ensures that our device nodes are created when not using X
  234. exeinto "$(get_udevdir)"
  235. newexe "${FILESDIR}"/nvidia-udev.sh-r1 nvidia-udev.sh
  236. udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
  237. elif use kernel_FreeBSD; then
  238. if use x86-fbsd; then
  239. insinto /boot/modules
  240. doins "${S}/src/nvidia.kld"
  241. fi
  242. exeinto /boot/modules
  243. doexe "${S}/src/nvidia.ko"
  244. fi
  245. # NVIDIA kernel <-> userspace driver config lib
  246. donvidia ${NV_OBJ}/libnvidia-cfg.so.${NV_SOVER}
  247. # NVIDIA framebuffer capture library
  248. donvidia ${NV_OBJ}/libnvidia-fbc.so.${NV_SOVER}
  249. # NVIDIA video encode/decode <-> CUDA
  250. if use kernel_linux; then
  251. donvidia ${NV_OBJ}/libnvcuvid.so.${NV_SOVER}
  252. donvidia ${NV_OBJ}/libnvidia-encode.so.${NV_SOVER}
  253. fi
  254. if use X; then
  255. # Xorg DDX driver
  256. insinto /usr/$(get_libdir)/xorg/modules/drivers
  257. doins ${NV_X11}/nvidia_drv.so
  258. # Xorg GLX driver
  259. donvidia ${NV_X11}/libglx.so.${NV_SOVER} \
  260. /usr/$(get_libdir)/opengl/nvidia/extensions
  261. # Xorg nvidia.conf
  262. if has_version '>=x11-base/xorg-server-1.16'; then
  263. insinto /usr/share/X11/xorg.conf.d
  264. newins {,50-}nvidia-drm-outputclass.conf
  265. fi
  266. insinto /usr/share/glvnd/egl_vendor.d
  267. doins ${NV_X11}/10_nvidia.json
  268. fi
  269. if use wayland; then
  270. insinto /usr/share/egl/egl_external_platform.d
  271. doins ${NV_X11}/10_nvidia_wayland.json
  272. fi
  273. # OpenCL ICD for NVIDIA
  274. if use kernel_linux; then
  275. insinto /etc/OpenCL/vendors
  276. doins ${NV_OBJ}/nvidia.icd
  277. fi
  278. # Documentation
  279. if use kernel_FreeBSD; then
  280. dodoc "${NV_DOC}/README"
  281. use X && doman "${NV_MAN}/nvidia-xconfig.1"
  282. use tools && doman "${NV_MAN}/nvidia-settings.1"
  283. else
  284. # Docs
  285. newdoc "${NV_DOC}/README.txt" README
  286. dodoc "${NV_DOC}/NVIDIA_Changelog"
  287. doman "${NV_MAN}/nvidia-smi.1.gz"
  288. use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
  289. use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
  290. doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
  291. fi
  292. docinto html
  293. dodoc -r ${NV_DOC}/html/*
  294. # Helper Apps
  295. exeinto /opt/bin/
  296. if use X; then
  297. doexe ${NV_OBJ}/nvidia-xconfig
  298. insinto /etc/vulkan/icd.d
  299. doins nvidia_icd.json
  300. fi
  301. if use kernel_linux; then
  302. doexe ${NV_OBJ}/nvidia-cuda-mps-control
  303. doexe ${NV_OBJ}/nvidia-cuda-mps-server
  304. doexe ${NV_OBJ}/nvidia-debugdump
  305. doexe ${NV_OBJ}/nvidia-persistenced
  306. doexe ${NV_OBJ}/nvidia-smi
  307. # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
  308. doexe ${NV_OBJ}/nvidia-modprobe
  309. fowners root:video /opt/bin/nvidia-modprobe
  310. fperms 4710 /opt/bin/nvidia-modprobe
  311. dosym /{opt,usr}/bin/nvidia-modprobe
  312. doman nvidia-cuda-mps-control.1.gz
  313. doman nvidia-modprobe.1.gz
  314. doman nvidia-persistenced.1.gz
  315. newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
  316. newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
  317. newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
  318. fi
  319. if use tools; then
  320. emake -C "${S}"/nvidia-settings-${PV}/src/ \
  321. DESTDIR="${D}" \
  322. GTK3_AVAILABLE=$(usex gtk3 1 0) \
  323. LIBDIR="${D}/usr/$(get_libdir)" \
  324. NV_USE_BUNDLED_LIBJANSSON=0 \
  325. NV_VERBOSE=1 \
  326. PREFIX=/usr \
  327. DO_STRIP= \
  328. install
  329. if use static-libs; then
  330. dolib.a "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/libXNVCtrl.a
  331. insinto /usr/include/NVCtrl
  332. doins "${S}"/nvidia-settings-${PV}/src/libXNVCtrl/*.h
  333. fi
  334. insinto /usr/share/nvidia/
  335. doins nvidia-application-profiles-${PV}-key-documentation
  336. insinto /etc/nvidia
  337. newins \
  338. nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
  339. # There is no icon in the FreeBSD tarball.
  340. use kernel_FreeBSD || \
  341. doicon ${NV_OBJ}/nvidia-settings.png
  342. domenu "${FILESDIR}"/nvidia-settings.desktop
  343. exeinto /etc/X11/xinit/xinitrc.d
  344. newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings
  345. fi
  346. dobin ${NV_OBJ}/nvidia-bug-report.sh
  347. if has_multilib_profile && use multilib; then
  348. local OABI=${ABI}
  349. for ABI in $(get_install_abis); do
  350. src_install-libs
  351. done
  352. ABI=${OABI}
  353. unset OABI
  354. else
  355. src_install-libs
  356. fi
  357. is_final_abi || die "failed to iterate through all ABIs"
  358. readme.gentoo_create_doc
  359. }
  360. src_install-libs() {
  361. local inslibdir=$(get_libdir)
  362. local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
  363. local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
  364. local libdir=${NV_OBJ}
  365. if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
  366. libdir=${NV_OBJ}/32
  367. fi
  368. if use X; then
  369. NV_GLX_LIBRARIES=(
  370. "libEGL.so.$(usex compat ${NV_SOVER} 1) ${GL_ROOT}"
  371. "libEGL_nvidia.so.${NV_SOVER} ${GL_ROOT}"
  372. "libGL.so.$(usex compat ${NV_SOVER} 1.0.0) ${GL_ROOT}"
  373. "libGLESv1_CM.so.1 ${GL_ROOT}"
  374. "libGLESv1_CM_nvidia.so.${NV_SOVER} ${GL_ROOT}"
  375. "libGLESv2.so.2 ${GL_ROOT}"
  376. "libGLESv2_nvidia.so.${NV_SOVER} ${GL_ROOT}"
  377. "libGLX.so.0 ${GL_ROOT}"
  378. "libGLX_nvidia.so.${NV_SOVER} ${GL_ROOT}"
  379. "libGLdispatch.so.0 ${GL_ROOT}"
  380. "libOpenCL.so.1.0.0 ${CL_ROOT}"
  381. "libOpenGL.so.0 ${GL_ROOT}"
  382. "libcuda.so.${NV_SOVER}"
  383. "libnvcuvid.so.${NV_SOVER}"
  384. "libnvidia-compiler.so.${NV_SOVER}"
  385. "libnvidia-eglcore.so.${NV_SOVER}"
  386. "libnvidia-encode.so.${NV_SOVER}"
  387. "libnvidia-fatbinaryloader.so.${NV_SOVER}"
  388. "libnvidia-fbc.so.${NV_SOVER}"
  389. "libnvidia-glcore.so.${NV_SOVER}"
  390. "libnvidia-glsi.so.${NV_SOVER}"
  391. "libnvidia-ifr.so.${NV_SOVER}"
  392. "libnvidia-opencl.so.${NV_SOVER}"
  393. "libnvidia-ptxjitcompiler.so.${NV_SOVER}"
  394. "libvdpau_nvidia.so.${NV_SOVER}"
  395. )
  396. if use wayland && has_multilib_profile && [[ ${ABI} == "amd64" ]];
  397. then
  398. NV_GLX_LIBRARIES+=(
  399. "libnvidia-egl-wayland.so.1.0.1"
  400. )
  401. fi
  402. if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
  403. then
  404. NV_GLX_LIBRARIES+=(
  405. "libnvidia-wfb.so.${NV_SOVER}"
  406. )
  407. fi
  408. if use kernel_FreeBSD; then
  409. NV_GLX_LIBRARIES+=(
  410. "libnvidia-tls.so.${NV_SOVER}"
  411. )
  412. fi
  413. if use kernel_linux; then
  414. NV_GLX_LIBRARIES+=(
  415. "libnvidia-ml.so.${NV_SOVER}"
  416. "tls/libnvidia-tls.so.${NV_SOVER}"
  417. )
  418. fi
  419. for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
  420. donvidia ${libdir}/${NV_LIB}
  421. done
  422. fi
  423. }
  424. pkg_preinst() {
  425. if use driver && use kernel_linux; then
  426. linux-mod_pkg_preinst
  427. local videogroup="$(egetent group video | cut -d ':' -f 3)"
  428. if [ -z "${videogroup}" ]; then
  429. eerror "Failed to determine the video group gid"
  430. die "Failed to determine the video group gid"
  431. else
  432. sed -i \
  433. -e "s:PACKAGE:${PF}:g" \
  434. -e "s:VIDEOGID:${videogroup}:" \
  435. "${D}"/etc/modprobe.d/nvidia.conf || die
  436. fi
  437. fi
  438. # Clean the dynamic libGL stuff's home to ensure
  439. # we dont have stale libs floating around
  440. if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
  441. rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
  442. fi
  443. # Make sure we nuke the old nvidia-glx's env.d file
  444. if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
  445. rm -f "${ROOT}"/etc/env.d/09nvidia
  446. fi
  447. }
  448. pkg_postinst() {
  449. use driver && use kernel_linux && linux-mod_pkg_postinst
  450. # Switch to the nvidia implementation
  451. use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
  452. "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
  453. readme.gentoo_print_elog
  454. if ! use X; then
  455. elog "You have elected to not install the X.org driver. Along with"
  456. elog "this the OpenGL libraries and VDPAU libraries were not"
  457. elog "installed. Additionally, once the driver is loaded your card"
  458. elog "and fan will run at max speed which may not be desirable."
  459. elog "Use the 'nvidia-smi' init script to have your card and fan"
  460. elog "speed scale appropriately."
  461. elog
  462. fi
  463. if ! use tools; then
  464. elog "USE=tools controls whether the nvidia-settings application"
  465. elog "is installed. If you would like to use it, enable that"
  466. elog "flag and re-emerge this ebuild. Optionally you can install"
  467. elog "media-video/nvidia-settings"
  468. elog
  469. fi
  470. }
  471. pkg_prerm() {
  472. use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
  473. }
  474. pkg_postrm() {
  475. use driver && use kernel_linux && linux-mod_pkg_postrm
  476. use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
  477. }