Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 316671 - sys-apps/usbutils-{0.86-r,0.87} doesn't compile on Gentoo/FreeBSD
Summary: sys-apps/usbutils-{0.86-r,0.87} doesn't compile on Gentoo/FreeBSD
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High enhancement (vote)
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-22 13:57 UTC by MT
Modified: 2010-04-25 18:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
usbutils-0.87-r1.ebuild.patch (usbutils-0.87-r1.ebuild.patch,733 bytes, patch)
2010-04-22 14:00 UTC, MT
Details | Diff
usbutils-0.82-fbsd.patch (usbutils-0.82-fbsd.patch,453 bytes, patch)
2010-04-22 14:01 UTC, MT
Details | Diff
usbutils-0.86-r2.ebuild.patch (usbutils-0.86-r2.ebuild.patch,813 bytes, patch)
2010-04-22 14:10 UTC, MT
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description MT 2010-04-22 13:57:25 UTC
I get this error compiling sys-apps/usbutils on Gentoo/FreeBSD with profile 8.0:

>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-apps/usbutils-0.87-r1/work/usbutils-0.87 ...
gmake -j1 
gmake  all-am
gmake[1]: Entering directory `/var/tmp/portage/sys-apps/usbutils-0.87-r1/work/usbutils-0.87'
i686-gentoo-freebsd8.0-gcc -DHAVE_CONFIG_H -I.    -DDATADIR=\"/usr/share/misc\"   -O2 -march=i686 -mtune=i686 -pipe -w -g0 -MT lsusb-lsusb.o -MD -MP -MF .deps/lsusb-lsusb.Tpo -c -o lsusb-lsusb.o `test -f 'lsusb.c' || echo './'`lsusb.c
lsusb.c:35:22: error: byteswap.h: No such file or directory
lsusb.c: In function 'treedump':
lsusb.c:2970: error: 'R_OK' undeclared (first use in this function)
lsusb.c:2970: error: (Each undeclared identifier is reported only once
lsusb.c:2970: error: for each function it appears in.)
gmake[1]: *** [lsusb-lsusb.o] Error 1
gmake[1]: Leaving directory `/var/tmp/portage/sys-apps/usbutils-0.87-r1/work/usbutils-0.87'
gmake: *** [all] Error 2
 * ERROR: sys-apps/usbutils-0.87-r1 failed:
 *   emake failed
 * 
 * Call stack:
 *     ebuild.sh, line   48:  Called src_compile
 *   environment, line 2868:  Called _eapi2_src_compile
 *     ebuild.sh, line  640:  Called die
 * The specific snippet of code:
 *              emake || die "emake failed"
 * 
 * If you need support, post the output of 'emerge --info =sys-apps/usbutils-0.87-r1',
 * the complete build log and the output of 'emerge -pqv =sys-apps/usbutils-0.87-r1'.
 * This ebuild is from an overlay: '/var/cache/portage/overlays/'
 * The complete build log is located at '/var/tmp/portage/sys-apps/usbutils-0.87-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-apps/usbutils-0.87-r1/temp/environment'.
 * S: '/var/tmp/portage/sys-apps/usbutils-0.87-r1/work/usbutils-0.87'


This error happens for a missing 'unistd.h' include directive inside the file lsusb.c.

Attached there is an ebuild patch that fixes the issue. I have tested the new ebuild on Gentoo/FreeBSD and Gentoo/Linux (only x86 arch) and the package compiles and works as expected, but more testing is preferable.

I hope this is useful.
Mauro

p.s.: watching the existing fbsd patch set in portage I have noticed that it  adds to lsusb.c

+#ifndef __FreeBSD__
 #include <byteswap.h>
+#endif

instead to properly check the header existence using the autoconf macros and to use a more appropriated 'ifdef HAVE_BYTESWAP_H' directive inside the .c file, so I have rewritten that patch too; now the patch set is more portable (usbutils will compile not only on FreeBSD but also on all the Gentoo/*BSD and most probably also on Darwin and MACOSX).
Comment 1 MT 2010-04-22 14:00:32 UTC
Created attachment 228759 [details, diff]
usbutils-0.87-r1.ebuild.patch
Comment 2 MT 2010-04-22 14:01:12 UTC
Created attachment 228761 [details, diff]
usbutils-0.82-fbsd.patch
Comment 3 MT 2010-04-22 14:10:55 UTC
Created attachment 228765 [details, diff]
usbutils-0.86-r2.ebuild.patch
Comment 4 SpanKY gentoo-dev 2010-04-23 03:20:39 UTC
patch looks fine to me if BSD team wants to verify + commit
Comment 5 Alexis Ballier gentoo-dev 2010-04-25 18:02:26 UTC
(In reply to comment #4)
> patch looks fine to me if BSD team wants to verify + commit
> 

applied, thanks

ps: i had to change the sed to makefile.am for the .pc file location