diff options
author | Jose Quinteiro <gentoo@quinteiro.org> | 2013-05-16 10:27:56 -0700 |
---|---|---|
committer | Jose Quinteiro <gentoo@quinteiro.org> | 2013-05-16 10:27:56 -0700 |
commit | de150409f0e280d36c63386cd34980dee7fdf2c0 (patch) | |
tree | 718492078f1d6fe2550406e92aaac808bc6c446c /x11-drivers | |
parent | Stabilize 0.2.10-r2. Add an ebuild for upcoming release 0.2.11. (diff) | |
download | JoseQ-de150409f0e280d36c63386cd34980dee7fdf2c0.tar.gz JoseQ-de150409f0e280d36c63386cd34980dee7fdf2c0.tar.bz2 JoseQ-de150409f0e280d36c63386cd34980dee7fdf2c0.zip |
Add an ebuild for nvidia-drivers-96.43.23 for kernel 3.7.*
See bug 447566:
https://bugs.gentoo.org/show_bug.cgi?id=447566
Diffstat (limited to 'x11-drivers')
3 files changed, 610 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest index aa17d9f..7ec882b 100644 --- a/x11-drivers/nvidia-drivers/Manifest +++ b/x11-drivers/nvidia-drivers/Manifest @@ -4,6 +4,7 @@ AUX NVIDIA_glx-defines.patch 437 SHA256 0007f3d962edb87da4788ce58869679c1b10f282 AUX NVIDIA_glx-glheader.patch 380 SHA256 f630e24067bf6199a64f8fe8c5d6fc158cb4b153bda65ffc3f97b36a9cb08faf SHA512 366ebbe967001f4d694e9d6ae61fbd8b57e2946bba495894936809634bb87bd6ba6b10689969977e4d0eaba6983c16fe8d78830112b5b28f01c78381a0a095d6 WHIRLPOOL 8609fcedb439299189d9d05606a290a63de8b207bab855f874faa36e892396f41159d26e505dfead89fdac9d7e61aeeb50b16877aa14ad62dc3cd617353d7d60 AUX nvidia-169.07 639 SHA256 a8c4860f008d53776fda7a17b59524f271236559af688e9a2c9845cbbcba1577 SHA512 3af295c026280dc3a2b73c2cc7772254686b09cad15f1333ab0b4de8cb0ccf78e725ced2a399b10edcf8af6ba42ab1485dc0661af67461b0c3789f786357772f WHIRLPOOL 626ae3c01c879e0cfe05bd373e0b9dfd6f462dd9ef6ae94a7d60276fe2d17c57fbb20aaa4d2a186a0ffc2a860076692aac854d00a3545bc9736e7bb8d0581055 AUX nvidia-drivers-96.43.23-linux-3.7.patch 4261 SHA256 85fbb713c84d928e3312d3770b8866e4fac65109cd71f2b28387f74ab6881d1e SHA512 6e44a45ffebb920f602aed61d3b98cfc5993cc0be12ba1d977689a4ec63bd1ea8796d688a00d69244d90226ccda3b11883d85a9ffe2f54f2d18a27d0655bd342 WHIRLPOOL a8fa37f165de265a8f177fdf7780b5c79fa1513bc4e69e34a3f3e7171490a3a90bd9e41613c7a8b695a5858f4d9ecc13e38b256ef23a7a9c29a578b9f72176e5 +AUX nvidia-drivers-96.43.23-linux-3.8.patch 4320 SHA256 d211f1919a149fd8c3e1c9f18f2b16aa421b423b55c11ea733636c1ea49f852d SHA512 d144601ab821282251997f30ba68629b54afb8bb48b49878517d49c80aa0d350b272408219bcc12aeb33ec5caecd1df1425fc42db020ee9448bf0df2d3e7bf5a WHIRLPOOL a10b8236090dbc7e94a275355d772f9801bedf37719b526f6fdc3f19913ab2ff08b1fab72132e056b361d676df1f8f5c6c39c2b9c744d38f89bf4dc9bf49dcf2 AUX nvidia-drivers-settings.desktop 193 SHA256 31c062449b8bcc8adcd3ee649d8aebf0bef502400bcbbbb46124217e1efb17a3 SHA512 fbb81d2520e9025fbffb2a8e7b3647f621ddc9d36c79d063d49e901286e8d1ea45de1274f42e33ff1aece5cebd547a42829d65b421db39d808947554b0f57453 WHIRLPOOL c797eb0ec1044ecaaa979ca5180f840d9c82c5c040dd81b2d86ca4afade9f0c006fb8951f04cc4d2b206110d38b339690386d291ff8f625a22b38178a3cd970b AUX nvidia-smi.init 671 SHA256 5776a661b510e072d34e779c23dfc710a13d04c49acc22772d2aeb0e415820d6 SHA512 f71bcdf2fcaf4aac69056a04f3e57c9f5e4d6c210fe571704d3f9a0798cc9615cd0560840ae336744f43563528db5b9a7b67730895eff438be330b13ab863ed6 WHIRLPOOL db48549b0d2b02d2f9ca6a86f38229dae67853939ac1c2147d5066b9b8958c2e0fb8539f70ddf5c92ae6ad642bb48ea8b1119d1779c80dd66bb450240fd0b40a AUX nvidia-udev.sh 185 SHA256 120c0af2b64fbcbd7032217a78eec8b104874c1ca68726367bce22c57944e07e SHA512 166df3a4e7c1862ca2e0f634bf5eed7aad1bdd7e55764ca42371b91a7077c59f0bc243de5616fd38dac9694159d1695d54fbd08ac89d4d3f3649c70c7db5977e WHIRLPOOL cb9995029cdb2fe1bc7fe5ae54041ee5de8da86bf5eb3616d062475e56c44d436e1e66683ecddd986fc5bca5723d88da4b1a42f65f3cd7e15636928bd21fce14 @@ -12,4 +13,5 @@ DIST NVIDIA-FreeBSD-x86-96.43.23.tar.gz 15463464 SHA256 18d855db8381eda1a6cf548c DIST NVIDIA-Linux-x86-96.43.23-pkg0.run 11504817 SHA256 51e6adf4ba73071622045fc37169f80db3ae3e784dff53b29d35146a04042142 SHA512 bed5726e57637481fe4e3c03a65ec14fe949f00860e729ebde408f4fd861d7bfdc296a78bc2f5d42e8b282db09f4bbde1e0545df7228fa20227080dc4b868ba7 WHIRLPOOL 6d4fd1786c11f4e326cc3101d0bb1a2f8b63c25c3dd59f10188f8355759e2861ce44fd53d60258b513d5a1d6124d0f91ba8edf4d3668b6feabfb3e8d585f14fe DIST NVIDIA-Linux-x86_64-96.43.23-pkg2.run 15962375 SHA256 ce8d8253e7dab7da63fbdac449ebf190cd0c10cbfffea0f8d0165515f851bc64 SHA512 04bec1187a6024a2b9839f008ec829281f1f2602dae2e639030bc385943186506bcaa2b46a230b2ab87f9217190841abc62f9e2d6395ab5559623389c31c6563 WHIRLPOOL 0651c44a51a1a06fcff5bfddbf9c3e408977e03263c7fe806cb6c01f9fe92f716dfe4e5190ffe1048bde72fcffdc8bca8267e74dd43ba5c9dfb22b6201fcc2bb EBUILD nvidia-drivers-96.43.23-r1.ebuild 15483 SHA256 a70fa23aa7ebffd3d75f7a2af8d4c712e6659b92914bb8fd53bd24434469e963 SHA512 0e9eea09d90c9a313becb73544a007241aebe7a6ea32c00ca6200b819690f9fd95e78a34ac293a6fbf77fdae0bfac09e3f9a4b8177242aa8a54d0cdcbf48b745 WHIRLPOOL 5a6e3f1318e4c0cc86f7e7c9116f636eb9d2829318f3afcc5fc02f76af0614b29521e2acdcc79ed354c7ab26ce03eb2957395412be475fc6b3b1b5eb531ad1f6 +EBUILD nvidia-drivers-96.43.23-r2.ebuild 15483 SHA256 e653c24fb830a6bafd898f93eca55c929409710a97a784d8f0b59c04817010c1 SHA512 549e7268ebc58cb3991798c2febcefd05d83ef009863d196734e62236bd7f92a98cdb46757e69f8f8a698ffc5c129d1b0f004ac538facde2942925c285982a11 WHIRLPOOL 117217afbcba47a25987638f73c7563348427c4b828ef51b870b1156d2d6992f7444f66f8edaaa0ae4e9487c70873c136777877800e08246fe453258e7e6f596 MISC metadata.xml 678 SHA256 02f45452a129ba14ad5ef0f6bf0031887aead328a7bfaa6977949bc6e8969e61 SHA512 dfc9494e01db7ee3e7ef64dc67c5e26b1a3b0c90ed2850f75c904a76a11df8b3cb137959fe471c788b7a33f555090a9c764af5cfff7f24253127484d4e518e84 WHIRLPOOL 2940677faa8b8183237d9797025079a68164584d2afd09b6e3846cdbbd5824f3c56da545b2f7d1c7d1e72746f540048e4256bde939a28ac785fa598ee2017abd diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-96.43.23-linux-3.8.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-96.43.23-linux-3.8.patch new file mode 100755 index 0000000..5766691 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-96.43.23-linux-3.8.patch @@ -0,0 +1,108 @@ +--- usr/src/nv/conftest.sh ++++ usr/src/nv/conftest.sh +@@ -127,6 +127,7 @@ + if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then + MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default" + MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default" ++ MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/arch/x86/include/uapi" + fi + if [ "$XEN_PRESENT" != "0" ]; then + MACH_CFLAGS="-I$HEADERS/asm-$ARCH/mach-xen $MACH_CFLAGS" +@@ -136,16 +137,23 @@ + if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then + MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default" + MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default" ++ MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/arch/x86/include/uapi" + fi + if [ "$XEN_PRESENT" != "0" ]; then + MACH_CFLAGS="-I$HEADERS/asm/mach-xen $MACH_CFLAGS" + fi + fi + +- CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS" ++ CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS $AUTOCONF_CFLAGS" ++ CFLAGS="$CFLAGS -I$HEADERS -I$HEADERS/uapi" + + if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then +- CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$OUTPUT/arch/x86/include/generated" ++ CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include" ++ CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include/uapi" ++ CFLAGS="$CFLAGS -I$OUTPUT/arch/x86/include/generated" ++ CFLAGS="$CFLAGS -I$OUTPUT/arch/x86/include/generated/uapi" ++ CFLAGS="$CFLAGS -I$OUTPUT/include/generated" ++ CFLAGS="$CFLAGS -I$OUTPUT/include/generated/uapi" + fi + if [ -n "$BUILD_PARAMS" ]; then + CFLAGS="$CFLAGS -D$BUILD_PARAMS" +@@ -936,8 +943,10 @@ + # Determine if the acpi_walk_namespace() function is present + # and how many arguments it takes. + # ++ for linux_or_acpi in linux acpi; do ++ + echo "$CONFTEST_PREAMBLE +- #include <acpi/acpi.h> ++ #include <${linux_or_acpi}/acpi.h> + void conftest_acpi_walk_namespace(void) { + acpi_walk_namespace(); + }" > conftest$$.c +@@ -952,7 +961,7 @@ + fi + + echo "$CONFTEST_PREAMBLE +- #include <acpi/acpi.h> ++ #include <${linux_or_acpi}/acpi.h> + void conftest_acpi_walk_namespace(void) { + acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL, NULL); + }" > conftest$$.c +@@ -968,7 +977,7 @@ + fi + + echo "$CONFTEST_PREAMBLE +- #include <acpi/acpi.h> ++ #include <${linux_or_acpi}/acpi.h> + void conftest_acpi_walk_namespace(void) { + acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL); + }" > conftest$$.c +@@ -981,9 +990,9 @@ + echo "#define NV_ACPI_WALK_NAMESPACE_PRESENT" >> conftest.h + echo "#define NV_ACPI_WALK_NAMESPACE_ARGUMENT_COUNT 6 " >> conftest.h + return +- else +- echo "#error acpi_walk_namespace() conftest failed!" >> conftest.h + fi ++ done ++ echo "#error acpi_walk_namespace() conftest failed!" >> conftest.h + ;; + + acpi_os_wait_events_complete) +@@ -1453,7 +1462,7 @@ + FILE="linux/version.h" + SELECTED_MAKEFILE="" + +- if [ -f $HEADERS/$FILE -o -f $OUTPUT/include/$FILE ]; then ++ if [ -f $HEADERS/$FILE -o -f $OUTPUT/include/$FILE -o -f $OUTPUT/include/generated/uapi/$FILE ]; then + # + # We are either looking at a configured kernel source + # tree or at headers shipped for a specific kernel. +--- usr/src/nv/nv-linux.h ++++ usr/src/nv/nv-linux.h +@@ -64,6 +64,18 @@ + #include <linux/module.h> + #include <linux/kmod.h> + ++#include <linux/mm.h> ++ ++#if !defined(VM_RESERVED) ++#define VM_RESERVED 0x00000000 ++#endif ++#if !defined(VM_DONTEXPAND) ++#define VM_DONTEXPAND 0x00000000 ++#endif ++#if !defined(VM_DONTDUMP) ++#define VM_DONTDUMP 0x00000000 ++#endif ++ + #include <linux/init.h> /* module_init, module_exit */ + #include <linux/types.h> /* pic_t, size_t, __u32, etc */ + #include <linux/errno.h> /* error codes */ diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.23-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.23-r2.ebuild new file mode 100644 index 0000000..0c91273 --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.23-r2.ebuild @@ -0,0 +1,500 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.23.ebuild,v 1.12 2013/03/30 17:02:36 jer Exp $ + +EAPI="2" + +inherit eutils flag-o-matic linux-mod multilib nvidia-driver portability \ + unpacker user versionator + +X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}" +AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}" +X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}" + +DESCRIPTION="NVIDIA X11 driver and GLX libraries" +HOMEPAGE="http://www.nvidia.com/" +SRC_URI="x86? ( ftp://download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run ) + amd64? ( ftp://download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run ) + x86-fbsd? ( ftp://download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )" + +LICENSE="GPL-2 NVIDIA-r1" +SLOT="0" +KEYWORDS="-* amd64 x86 ~x86-fbsd" +IUSE="acpi custom-cflags gtk multilib kernel_linux" +RESTRICT="bindist mirror strip" +EMULTILIB_PKG="true" + +COMMON="<x11-base/xorg-server-1.12.99 + gtk? ( + !media-video/nvidia-settings + dev-libs/atk + dev-libs/glib + x11-libs/gdk-pixbuf + x11-libs/gtk+:2 + x11-libs/libX11 + x11-libs/libXext + x11-libs/pango[X] + || ( x11-libs/pangox-compat <x11-libs/pango-1.31[X] ) + ) + kernel_linux? ( >=sys-libs/glibc-2.6.1 ) + multilib? ( app-emulation/emul-linux-x86-opengl ) + >=app-admin/eselect-opengl-1.0.9" +DEPEND="${COMMON} + kernel_linux? ( virtual/linux-sources )" +RDEPEND="${COMMON} + acpi? ( sys-power/acpid )" + +QA_TEXTRELS_x86="usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/lib/libXvMCNVIDIA.so.${PV}" + +QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko + usr/lib/opengl/nvidia/lib/libGL.so.1 + usr/lib/opengl/nvidia/lib/libGLcore.so.1 + usr/lib/libnvidia-cfg.so.1 + usr/lib/opengl/nvidia/extensions/libglx.so.1 + usr/lib/xorg/modules/drivers/nvidia_drv.so" + +QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/libcuda.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV}" + +QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.a:NVXVMC.o" + +QA_EXECSTACK_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/libnvcompiler.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libXvMCNVIDIA.a:NVXVMC.o + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/bin/nvidia-settings + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/libXvMCNVIDIA.a" + +QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}" + +QA_SONAME_amd64="usr/lib64/libnvcompiler.so.${PV}" + +QA_FLAGS_IGNORED_amd64="usr/lib32/libcuda.so.${PV} + usr/lib32/opengl/nvidia/lib/libGL.so.${PV} + usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib32/libvdpau_nvidia.so.${PV} + usr/lib64/libXvMCNVIDIA.so.${PV} + usr/lib64/libcuda.so.${PV} + usr/lib64/libnvidia-cfg.so.${PV} + usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib64/opengl/nvidia/lib/libGL.so.${PV} + usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib64/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib64/xorg/modules/drivers/nvidia_drv.so + usr/lib64/libvdpau_nvidia.so.${PV} + usr/bin/nvidia-settings + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +QA_FLAGS_IGNORED_x86="usr/lib/libcuda.so.${PV} + usr/lib/libnvidia-cfg.so.${PV} + usr/lib/opengl/nvidia/lib/libGLcore.so.${PV} + usr/lib/opengl/nvidia/lib/libGL.so.${PV} + usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV} + usr/lib/opengl/nvidia/extensions/libglx.so.${PV} + usr/lib/xorg/modules/drivers/nvidia_drv.so + usr/lib/libXvMCNVIDIA.so.${PV} + usr/lib/libvdpau_nvidia.so.${PV} + usr/bin/nvidia-settings + usr/bin/nvidia-smi + usr/bin/nvidia-xconfig" + +S="${WORKDIR}/" + +mtrr_check() { + ebegin "Checking for MTRR support" + linux_chkconfig_present MTRR + eend $? + + if [[ $? -ne 0 ]] ; then + eerror "Please enable MTRR support in your kernel config, found at:" + eerror + eerror " Processor type and features" + eerror " [*] MTRR (Memory Type Range Register) support" + eerror + eerror "and recompile your kernel ..." + die "MTRR support not detected!" + fi +} + +lockdep_check() { + if linux_chkconfig_present LOCKDEP; then + eerror "You've enabled LOCKDEP -- lock tracking -- in the kernel." + eerror "Unfortunately, this option exports the symbol 'lockdep_init_map' as GPL-only" + eerror "which will prevent ${P} from compiling." + eerror "Please make sure the following options have been unset:" + eerror " Kernel hacking --->" + eerror " [ ] Lock debugging: detect incorrect freeing of live locks" + eerror " [ ] Lock debugging: prove locking correctness" + eerror " [ ] Lock usage statistics" + eerror "in 'menuconfig'" + die "LOCKDEP enabled" + fi +} + +pkg_setup() { + # try to turn off distcc and ccache for people that have a problem with it + export DISTCC_DISABLE=1 + export CCACHE_DISABLE=1 + + if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then + eerror "This ebuild doesn't currently support changing your default abi." + die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}" + fi + + if use kernel_linux; then + linux-mod_pkg_setup + MODULE_NAMES="nvidia(video:${S}/usr/src/nv)" + BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \ + SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)" + mtrr_check + lockdep_check + fi + + # On BSD userland it wants real make command + use userland_BSD && MAKE="$(get_bmake)" + + export _POSIX2_VERSION="199209" + + # Since Nvidia ships 3 different series of drivers, we need to give the user + # some kind of guidance as to what version they should install. This tries + # to point the user in the right direction but can't be perfect. check + # nvidia-driver.eclass + nvidia-driver-check-warning + + # set variables to where files are in the package structure + if use kernel_FreeBSD; then + use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}" + NV_DOC="${S}/doc" + NV_EXEC="${S}/obj" + NV_LIB="${S}/obj" + NV_SRC="${S}/src" + NV_MAN="${S}/x11/man" + NV_X11="${S}/obj" + NV_X11_DRV="${NV_X11}" + NV_X11_EXT="${NV_X11}" + NV_SOVER=1 + elif use kernel_linux; then + NV_DOC="${S}/usr/share/doc" + NV_EXEC="${S}/usr/bin" + NV_LIB="${S}/usr/lib" + NV_SRC="${S}/usr/src/nv" + NV_MAN="${S}/usr/share/man/man1" + NV_X11="${S}/usr/X11R6/lib" + NV_X11_DRV="${NV_X11}/modules/drivers" + NV_X11_EXT="${NV_X11}/modules/extensions" + NV_SOVER=${PV} + else + die "Could not determine proper NVIDIA package" + fi +} + +src_unpack() { + if use kernel_linux && kernel_is lt 2 6 7; then + echo + ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" + ewarn "This is not officially supported for ${P}. It is likely you" + ewarn "will not be able to compile or use the kernel module." + ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7" + echo + ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored." + fi + + if ! use x86-fbsd; then + mkdir "${S}" + cd "${S}" + unpack_makeself + else + unpack ${A} + fi +} + +src_prepare() { + # Please add a brief description for every added patch + use x86-fbsd && cd doc + + # Use the correct defines to make gtkglext build work + epatch "${FILESDIR}"/NVIDIA_glx-defines.patch + # Use some more sensible gl headers and make way for new glext.h + epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch + # Compile with 3.8.+ kernels see #447566 + epatch "${FILESDIR}"/${P}-linux-3.8.patch + + if use kernel_linux; then + # Quiet down warnings the user does not need to see + sed -i \ + -e 's:-Wpointer-arith::g' \ + -e 's:-Wsign-compare::g' \ + "${NV_SRC}"/Makefile.kbuild + + # If you set this then it's your own fault when stuff breaks :) + use custom-cflags && sed -i "s:-O:${CFLAGS}:" "${NV_SRC}"/Makefile.* + + # If greater than 2.6.5 use M= instead of SUBDIR= + convert_to_m "${NV_SRC}"/Makefile.kbuild + fi +} + +src_compile() { + # This is already the default on Linux, as there's no toplevel Makefile, but + # on FreeBSD there's one and triggers the kernel module build, as we install + # it by itself, pass this. + + cd "${NV_SRC}" + if use x86-fbsd; then + MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \ + LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die + elif use kernel_linux; then + BUILD_PARAMS+=" PATCHLEVEL=not4" + linux-mod_src_compile + fi +} + +src_install() { + if use kernel_linux; then + linux-mod_src_install + + VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)" + if [ -z "$VIDEOGROUP" ]; then + eerror "Failed to determine the video group gid." + die "Failed to determine the video group gid." + fi + + # Add the aliases + [ -f "${FILESDIR}/nvidia-169.07" ] || die "nvidia missing in FILESDIR" + sed -e 's:PACKAGE:'${PF}':g' \ + -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \ + "${WORKDIR}"/nvidia + insinto /etc/modprobe.d + newins "${WORKDIR}"/nvidia nvidia.conf || die + elif use x86-fbsd; then + insinto /boot/modules + doins "${WORKDIR}/${NV_PACKAGE}/src/nvidia.kld" || die + + exeinto /boot/modules + doexe "${WORKDIR}/${NV_PACKAGE}/src/nvidia.ko" || die + fi + + # NVIDIA kernel <-> userspace driver config lib + dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \ + die "failed to install libnvidia-cfg" + + # Xorg DDX driver + insinto /usr/$(get_libdir)/xorg/modules/drivers + doins ${NV_X11_DRV}/nvidia_drv.so || die "failed to install nvidia_drv.so" + + # Xorg GLX driver + insinto /usr/$(get_libdir)/opengl/nvidia/extensions + doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \ + die "failed to install libglx.so" + dosym /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so.${NV_SOVER} \ + /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \ + die "failed to create libglx.so symlink" + + # XvMC driver + dolib.a ${NV_X11}/libXvMCNVIDIA.a || \ + die "failed to install libXvMCNVIDIA.so" + dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \ + die "failed to install libXvMCNVIDIA.so" + dosym libXvMCNVIDIA.so.${NV_SOVER} /usr/$(get_libdir)/libXvMCNVIDIA.so || \ + die "failed to create libXvMCNVIDIA.so symlink" + + # CUDA headers (driver to come) + if [[ -d ${S}/usr/include/cuda ]]; then + dodir /usr/include/cuda + insinto /usr/include/cuda + doins usr/include/cuda/*.h || die "failed to install cuda headers" + fi + + # OpenCL headers (driver to come) + if [[ -d ${S}/usr/include/CL ]]; then + dodir /usr/include/CL + insinto /usr/include/CL + doins usr/include/CL/*.h || die "failed to install OpenCL headers" + fi + + # Documentation + dodoc ${NV_DOC}/XF86Config.sample + dohtml ${NV_DOC}/html/* + if use x86-fbsd; then + dodoc "${NV_DOC}/README" + doman "${NV_MAN}/nvidia-xconfig.1" + else + # Docs + newdoc "${NV_DOC}/README.txt" README + dodoc "${NV_DOC}/NVIDIA_Changelog" +# doman "${NV_MAN}/nvidia-smi.1.gz" + doman "${NV_MAN}/nvidia-xconfig.1.gz" + fi + + # Helper Apps + dobin ${NV_EXEC}/nvidia-xconfig || die + dobin ${NV_EXEC}/nvidia-bug-report.sh || die + if use gtk; then + dobin usr/bin/nvidia-settings || die + fi +# if use kernel_linux; then +# dobin ${NV_EXEC}/nvidia-smi || die +# fi + + if has_multilib_profile ; then + local OABI=${ABI} + for ABI in $(get_install_abis) ; do + src_install-libs + done + ABI=${OABI} + unset OABI + else + src_install-libs + fi + + is_final_abi || die "failed to iterate through all ABIs" +} + +# Install nvidia library: +# the first parameter is the place where to install it +# the second parameter is the base name of the library +# the third parameter is the provided soversion +donvidia() { + dodir $1 + exeinto $1 + + libname=$(basename $2) + + doexe $2.$3 || die "failed to install $2" + dosym ${libname}.$3 $1/${libname} || die "failed to symlink $2" + [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1 +} + +src_install-libs() { + local inslibdir=$(get_libdir) + local NV_ROOT="/usr/${inslibdir}/opengl/nvidia" + local libdir= sover= + + if use kernel_linux; then + if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then + libdir=usr/lib32 + else + libdir=usr/lib + fi + sover=${PV} + else + libdir=obj + # on FreeBSD it has just .1 suffix + sover=1 + fi + + # The GLX libraries + donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover} + donvidia ${NV_ROOT}/lib ${libdir}/libGLcore.so ${sover} + if use x86-fbsd; then + donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover} + else + donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover} + fi + + #cuda + if [[ -f ${libdir}/libcuda.so.${sover} ]]; then + dolib.so ${libdir}/libcuda.so.${sover} + [[ "${sover}" != "1" ]] && dosym libcuda.so.${sover} /usr/${inslibdir}/libcuda.so.1 + dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so + fi + + #vdpau + if [[ -f ${libdir}/libvdpau_nvidia.so.${sover} ]]; then + dolib.so ${libdir}/libvdpau_nvidia.so.${sover} + dosym libvdpau_nvidia.so.${sover} /usr/${inslibdir}/libvdpau_nvidia.so + fi + + # OpenCL + # NOTE: This isn't currently available in the publicly released drivers. + if [[ -f ${libdir}/libOpenCL.so.1.0.0 ]]; then + + dolib.so ${libdir}/libnvcompiler.so.${sover} + [[ "${sover}" != "1" ]] && dosym libnvcompiler.so.${sover} /usr/${inslibdir}/libnvcompiler.so.1 + dosym libnvcompiler.so.1 /usr/${inslibdir}/libnvcompiler.so + + dolib.so ${libdir}/libOpenCL.so.1.0.0 + dosym libOpenCL.so.1.0.0 /usr/${inslibdir}/libOpenCL.so.1 + dosym libOpenCL.so.1 /usr/${inslibdir}/libOpenCL.so + fi +} + +pkg_preinst() { + if use kernel_linux; then + linux-mod_pkg_postinst + fi + + # Clean the dynamic libGL stuff's home to ensure + # we dont have stale libs floating around + if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then + rm -rf "${ROOT}"/usr/lib/opengl/nvidia/* + fi + # Make sure we nuke the old nvidia-glx's env.d file + if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then + rm -f "${ROOT}"/etc/env.d/09nvidia + fi +} + +pkg_postinst() { + if use kernel_linux; then + linux-mod_pkg_postinst + fi + + # Switch to the nvidia implementation + eselect opengl set --use-old nvidia + + elog "You must be in the video group to use the NVIDIA device" + elog "For more info, read the docs at" + elog "http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect6" + elog + elog "This ebuild installs a kernel module and X driver. Both must" + elog "match explicitly in their version. This means, if you restart" + elog "X, you must modprobe -r nvidia before starting it back up" + elog + elog "To use the NVIDIA GLX, run \"eselect opengl set nvidia\"" + elog + elog "NVIDIA has requested that any bug reports submitted have the" + elog "output of /usr/bin/nvidia-bug-report.sh included." + elog +} + +pkg_postrm() { + if use kernel_linux; then + linux-mod_pkg_postrm + fi + eselect opengl set --use-old xorg-x11 +} |