Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 367119

Summary: app-text/ghostscript-gpl-9.02 includes byteswap.h which does not exist on FreeBSD
Product: Gentoo/Alt Reporter: Johan Hattne <johan>
Component: FreeBSDAssignee: Gentoo/BSD Team <bsd+disabled>
Status: RESOLVED FIXED    
Severity: normal CC: printing
Priority: Normal    
Version: unspecified   
Hardware: x86   
OS: FreeBSD   
See Also: http://bugs.ghostscript.com/show_bug.cgi?id=692211
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Fix include of byteswap.h, non-existant on FreeBSD
files/ghostscript-gpl-9.02-byteswap.patch
ghostscript-gpl-9.02.ebuild.patch

Description Johan Hattne 2011-05-13 18:08:40 UTC
app-text/ghostscript-gpl-9.02 uses byteswap.h, even though it seems to have code in place to use GCC's built-in byte swapping functions.  FreeBSD's libc does not come with byteswap.h.

Reproducible: Always

Steps to Reproduce:
1. emerge ghostscript-gpl

Actual Results:  
i686-gentoo-freebsd8.0-gcc  -DHAVE_MKSTEMP -DHAVE_HYPOT   -DHAVE_FONTCONFIG  -DHAVE_SETLOCALE -DHAVE_SSE2  -fPIC  -O2 -fPIC -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long long" -march=pentium4 -O2 -pipe -fomit-frame-pointer -DUSE_LIBICONV_GNU -DUSE_LIBPAPER -DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\"/usr/lib/ghostscript/9.02\" -I./psi -I./obj/../soobj -I./obj/../soobj -I./base  -o ./obj/../soobj/zchar1.o -c ./psi/zchar1.c
In file included from ./base/gxdevcli.h:27:0,
                 from ./base/gxdevice.h:21,
                 from ./psi/zchar1.c:22:
./base/gsropt.h:386:22: fatal error: byteswap.h: No such file or directory
compilation terminated.


Expected Results:  
ghostscript-gpl merged.

Attached patch addresses the problem.  The issue appears to be present in upstream's repository as well, but I haven't been in touch with them.  I can do that if you wish.
Comment 1 Johan Hattne 2011-05-13 18:11:01 UTC
Created attachment 273125 [details, diff]
Fix include of byteswap.h, non-existant on FreeBSD
Comment 2 Naohiro Aota gentoo-dev 2011-05-18 02:25:22 UTC
It would be better to fix the code to work not only on FreeBSD but also any system (including FreeBSD).

And it is great to contact with upstream people. It help our work a lot.
Comment 3 Johan Hattne 2011-05-18 15:49:55 UTC
(In reply to comment #2)
> It would be better to fix the code to work not only on FreeBSD but also any
> system (including FreeBSD).

Tested the patch on amd64 and ~x86-linux.

> And it is great to contact with upstream people. It help our work a lot.

Done, it's at

  http://bugs.ghostscript.com/show_bug.cgi?id=692211
Comment 4 Naohiro Aota gentoo-dev 2011-07-27 08:31:09 UTC
Created attachment 281105 [details, diff]
files/ghostscript-gpl-9.02-byteswap.patch

patch to solve this problem on 9.02 (a little modified version of the above upstream bug's patch)
Comment 5 Naohiro Aota gentoo-dev 2011-07-27 08:35:37 UTC
Created attachment 281107 [details, diff]
ghostscript-gpl-9.02.ebuild.patch

printing team,

I'd like to have this patch applied to the ebuild. This patch apply
the above patch to the source tree. As it's mentioned, the patch is
based on upstream patch. Any comments?
Comment 6 Timo Gurr (RETIRED) gentoo-dev 2011-07-27 10:27:30 UTC
(In reply to comment #5)
> I'd like to have this patch applied to the ebuild. This patch apply
> the above patch to the source tree. As it's mentioned, the patch is
> based on upstream patch. Any comments?

Looks good to me, thanks, especially for taking this upstream! Feel free to commit your changes.
Comment 7 Naohiro Aota gentoo-dev 2011-08-05 10:57:37 UTC
Applied in CVS. Thanks!