From owner-freebsd-ports@FreeBSD.ORG Mon Sep 9 23:51:47 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C4CC97F3 for ; Mon, 9 Sep 2013 23:51:47 +0000 (UTC) (envelope-from ohartman@zedat.fu-berlin.de) Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5BAC12C7B for ; Mon, 9 Sep 2013 23:51:47 +0000 (UTC) Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost1.zedat.fu-berlin.de (Exim 4.80.1) for freebsd-ports@freebsd.org with esmtp (envelope-from ) id <1VJBFB-003loh-FR>; Tue, 10 Sep 2013 01:51:45 +0200 Received: from e179065126.adsl.alicedsl.de ([85.179.65.126] helo=thor.walstatt.dyndns.org) by inpost2.zedat.fu-berlin.de (Exim 4.80.1) for freebsd-ports@freebsd.org with esmtpsa (envelope-from ) id <1VJBFB-000hQr-9w>; Tue, 10 Sep 2013 01:51:45 +0200 Date: Tue, 10 Sep 2013 01:51:44 +0200 From: "O. Hartmann" To: FreeBSD Ports Subject: HELP! nvidia-driver patch: Weird REPLACE_CMD and command-line-sed behaviour. HELP! Message-ID: <20130910015144.41c88d52@thor.walstatt.dyndns.org> Organization: FU Berlin X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.19; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/2F1JNAPK0+iiXS0.UIENXi2"; protocol="application/pgp-signature" X-Originating-IP: 85.179.65.126 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2013 23:51:47 -0000 --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--