From nobody@FreeBSD.org  Thu Feb 14 14:07:46 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 6B936D1
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 14 Feb 2013 14:07:46 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F4356CB
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 14 Feb 2013 14:07:46 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r1EE7kUe035569
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 14 Feb 2013 14:07:46 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r1EE7kIk035568;
	Thu, 14 Feb 2013 14:07:46 GMT
	(envelope-from nobody)
Message-Id: <201302141407.r1EE7kIk035568@red.freebsd.org>
Date: Thu, 14 Feb 2013 14:07:46 GMT
From: "b.f." <bf@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] x11/nvidia-driver: fix the build after linux header changes in -CURRENT
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         176146
>Category:       ports
>Synopsis:       [PATCH] x11/nvidia-driver: fix the build after linux header changes in -CURRENT
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    danfe
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 14 14:10:00 UTC 2013
>Closed-Date:    Sat Feb 16 15:06:48 UTC 2013
>Last-Modified:  Sat Feb 16 15:06:48 UTC 2013
>Originator:     b.f.
>Release:        10.0-CURRENT amd64
>Organization:
-
>Environment:
>Description:
Some of the linux headers were refactored recently in -CURRENT:

http://svnweb.freebsd.org/changeset/base/246085

In particular, some of the linux ioctl functions were moved to a machine-independent header.  Include this header to fix the driver when built WITH_LINUX.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: Makefile
===================================================================
--- Makefile	(revision 312212)
+++ Makefile	(working copy)
@@ -88,6 +88,9 @@
 CONFLICTS=	linux[-_]dri-[0-9]* linux-f10-dri-[0-9]*
 USE_LINUX=	yes
 PLIST_SUB+=	LINUX=""
+.if ${OSVERSION} > 1000026
+EXTRA_PATCHES+=	${FILESDIR}/r246085-patch-src__nvidia_linux.c
+.endif
 .else
 PLIST_SUB+=	LINUX="@comment "
 # Propagate WITHOUT_LINUX variable down to inner Makefiles
Index: files/r246085-patch-src__nvidia_linux.c
===================================================================
--- files/r246085-patch-src__nvidia_linux.c	(revision 0)
+++ files/r246085-patch-src__nvidia_linux.c	(working copy)
@@ -0,0 +1,14 @@
+--- src/nvidia_linux.c.orig	2012-10-30 13:54:06.000000000 -0400
++++ src/nvidia_linux.c	2013-02-13 19:48:17.000000000 -0500
+@@ -21,9 +21,11 @@
+ #if defined(NVCPU_X86)
+ #include "machine/../linux/linux.h"
+ #include "machine/../linux/linux_proto.h"
++#include "machine/../../compat/linux/linux_ioctl.h"
+ #elif defined(NVCPU_X86_64)
+ #include "machine/../linux32/linux.h"
+ #include "machine/../linux32/linux32_proto.h"
++#include "machine/../../compat/linux/linux_ioctl.h"
+ #endif
+ 
+ int linux_ioctl_nvidia(d_thread_t *, struct linux_ioctl_args *);


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->danfe 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Feb 14 14:10:08 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176146 

From: David Wolfskill <david@catwhisker.org>
To: bug-followup@freebsd.org, bf@freebsd.org
Cc:  
Subject: Re: ports/176146: [PATCH] x11/nvidia-driver: fix the build after
 linux header changes in -CURRENT
