From nobody@FreeBSD.org  Thu Sep 11 01:19:40 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5FA8B106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 11 Sep 2008 01:19:40 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 4D3738FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 11 Sep 2008 01:19:40 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m8B1JdOi071592
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 11 Sep 2008 01:19:39 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m8B1JdmS071591;
	Thu, 11 Sep 2008 01:19:39 GMT
	(envelope-from nobody)
Message-Id: <200809110119.m8B1JdmS071591@www.freebsd.org>
Date: Thu, 11 Sep 2008 01:19:39 GMT
From: Carlos Santos <unixmania@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: sysutils/xfce4-battery-plugin build on non-i386 again
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         127282
>Category:       ports
>Synopsis:       sysutils/xfce4-battery-plugin build on non-i386 again
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 11 01:20:02 UTC 2008
>Closed-Date:    Mon Sep 15 10:46:40 UTC 2008
>Last-Modified:  Mon Sep 15 10:46:40 UTC 2008
>Originator:     Carlos Santos
>Release:        7_STABLE
>Organization:
Not applicable
>Environment:
FreeBSD casantos.casantos.org 7.0-STABLE FreeBSD 7.0-STABLE #4: Thu Jul 17 21:07:23 BRT 2008     root@casantos.casantos.org:/local/FreeBSD/src-stable/sys/amd64/compile/HP_NX6320_70_AMD64  amd64
>Description:
The upgrade to version 0.5.1 disabled the build for AMD64 that was enabled by PR #125514. I guess that this was because of a potential build failure because panel-plugin/battery.c attempts to include machine/apm_bios.h. APM is available only on i386 but the plugin can use ACPI, that is available on other platforms.
>How-To-Repeat:
Try to build sysutils/xfce4-battery-plugin as of Fri Sep 5 14:15:36 2008 UTC on AMD64.
>Fix:
Apply the attached patch. It makes the inclusion of machine/apm_bios.h conditional to the i386 architecture.

Patch attached with submission follows:

diff -dur xfce4-battery-plugin.orig/Makefile xfce4-battery-plugin/Makefile
--- xfce4-battery-plugin.orig/Makefile	2008-09-05 11:15:36.000000000 -0300
+++ xfce4-battery-plugin/Makefile	2008-09-10 21:36:11.000000000 -0300
@@ -7,6 +7,7 @@
 
 PORTNAME=	xfce4-battery-plugin
 PORTVERSION=	0.5.1
+PORTREVISION=	1
 CATEGORIES=	sysutils xfce
 MASTER_SITES=	http://goodies.xfce.org/releases/${PORTNAME}/
 DIST_SUBDIR=	xfce4
@@ -14,8 +15,6 @@
 MAINTAINER=	miwi@FreeBSD.org
 COMMENT=	Battery monitor panel plugin for XFce4
 
-ONLY_FOR_ARCHS=	i386
-
 GNU_CONFIGURE=	yes
 USE_BZIP2=	yes
 USE_GETTEXT=	yes
diff -dur xfce4-battery-plugin.orig/files/patch-panel-plug-battery.c xfce4-battery-plugin/files/patch-panel-plug-battery.c
--- xfce4-battery-plugin.orig/files/patch-panel-plug-battery.c	2008-09-06 20:07:25.000000000 -0300
+++ xfce4-battery-plugin/files/patch-panel-plug-battery.c	2008-09-10 21:54:59.000000000 -0300
@@ -1,6 +1,16 @@
---- panel-plugin/battery.c.orgi	2008-09-04 22:53:40.000000000 +0200
-+++ panel-plugin/battery.c	2008-09-05 10:02:08.000000000 +0200
-@@ -163,7 +163,9 @@
+--- panel-plugin/battery.c.orig	2008-09-04 17:53:40.000000000 -0300
++++ panel-plugin/battery.c	2008-09-10 21:53:56.000000000 -0300
+@@ -26,7 +26,9 @@
+ #endif
+ 
+ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++#if defined(__i386___)
+ #include <machine/apm_bios.h>
++#endif
+ #elif __OpenBSD__
+ #include <sys/param.h>
+ #include <machine/apmvar.h>
+@@ -163,7 +165,9 @@
       except that is does not work on FreeBSD
  
    */
@@ -10,7 +20,7 @@
        int fd;
  
      /* First check to see if ACPI is available */
-@@ -310,7 +312,9 @@
+@@ -310,7 +314,9 @@
        acline = apm.ac_state ? TRUE : FALSE;
  
  #else
@@ -21,7 +31,7 @@
      DBG ("Updating battery status...");
  
      if(battmon->method == BM_BROKEN) {
-@@ -382,6 +386,7 @@
+@@ -382,6 +388,7 @@
            rate = last_rate;
          }
  
@@ -29,7 +39,7 @@
          charge = (((float)ccapacity)/((float)lcapacity))*100;
  
          if ( last_acline )
-@@ -394,6 +399,17 @@
+@@ -394,6 +401,17 @@
  
          last_acline = acline;
  


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Sep 11 01:20:12 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127282 
State-Changed-From-To: open->closed 
State-Changed-By: miwi 
State-Changed-When: Mon Sep 15 10:46:39 UTC 2008 
State-Changed-Why:  
was committed few days ago. Thanks for your submission. 

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