Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Sep 2013 01:51:44 +0200
From:      "O. Hartmann" <ohartman@zedat.fu-berlin.de>
To:        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   HELP! nvidia-driver patch: Weird REPLACE_CMD and command-line-sed behaviour. HELP!
Message-ID:  <20130910015144.41c88d52@thor.walstatt.dyndns.org>

next in thread | raw e-mail | index | archive | help
--Sig_/2F1JNAPK0+iiXS0.UIENXi2
Content-Type: multipart/mixed; boundary="MP_//DvhNUYKUjBvUkV__y+9dki"

--MP_//DvhNUYKUjBvUkV__y+9dki
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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

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=20

# Changes in vm_map_find() due to r255426=20
.if ${OSVERSION} > 1000053=20
	${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:

=3D=3D=3D>  Cleaning for nvidia-driver-325.15
=3D=3D=3D>  License NVIDIA accepted by the user
=3D=3D=3D>  Found saved configuration for nvidia-driver-325.08_1
=3D=3D=3D>   nvidia-driver-325.15 depends on file: /usr/local/sbin/pkg - fo=
und
=3D=3D=3D> Fetching all distfiles required by nvidia-driver-325.15 for
building =3D=3D=3D>  Extracting for nvidia-driver-325.15
=3D> SHA256 Checksum OK for NVIDIA-FreeBSD-x86_64-325.15.tar.gz.
=3D=3D=3D>  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=20

--MP_//DvhNUYKUjBvUkV__y+9dki
Content-Type: text/x-patch
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename=nvidia-driver_3rd.patch

--- Makefile.orig	2013-09-10 00:30:53.000000000 +0200
+++ Makefile	2013-09-10 01:30:21.000000000 +0200
@@ -160,6 +160,11 @@
 		s/CAP_IOCTL/cap_rights_init(\&rights, &)/' \
 			${WRKSRC}/src/nvidia_linux.c
 .endif
+# 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
 # Fix stack buffer overflow in nvidia_sysctl_bus_type()
 .if ${NVVERSION} < 3192300
 	${REINPLACE_CMD} -E '/bus_type\[4\]/d ; \

--MP_//DvhNUYKUjBvUkV__y+9dki--

--Sig_/2F1JNAPK0+iiXS0.UIENXi2
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (FreeBSD)

iQEcBAEBAgAGBQJSLl8QAAoJEOgBcD7A/5N8WLsH/108NFZXkr7RPAj8Dzav9cCc
xLUhP0LUIXk+7M4PIyIzyTilc1r9LWLKZbiSYtEPelZPTACU6ScdnuKEZj6MRbmV
7RY9RgD76k6vPyCxY46heDktJmUFm9mQKHTLz/5gdbUH11tN1GpGlEyKBeDtlvcf
pOIbp1iZhw7MwOztqd/vy6EOC3/HW75bQq77RY3VvH4ch4MjmvA6yWkungtG1wjn
txWUnfs3Oj4A9Pk9bh5xuTDEULohm3kr9+6SPgEenC4xqJoBonfLTho7Mifjzh1A
22+1TwMUwO1ry9uFWEeKxc/1LJuto/ZQLNujrI6fiBebq0rotpwVSed3eEs7L2A=
=HSJz
-----END PGP SIGNATURE-----

--Sig_/2F1JNAPK0+iiXS0.UIENXi2--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130910015144.41c88d52>