From lawrance@FreeBSD.org  Sun Oct 15 11:01:33 2006
Return-Path: <lawrance@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id CF09D16A403
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Oct 2006 11:01:33 +0000 (UTC)
	(envelope-from lawrance@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8C33243D46
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Oct 2006 11:01:33 +0000 (GMT)
	(envelope-from lawrance@FreeBSD.org)
Received: from freefall.freebsd.org (lawrance@localhost [127.0.0.1])
	by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k9FB1X0s090913
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Oct 2006 11:01:33 GMT
	(envelope-from lawrance@freefall.freebsd.org)
Received: (from lawrance@localhost)
	by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k9FB1XxK090912;
	Sun, 15 Oct 2006 11:01:33 GMT
	(envelope-from lawrance)
Message-Id: <200610151101.k9FB1XxK090912@freefall.freebsd.org>
Date: Sun, 15 Oct 2006 11:01:33 GMT
From: Sam Lawrance <lawrance@FreeBSD.org>
Reply-To: Sam Lawrance <lawrance@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: sysutils/915resolution: depenguinate
X-Send-Pr-Version: 3.113
X-GNATS-Notify: MrL0Lz@gmail.com

>Number:         104434
>Category:       ports
>Synopsis:       sysutils/915resolution: depenguinate
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lawrance
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 15 11:10:18 GMT 2006
>Closed-Date:    Tue Oct 31 07:07:28 GMT 2006
>Last-Modified:  Tue Oct 31 07:10:28 GMT 2006
>Originator:     Sam Lawrance
>Release:        FreeBSD 6.0-STABLE i386
>Organization:
>Environment:

>Description:
915resolution is a linux binary.  I was just thinking it would be
nice to have on FreeSBIE, but the linux dependencies hanging off
it are unattractive.

>How-To-Repeat:
	n/a

>Fix:
Please see the attached patch which modifies the port to build
a native version of 915resolution.

--- patch-915resolution begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/sysutils/915resolution/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile	28 Mar 2006 08:42:03 -0000	1.3
+++ Makefile	15 Oct 2006 10:48:52 -0000
@@ -6,6 +6,7 @@
 
 PORTNAME=	915resolution
 PORTVERSION=	0.5.2
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	http://www.geocities.com/stomljen/ \
@@ -15,14 +16,14 @@
 MAINTAINER=	MrL0Lz@gmail.com
 COMMENT=	Resolution tool for Intel i915 video cards
 
-USE_LINUX=	yes
-NO_BUILD=	yes
-ONLY_FOR_ARCHS=	i386
-
 PLIST_FILES=	bin/915resolution
+ALL_TARGET=	915resolution
+
+do-build:
+	cd ${WRKSRC} && \
+		${CC} ${CFLAGS} 915resolution.c -o 915resolution
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/915resolution ${PREFIX}/bin
-	${BRANDELF} -t Linux ${PREFIX}/bin/915resolution
 
 .include <bsd.port.mk>
Index: pkg-descr
===================================================================
RCS file: /home/pcvs/ports/sysutils/915resolution/pkg-descr,v
retrieving revision 1.1
diff -u -r1.1 pkg-descr
--- pkg-descr	26 May 2005 21:33:34 -0000	1.1
+++ pkg-descr	15 Oct 2006 10:48:52 -0000
@@ -1,5 +1,4 @@
 This is a resolution hack for Intel 915 based video cards. Based on code
-written by Alain Poirer for Linux, modified by Steve Tomljenovic. Binary
-install, source code included.
+written by Alain Poirer for Linux, modified by Steve Tomljenovic.
 
 WWW: http://www.geocities.com/stomljen/
Index: files/patch-915resolution.c
===================================================================
RCS file: files/patch-915resolution.c
diff -N files/patch-915resolution.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-915resolution.c	15 Oct 2006 10:48:52 -0000
@@ -0,0 +1,90 @@
+--- 915resolution.c.orig	Fri Feb  3 01:28:34 2006
++++ 915resolution.c	Sun Oct 15 20:39:56 2006
+@@ -21,8 +21,10 @@
+ #define __USE_GNU
+ #include <string.h>
+ #include <sys/mman.h>
++#include <machine/cpufunc.h>
++#define OUTB(a, b) outb(b, a)
++#define OUTL(a, b) outl(b, a)
+ #include <fcntl.h>
+-#include <sys/io.h>
+ #include <unistd.h>
+ #include <assert.h>
+ 
+@@ -161,7 +163,8 @@
+ void initialize_system(char * filename) {
+ 
+     if (!filename) {
+-        if (iopl(3) < 0) {
++        FILE* iof = fopen("/dev/io", "r");
++        if (iof == NULL) {
+             perror("Unable to obtain the proper IO permissions");
+             exit(2);
+         }
+@@ -169,7 +172,7 @@
+ }
+ 
+ cardinal get_chipset_id(void) {
+-    outl(0x80000000, 0xcf8);
++    OUTL(0x80000000, 0xcf8);
+     return inl(0xcfc);
+ }
+ 
+@@ -476,11 +479,11 @@
+         case CT_UNKWN:
+             break;
+         case CT_855GM:
+-            outl(0x8000005a, 0xcf8);
++            OUTL(0x8000005a, 0xcf8);
+             map->b1 = inb(0xcfe);
+             
+-            outl(0x8000005a, 0xcf8);
+-            outb(0x33, 0xcfe);
++            OUTL(0x8000005a, 0xcf8);
++            OUTB(0x33, 0xcfe);
+             break;
+         case CT_845G:
+         case CT_865G:
+@@ -488,13 +491,13 @@
+         case CT_915GM:
+         case CT_945G:
+         case CT_945GM:
+-            outl(0x80000090, 0xcf8);
++            OUTL(0x80000090, 0xcf8);
+             map->b1 = inb(0xcfd);
+             map->b2 = inb(0xcfe);
+             
+-            outl(0x80000090, 0xcf8);
+-            outb(0x33, 0xcfd);
+-            outb(0x33, 0xcfe);
++            OUTL(0x80000090, 0xcf8);
++            OUTB(0x33, 0xcfd);
++            OUTB(0x33, 0xcfe);
+             break;
+         }
+     }
+@@ -526,8 +529,8 @@
+         case CT_UNKWN:
+             break;
+         case CT_855GM:
+-            outl(0x8000005a, 0xcf8);
+-            outb(map->b1, 0xcfe);
++            OUTL(0x8000005a, 0xcf8);
++            OUTB(map->b1, 0xcfe);
+             break;
+         case CT_845G:
+         case CT_865G:
+@@ -535,9 +538,9 @@
+         case CT_915GM:
+         case CT_945G:
+         case CT_945GM:
+-            outl(0x80000090, 0xcf8);
+-            outb(map->b1, 0xcfd);
+-            outb(map->b2, 0xcfe);
++            OUTL(0x80000090, 0xcf8);
++            OUTB(map->b1, 0xcfd);
++            OUTB(map->b2, 0xcfe);
+             break;
+         }
+     }
--- patch-915resolution ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->lawrance 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Oct 15 11:10:27 UTC 2006 
Responsible-Changed-Why:  
Submitter has GNATS access 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104434 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sun Oct 15 11:10:41 UTC 2006 
State-Changed-Why:  
Awaiting maintainers feedback 

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

