--- nvidia-kernel-1.0.5336-r2.ebuild 2004-04-13 18:10:27.000000000 +0100 +++ nvidia-kernel-1.0.5336-r3.ebuild 2004-04-28 19:07:42.749469816 +0100 @@ -94,17 +94,13 @@ EPATCH_SINGLE_MSG="Applying basic sysfs patch ..." \ epatch ${FILESDIR}/${PV}/NVIDIA_kernel-${NV_V}-basic-sysfs-support.patch - # Kbuild have issues currently (sandbox related). -# ln -snf Makefile.nvidia Makefile - sed -e "s:5328:${NV_V/1.0-/}:g" \ - ${FILESDIR}/${PV}/Makefile > ${S}/makefile - - # Makefile is now makefile so we will do sed here instead. - [ ! -z "${USE_CRAZY_OPTS}" ] && sed -i "s:-O:${CFLAGS}:" makefile - else - # if you set this then it's your own fault when stuff breaks :) - [ ! -z "${USE_CRAZY_OPTS}" ] && sed -i "s:-O:${CFLAGS}:" Makefile + rm makefile + ln -snf Makefile.kbuild Makefile fi + + # if you set this then it's your own fault when stuff breaks :) + [ ! -z "${USE_CRAZY_OPTS}" ] && sed -i "s:-O:${CFLAGS}:" Makefile + } src_compile() { @@ -117,8 +113,22 @@ # kernel outside the chroot rather than within. if is_kernel 2 5 || is_kernel 2 6 then + # The nvidia makefile listens to the "ARCH" variable.. and the 2.6 kernels use "i386" not "x86".. + if [ "${ARCH}" == "x86" ] + then + export ARCH=i386 + fi + make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \ - clean nvidia.o || die + clean module || die + + # Is there any point setting this back here? + # (i'm not exactly the master of ebuilds, as you can see) + if [ "${ARCH}" == "i386" ] + then + export ARCH=x86 + fi + else make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \ clean module || die @@ -130,7 +140,7 @@ insinto /lib/modules/${KV}/video if is_kernel 2 5 || is_kernel 2 6 then - newins nvidia.o nvidia.ko + doins nvidia.ko else doins nvidia.o fi