Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 465426 - x11-libs/motif-2.3.4-r1: remove conditional for Solaris patch
Summary: x11-libs/motif-2.3.4-r1: remove conditional for Solaris patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Solaris
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-10 18:38 UTC by Ulrich Müller
Modified: 2013-05-13 20:02 UTC (History)
0 users

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


Attachments
files/motif-2.3.4-solaris-2.11.patch (motif-2.3.4-solaris-2.11.patch,422 bytes, patch)
2013-04-28 18:34 UTC, Ulrich Müller
Details | Diff
Diff for motif-2.3.4-r1.ebuild (motif-2.3.4-r1.ebuild.diff,799 bytes, patch)
2013-04-28 18:41 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2013-04-10 18:38:19 UTC
The ebuild applies a patch for Solaris 11:

        [[ ${CHOST} == *-solaris2.11 ]] \
                && epatch "${FILESDIR}/${PN}-2.3.2-solaris-2.11.patch"

I'd like to get rid of this conditional patch, because it prevents me from moving the patches into a patchset. If possible, the check should be done with preprocessor conditionals instead (and the issue should be reported upstream).

Above code originates from the Prefix overlay:
http://overlays.gentoo.org/proj/alt/changeset/31404
Comment 1 Fabian Groffen gentoo-dev 2013-04-14 14:33:53 UTC
It doesn't compile without the patch, need to check if it actually does with the patch.  Nevertheless I don't see why this patch would need to be conditional unless it breaks Solaris 10.  It shouldn't break linux for as far as I can tell.
Comment 2 Fabian Groffen gentoo-dev 2013-04-24 20:04:38 UTC
on OpenIndiana:
- installs with patch
- fails without patch:

/gentoo/prefix64/var/tmp/portage/x11-libs/motif-2.3.4-r1/work/motif-2.3.4/lib/Xm/Xmos.c: In function ‘_XmOSGetDirEntries’:
/gentoo/prefix64/var/tmp/portage/x11-libs/motif-2.3.4-r1/work/motif-2.3.4/lib/Xm/Xmos.c:805:7: error: too few arguments to function ‘readdir_r’
In file included from /gentoo/prefix64/var/tmp/portage/x11-libs/motif-2.3.4-r1/work/motif-2.3.4/lib/Xm/../Xm/Xmos_r.h:549:0,
                 from /gentoo/prefix64/var/tmp/portage/x11-libs/motif-2.3.4-r1/work/motif-2.3.4/lib/Xm/Xmos.c:92:
/usr/include/dirent.h:234:12: note: declared here
make[3]: *** [Xmos.lo] Error 1

on Solaris 10:
- installs without patch
- fails with patch:

/gentoo/prefix64/var/tmp/portage/x11-libs/motif-2.3.4-r1/work/motif-2.3.4/lib/Xm/Xmos.c: In function ‘_XmOSGetDirEntries’:
/gentoo/prefix64/var/tmp/portage/x11-libs/motif-2.3.4-r1/work/motif-2.3.4/lib/Xm/Xmos.c:805:7: error: too many arguments to function ‘readdir_r’
In file included from /gentoo/prefix64/var/tmp/portage/x11-libs/motif-2.3.4-r1/work/motif-2.3.4/lib/Xm/../Xm/Xmos_r.h:549:0,
                 from /gentoo/prefix64/var/tmp/portage/x11-libs/motif-2.3.4-r1/work/motif-2.3.4/lib/Xm/Xmos.c:92:
/usr/include/dirent.h:234:12: note: declared here
make[3]: *** [Xmos.lo] Error 1
Comment 3 Ulrich Müller gentoo-dev 2013-04-25 12:05:55 UTC
(In reply to comment #2)
> on OpenIndiana:
> [...]
> error: too few arguments to function ‘readdir_r’

> on Solaris 10:
> [...]
> error: too many arguments to function ‘readdir_r’

Darn. I see two ways to fix it:
- Find a macro that allows us to identify Solaris 10
- Write a configure test that finds out how many arguments are needed for
  readdir_r
Comment 4 Fabian Groffen gentoo-dev 2013-04-27 07:34:55 UTC
I'd say the configure check is the way to go
Comment 5 Ulrich Müller gentoo-dev 2013-04-28 18:34:02 UTC
Created attachment 346802 [details, diff]
files/motif-2.3.4-solaris-2.11.patch
Comment 6 Ulrich Müller gentoo-dev 2013-04-28 18:41:17 UTC
Created attachment 346804 [details, diff]
Diff for motif-2.3.4-r1.ebuild

(In reply to comment #4)
> I'd say the configure check is the way to go

Looking into the issue, it turns out that the configure check would involve compiling some test programs, and the header files for them (dirent.h vs sys/dir.h vs sys/ndir.h etc.) are themselves system dependent. Also the configure test would be needed only for the case when <X11/Xos_r.h> doesn't exist. Testing for a symbol defined by the ebuild is much easier.

Can you test if attached patches work?
Comment 7 Fabian Groffen gentoo-dev 2013-05-13 19:09:14 UTC
patches work on OpenIndiana/OpenSolaris 5.11
patches work on Solaris 10
Comment 8 Ulrich Müller gentoo-dev 2013-05-13 20:02:14 UTC
Committed. Thanks for testing.