From: "Remington L" <mrl0lz@gmail.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/104434: sysutils/915resolution: depenguinate
Date: Mon, 16 Oct 2006 09:31:15 -0700

 This patch looks good, tested on 6.2-PRE with no issues.
 
 On Sun, 15 Oct 2006 11:10:37 UT, Edwin Groothuis <edwin@freebsd.org> wrote:
 > Maintainer of sysutils/915resolution,
 >
 > Please note that PR ports/104434 has just been submitted.
 >
 > If it contains a patch for an upgrade, an enhancement or a bug fix
 > you agree on, reply to this email stating that you approve the patch
 > and a committer will take care of it.
 >
 > The full text of the PR can be found at:
 >     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/104434
 >
 > --
 > Edwin Groothuis
 > edwin@FreeBSD.org
 >
State-Changed-From-To: feedback->open 
State-Changed-By: lawrance 
State-Changed-When: Mon Oct 16 20:27:12 UTC 2006 
State-Changed-Why:  
Maintainer approved (thanks!). 

I will commit this in the week after the ports freeze. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104434 
State-Changed-From-To: open->closed 
State-Changed-By: lawrance 
State-Changed-When: Tue Oct 31 07:05:20 UTC 2006 
State-Changed-Why:  
Committed, thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/104434: commit references a PR
Date: Tue, 31 Oct 2006 07:07:17 +0000 (UTC)

 lawrance    2006-10-31 07:07:11 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/915resolution Makefile pkg-descr 
   Added files:
     sysutils/915resolution/files patch-915resolution.c 
   Log:
   Build native nstead of installing a linux binary.
   Bump PORTREVISION for this change.
   
   PR:             ports/104434
   Approved by:    Remington L <mrl0lz@gmail.com> (maintainer)
   
   Revision  Changes    Path
   1.4       +6 -5      ports/sysutils/915resolution/Makefile
   1.1       +90 -0     ports/sysutils/915resolution/files/patch-915resolution.c (new)
   1.2       +1 -2      ports/sysutils/915resolution/pkg-descr
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
