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

Bug 490266

Summary: =sys-apps/gawk-4.1.0 defines _XOPEN_SOURCE_EXTENDED without value, breaking ppc-aix (Prefix)
Product: Gentoo Linux Reporter: Michael Haubenwallner (RETIRED) <haubi>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: AIX   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Two upstream patches for portability, mainly for AIX.

Description Michael Haubenwallner (RETIRED) gentoo-dev 2013-11-03 13:36:18 UTC
http://lists.gnu.org/archive/html/bug-gawk/2013-10/msg00038.html

Even if the upstream submitted patch contains conditionals, it is enough to just add the value when defining _XOPEN_SOURCE_EXTENDED:

--- gawk-4.1.0.ebuild
+++ gawk-4.1.0.ebuild
@@ -22,6 +22,9 @@
        nls? ( sys-devel/gettext )"
 
 src_prepare() {
+       # http://lists.gnu.org/archive/html/bug-gawk/2013-10/msg00038.html
+       sed -i -e '/_XOPEN_SOURCE_EXTENDED$/s/$/ 1/' extension/inplace.c
+
        # use symlinks rather than hardlinks, and disable version links
        sed -i \
                -e '/^LN =/s:=.*:= $(LN_S):' \

Thank you!
Comment 1 Michael Haubenwallner (RETIRED) gentoo-dev 2013-11-12 20:44:02 UTC
There's one more sed necessary for AIX (not reported upstream yet) to get the extension modules working:

 src_prepare() {
+       # http://lists.gnu.org/archive/html/bug-gawk/2013-10/msg00038.html
+       sed -i -e '/_XOPEN_SOURCE_EXTENDED$/s/$/ 1/' extension/inplace.c
+
+       # AIX ignores _BSD_SOURCE, needs _BSD instead
+       sed -i -e '/_BSD_SOURCE/a#define _BSD' extension/*.c
+
        # use symlinks rather than hardlinks, and disable version links
        sed -i \
                -e '/^LN =/s:=.*:= $(LN_S):' \
Comment 2 Michael Haubenwallner (RETIRED) gentoo-dev 2013-11-14 14:33:54 UTC
Created attachment 363260 [details, diff]
Two upstream patches for portability, mainly for AIX.

Now with that two upstream commits doing things slightly different merged into one patch:

--- gawk-4.1.0.ebuild   13 May 2013 22:13:19 -0000      1.1
+++ gawk-4.1.0.ebuild   14 Nov 2013 14:32:23 -0000
@@ -22,6 +22,8 @@
        nls? ( sys-devel/gettext )"
 
 src_prepare() {
+       epatch "${FILESDIR}/${PN}-4.1.0-ports.patch" #490266
+
        # use symlinks rather than hardlinks, and disable version links
        sed -i \
                -e '/^LN =/s:=.*:= $(LN_S):' \
Comment 3 Michael Haubenwallner (RETIRED) gentoo-dev 2013-11-18 16:11:43 UTC
Without complaints, I plan to commit this by the end of this week.
Comment 4 Tony Vroon (RETIRED) gentoo-dev 2013-11-18 19:23:24 UTC
Please proceed, that looks sensible. And yes, I prefer the diff over the sed.
Comment 5 Michael Haubenwallner (RETIRED) gentoo-dev 2013-11-19 09:04:37 UTC
Thank you!