! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[FreeBSD] Fix build on amd64
Status:
RESOLVED: FIXED
Product:
Xfce4-battery-plugin
Component:
General

Comments

Description Martin Wilke 2008-01-21 12:24:47 CET
The battery plugin is currently i386 only and failes to build on amd64 because apm is not available there. This patch enables apm only for i386 and fixes some apm variable declarations which makes it build and usable on amd64.

(submitted by:Bernhard Froehlich <decke@bluelife.at>)
Comment 1 Martin Wilke 2008-01-21 12:25:58 CET
Created attachment 1496 
patch

here the patch
Comment 2 Yves-Alexis Perez editbugs 2008-01-21 19:39:16 CET
This patch doesn't seem sufficient, at least on Debian/kfreebsd-amd64:

cc -DHAVE_CONFIG_H -I. -I.. -I.. -DG_LOG_DOMAIN=\"xfce4-battery-plugin\" -DPACKAGE_LOCALE_DIR=\"/usr/share/locale\"    -DPNG_NO_MMX_CODE -I/usr/include/xfce4/ -I/usr/include/xfce4 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/atk-1.0   -DPNG_NO_MMX_CODE -I/usr/include/xfce4 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/atk-1.0   -I/usr/include/xfce4 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -DPNG_NO_MMX_CODE -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12    -g -Wall -O2 -c -o xfce4_battery_plugin-battery.o `test -f 'battery.c' || echo './'`battery.c
In file included from battery.c:29:
/usr/include/machine/apm_bios.h:8:3: error: #error This header is not available for amd64
battery.c: In function ‘update_apm_status’:
battery.c:313: error: storage size of ‘apm’ isn’t known
battery.c:313: warning: unused variable ‘apm’
make[3]: *** [xfce4_battery_plugin-battery.o] Error 1
make[3]: Leaving directory `/home/corsac/xfce/xfce4-battery-plugin-0.5.0/panel-plugin'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/corsac/xfce/xfce4-battery-plugin-0.5.0'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/corsac/xfce/xfce4-battery-plugin-0.5.0'
make: *** [debian/stamp-makefile-build] Error 2
debuild: fatal error at line 1237:
debian/rules build failed


Anyway, the patch comment says it enables apm only for i386 but I can't see anything in it doing that.
Is it the good one?

Cheers
Comment 3 Bernhard Fröhlich 2008-01-23 09:04:38 CET
Created attachment 1498 
this is the right patch now

I'm sorry, this is the right patch now. The other one seems to be a different one not related to this problem.
Comment 4 Yves-Alexis Perez editbugs 2008-01-24 21:37:48 CET
Your patch will break linux builds (where apm is present but APMDEVICE is not)
Comment 5 Yves-Alexis Perez editbugs 2008-01-24 22:08:50 CET
Attached patch builds on kfreebsd-amd64 and linux-amd64.

Cheers,
Comment 6 Yves-Alexis Perez editbugs 2008-01-24 22:09:43 CET
Created attachment 1501 
Patch fixing build on kfreebsd-amd64, works on linux
Comment 7 Florian Rivoal editbugs 2010-12-27 04:11:05 CET
patch applied with minor modifications. Thanks

Bug #3811

Reported by:
Martin Wilke
Reported on: 2008-01-21
Last modified on: 2010-12-27

People

Assignee:
Xfce-Goodies Maintainers
CC List:
3 users

Version

Version:
0.5.1 or older

Attachments

patch (674 bytes, application/octet-stream)
2008-01-21 12:25 CET , Martin Wilke
no flags
this is the right patch now (696 bytes, patch)
2008-01-23 09:04 CET , Bernhard Fröhlich
no flags
Patch fixing build on kfreebsd-amd64, works on linux (948 bytes, patch)
2008-01-24 22:09 CET , Yves-Alexis Perez
no flags

Additional information