Date: Thu, 14 Feb 2013 09:02:18 -0800

 --eUGqGfkt69yEwRle
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 I have successfully tested bf's patch (from the PR) in FreeBSD/i386
 environments.
 
 First I built:
 
 FreeBSD g1-227.catwhisker.org 10.0-CURRENT FreeBSD 10.0-CURRENT #811  r2467=
 84M/246788: Thu Feb 14 08:25:04 PST 2013     root@g1-227.catwhisker.org:/us=
 r/obj/usr/src/sys/CANARY  i386
 
 As I rebuild the nVidia kernel module when I rebuild the kernel, the
 process tested the patch.  A subsequent reboot verified that I was (still)
 able to use the nVidia driver in that environment.
 
 
 I then booted the machine from the stable/9 slice that I had updated to:
 
 FreeBSD g1-227.catwhisker.org 9.1-STABLE FreeBSD 9.1-STABLE #375  r246786M/=
 246788: Thu Feb 14 04:33:20 PST 2013     root@g1-227.catwhisker.org:/usr/ob=
 j/usr/src/sys/CANARY  i386
 
 before applying the patch.  I then ran:
 
 	portmaster x11/nvidia-driver
 
 (using the patched port), then (for good measure) rebooted, and again
 verified that I was able to use the nVidia driver in that environment.
 
 
 Once r246085 is MFCed, the patch will need some modification as it
 presently stands.
 
 Peace,
 david
 --=20
 David H. Wolfskill				david@catwhisker.org
 Taliban: Evil men with guns afraid of truth from a 14-year old girl.
 
 See http://www.catwhisker.org/~david/publickey.gpg for my public key.
 
 --eUGqGfkt69yEwRle
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (FreeBSD)
 
 iEYEARECAAYFAlEdGJkACgkQmprOCmdXAD3OsQCfQkU6USciL7N9WCALqIPVk5hg
 QhIAnjy+5mL2pEJX8/B83VUqgrKY4jGw
 =Vq8q
 -----END PGP SIGNATURE-----
 
 --eUGqGfkt69yEwRle--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/176146: commit references a PR
