HELP! nvidia-driver patch: Weird REPLACE_CMD and command-line-sed behaviour. HELP!

O. Hartmann ohartman at zedat.fu-berlin.de
Mon Sep 9 23:51:47 UTC 2013


With CURRENT r255426 several changes has been introduced (see
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=291456+0+current/svn-src-head).

This results in a non-functionality of the x11/nvidia-driver port after
updating world and kernel to CURRENT r255426.

I try to patch this. The target file is src/nvidia_subr.c, line 833
(nVidia driver 325.15, 319.XX might differ).

The solution is to insert a zero (0) after the size parameter, which
can be targetted by the sed-expression

sed -i -e 's/\(\&virtual_address, size,\) \(VMFS_ANY_SPACE,\)$/ \
\1 0, \2/' work/NVIDIA-FreeBSD-x86_64-325.15/src/nvidia_subr.c

(do "make clean patch" first in x11/nvidia-driver).

Checking work/NVIDIA-FreeBSD-x86_64-325.15/src/nvidia_subr.c at line
833 reveals:

&virtual_address, size, 0, VMFS_ANY_SPACE,

which is exactly what I wanted. But putting the very same
sed-expression into the port's Makefile 

# Changes in vm_map_find() due to r255426 
.if ${OSVERSION} > 1000053 
	${REINPLACE_CMD} -e 's/\(\&virtual_address, size,\) \
	\(VMFS_ANY_SPACE,\)$/\1 0, \2/' \
	\ ${WRKSRC}/src/nvidia_subr.c
.endif

(patch attached) gives this weird error:

===>  Cleaning for nvidia-driver-325.15
===>  License NVIDIA accepted by the user
===>  Found saved configuration for nvidia-driver-325.08_1
===>   nvidia-driver-325.15 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by nvidia-driver-325.15 for
building ===>  Extracting for nvidia-driver-325.15
=> SHA256 Checksum OK for NVIDIA-FreeBSD-x86_64-325.15.tar.gz.
===>  Patching for nvidia-driver-325.15
sed: 1: "s/\(\&virtual_address,  ...": unescaped newline inside
substitute pattern *** Error code 1

Stop.
make[1]: stopped in /usr/ports/x11/nvidia-driver
*** Error code 1

Stop.
make: stopped in /usr/ports/x11/nvidia-driver


What the f*** is going on here? The expression in single-quotes is
supposed not to substituted by the shell/make, isn't it?

What I am doing wrong here?

I filed a PR (ports/181972) for the nvidia problem, but I'm incapale
of providing the patch due to this sticky obscure fault.

Oliver 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nvidia-driver_3rd.patch
Type: text/x-patch
Size: 539 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20130910/a7dd7df3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20130910/a7dd7df3/attachment.sig>


More information about the freebsd-ports mailing list