Nvidia-340xx-dkms not building

Somebody managed to install nvidia-340xx-lts-dkms with 5.15 kernel?
Comments in the package repo suggest it works with Arch, but I get errors:

Applying patch 0001-kernel-5.7.patch...
patching file kernel/Makefile
patching file kernel/conftest.sh
patching file kernel/dkms.conf
patching file kernel/nv-drm.c
patching file kernel/nv-linux.h
patching file kernel/nv-procfs.c
patching file kernel/nv-time.h
patching file kernel/nv.c
patching file kernel/os-interface.c
patching file kernel/uvm/Makefile
patching file kernel/uvm/conftest.sh
patching file kernel/uvm/nvidia_uvm_lite.c
Applying patch 0002-kernel-5.8.patch...
patching file kernel/nv-linux.h
patching file kernel/nvidia-modules-common.mk
patching file kernel/os-mlock.c
patching file kernel/uvm/nvidia_uvm_lite_api.c
Applying patch 0003-kernel-5.9.patch...
patching file kernel/nv-drm.c
patching file kernel/nv-linux.h
patching file kernel/nv.c
patching file kernel/uvm/nvidia_uvm_linux.h
Applying patch 0004-kernel-5.10.patch...
patching file kernel/nv-drm.c
Hunk #1 succeeded at 364 (offset 42 lines).
Applying patch 0005-kernel-5.11.patch...
patching file kernel/conftest.sh
patching file kernel/nv-drm.c
Hunk #1 succeeded at 59 (offset -1 lines).
Hunk #2 succeeded at 211 (offset -1 lines).
Hunk #3 succeeded at 242 (offset -1 lines).
Hunk #4 succeeded at 278 (offset -1 lines).
Hunk #5 succeeded at 408 (offset -2 lines).
Hunk #6 succeeded at 459 (offset -2 lines).
patching file kernel/nv-linux.h
patching file kernel/uvm/nvidia_uvm_linux.h
Applying patch 0006-kernel-5.14.patch...
patching file kernel/nv-drm.c
patching file kernel/os-interface.c
Applying patch 0007-kernel-5.15.patch...
(Stripping trailing CRs from patch; use --binary to disable.)
patching file kernel/nv-drm.c
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 606 with fuzz 1 (offset 77 lines).
==> Starting build()...
NVIDIA: calling KBUILD...
make[1]: *** /usr/src/linux: No such file or directory. Stop.
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make: *** [Makefile:202: nvidia.ko] Błąd 1
==> Error: There was an error in build().
    Stopping...
:: Unable to build nvidia-340xx-dkms - makepkg exited with code: 4
=>> Try again? [y/N]: 

Do I need kernel sources?

you dont need nvidia-340xx-dkms
manjaro build all ( kernels , drivers , video , etc ) , this is not coming from Archlinux
you should remove nvidia-340xx-dkms

see man mhwd-kernel
see man mhwd

Sorry, I messed up the title for this post.
It should be:
nvidia-340xx-dkms
not
nvidia-340xx-lts-dkms,
Which is probably irrelevant anyway

How do I not need nvidia-340xx-dkms if I want to install Nvidia proprietary drivers for old G-Force gear? Well, I could compile the driver and patches by hand – pretty impractical. Or make do with Nouveau.

Manjaro is not Arch and use different kernels.

What NVIDIA card do you have? Have you tried the 390xx drivers in our repos?

See:

Please post the output of:

inxi -Gazy

And:

mhwd --list

390xx won’t work. It’s a G-Force 200. 390xx works from G_Force 400 upwards.

Sorry, can’t mhwd – I’m on a different machine now. Will do tomorrow.
I could use your guuide, but it only works up to 5.10, which means, I would be losing some btrfs fun.
Or perhaps you would be so kind to review this patch and include it in your guide:

?

The 340 series is no longer supported by NVIDIA. Manjaro does not support it, either. If you want to build it and use that patch, by my guest.

For using the Nvidia 340 driver with kernels up to 5.16 in Manjaro, just have a look here: Problems with installing nvidia 340xx - #18 by DAC324