Date: Sat, 16 Feb 2013 14:09:27 +0000 (UTC)

 Author: danfe
 Date: Sat Feb 16 14:09:17 2013
 New Revision: 312352
 URL: http://svnweb.freebsd.org/changeset/ports/312352
 
 Log:
   - Update mainstream driver version to 310.32, the latest to date
   - Unbreak the build on recent -CURRENT (after SVN r246085) [*]
   - Move 304.xx driver version to yet another legacy port
   
   PR:		ports/176146 [*]
   Submitted by:	bf
 
 Added:
   head/x11/nvidia-driver-304/
   head/x11/nvidia-driver-304/Makefile   (contents, props changed)
   head/x11/nvidia-driver/files/r246085-patch-src-nvidia_linux.c   (contents, props changed)
 Modified:
   head/x11/Makefile
   head/x11/nvidia-driver/Makefile
   head/x11/nvidia-driver/distinfo
 
 Modified: head/x11/Makefile
 ==============================================================================
 --- head/x11/Makefile	Sat Feb 16 13:30:41 2013	(r312351)
 +++ head/x11/Makefile	Sat Feb 16 14:09:17 2013	(r312352)
 @@ -211,6 +211,7 @@
      SUBDIR += numlockx
      SUBDIR += nvidia-driver
      SUBDIR += nvidia-driver-173
 +    SUBDIR += nvidia-driver-304
      SUBDIR += nvidia-driver-71
      SUBDIR += nvidia-driver-96
      SUBDIR += nvidia-settings
 
 Added: head/x11/nvidia-driver-304/Makefile
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/x11/nvidia-driver-304/Makefile	Sat Feb 16 14:09:17 2013	(r312352)
 @@ -0,0 +1,11 @@
 +# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
 +# $FreeBSD$
 +
 +DISTVERSION=	304.64
 +# Explicitly set PORTREVISION as it can be overridden by the master port
 +PORTREVISION=	0
 +
 +MASTERDIR=	${.CURDIR}/../nvidia-driver
 +NO_LATEST_LINK=	yes
 +
 +.include "${MASTERDIR}/Makefile"
 
 Modified: head/x11/nvidia-driver/Makefile
 ==============================================================================
 --- head/x11/nvidia-driver/Makefile	Sat Feb 16 13:30:41 2013	(r312351)
 +++ head/x11/nvidia-driver/Makefile	Sat Feb 16 14:09:17 2013	(r312352)
 @@ -8,7 +8,7 @@
  # slave ports.
  
  PORTNAME=	nvidia-driver
 -DISTVERSION?=	304.64
 +DISTVERSION?=	310.32
  # Always try to set PORTREVISION as can be overridden by the slave ports
  PORTREVISION?=	0
  CATEGORIES=	x11 kld
 @@ -32,7 +32,7 @@ USE_LDCONFIG=	yes
  # NVIDIA_ROOT is not set in src/Makefile, which results in bogus -I/src
  # passed to compiler and broken build on HEAD since r221320 when option
  # -Wmissing-include-dirs was added for kernel sources.  Until properly
 -# fixed upstream across all versions (including legacy ones), use this
 +# fixed upstream (across all versions, including legacy ones), use this
  # hack below to universally set NVIDIA_ROOT.  Also provide X11BASE value
  # since it is going away from `Mk/bsd.port.mk' as deprecated.
  MAKE_ENV=	NVIDIA_ROOT=${WRKSRC} X11BASE=${LOCALBASE}
 @@ -88,6 +88,9 @@ PLIST_SUB+=	LINUXBASE=${LINUXBASE} SHLIB
  CONFLICTS=	linux[-_]dri-[0-9]* linux-f10-dri-[0-9]*
  USE_LINUX=	yes
  PLIST_SUB+=	LINUX=""
 +. if ${OSVERSION} > 1000026
 +EXTRA_PATCHES+=	${FILESDIR}/r246085-patch-src-nvidia_linux.c
 +. endif
  .else
  PLIST_SUB+=	LINUX="@comment "
  # Propagate WITHOUT_LINUX variable down to inner Makefiles
 @@ -190,8 +193,11 @@ post-install: .SILENT
  	${REINPLACE_CMD} -E 's/libGLcore/libnvidia-glcore/ ; \
  		/usr.*(glcore|tls).*so\.1$$/d' ${TMPPLIST}
  .endif
 -# Some applications need this symlink (see PR ports/72877)
 +.if ${NVVERSION} >= 3101900
 +	${REINPLACE_CMD} -e '/libXvMCNVIDIA/d' ${TMPPLIST}
 +.else	# some applications need this symlink (see PR ports/72877)
  	${LN} -sf libXvMCNVIDIA.so.1 ${PREFIX}/lib/libXvMCNVIDIA_dynamic.so.1
 +.endif
  .if ${NVVERSION} >= 1952200
  . if ${OSVERSION} > 800090
  	${REINPLACE_CMD} -e '/does not support PAE/,+1d' ${PKGMESSAGE}
 
 Modified: head/x11/nvidia-driver/distinfo
 ==============================================================================
 --- head/x11/nvidia-driver/distinfo	Sat Feb 16 13:30:41 2013	(r312351)
 +++ head/x11/nvidia-driver/distinfo	Sat Feb 16 14:09:17 2013	(r312352)
 @@ -1,3 +1,7 @@
 +SHA256 (NVIDIA-FreeBSD-x86_64-310.32.tar.gz) = f0935abf74a1298471a5eb0ede56ab913e358b76935557d618915a97efda9224
 +SIZE (NVIDIA-FreeBSD-x86_64-310.32.tar.gz) = 33511666
 +SHA256 (NVIDIA-FreeBSD-x86-310.32.tar.gz) = 3f00f5a13dc04f51b2a1b000ad53741ac6b81bd6e70258e7b9f200daf8f52b2d
 +SIZE (NVIDIA-FreeBSD-x86-310.32.tar.gz) = 32541283
  SHA256 (NVIDIA-FreeBSD-x86_64-304.64.tar.gz) = 9887e4147fcb16141dcb6b153ff71a28c73cf2a4c16b60e4c6fcb8586a1c5400
  SIZE (NVIDIA-FreeBSD-x86_64-304.64.tar.gz) = 34247065
  SHA256 (NVIDIA-FreeBSD-x86-304.64.tar.gz) = e129d0d0e8d256d6328cddc4c18edb96c1e444c354f7c806ece4192621a1c1b5
 
 Added: head/x11/nvidia-driver/files/r246085-patch-src-nvidia_linux.c
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/x11/nvidia-driver/files/r246085-patch-src-nvidia_linux.c	Sat Feb 16 14:09:17 2013	(r312352)
 @@ -0,0 +1,14 @@
 +--- src/nvidia_linux.c.orig	2012-10-30 13:54:06.000000000 -0400
 ++++ src/nvidia_linux.c	2013-02-13 19:48:17.000000000 -0500
 +@@ -21,9 +21,11 @@
 + #if defined(NVCPU_X86)
 + #include "machine/../linux/linux.h"
 + #include "machine/../linux/linux_proto.h"
 ++#include "machine/../../compat/linux/linux_ioctl.h"
 + #elif defined(NVCPU_X86_64)
 + #include "machine/../linux32/linux.h"
 + #include "machine/../linux32/linux32_proto.h"
 ++#include "machine/../../compat/linux/linux_ioctl.h"
 + #endif
 + 
 + int linux_ioctl_nvidia(d_thread_t *, struct linux_ioctl_args *);
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: danfe 
State-Changed-When: Sat Feb 16 15:04:51 UTC 2013 
State-Changed-Why:  
Should be fixed as of SVN r312352, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176146 
>Unformatted:
