--- unzip-6.0-r1.ebuild +++ unzip-6.0-r1.ebuild @@ -24,21 +24,7 @@ src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}"/${P}-no-exec-stack.patch - sed -i \ - -e '/^CFLAGS/d' \ - -e '/CFLAGS/s:-O[0-9]\?:$(CFLAGS) $(CPPFLAGS):' \ - -e '/^STRIP/s:=.*:=true:' \ - -e "s:CC=gcc :CC=$(tc-getCC) :" \ - -e "s:LD=gcc :LD=$(tc-getCC) :" \ - -e "s:AS=gcc :AS=$(tc-getCC) :" \ - -e 's:LF2 = -s:LF2 = :' \ - -e 's:LF = :LF = $(LDFLAGS) :' \ - -e 's:SL = :SL = $(LDFLAGS) :' \ - -e 's:FL = :FL = $(LDFLAGS) :' \ - -e "/^#L_BZ2/s:^$(use bzip2 && echo .)::" \ - -e 's:STRIP =.*$:STRIP = true:' \ - unix/Makefile \ - || die "sed unix/Makefile failed" + [[ ${CHOST} == *-irix* ]] && epatch "${FILESDIR}"/${P}-irix.patch } src_compile() { @@ -59,11 +45,29 @@ src_compile() { esac [[ ${CHOST} == *linux* ]] && append-cppflags -DNO_LCHMOD + [[ ${CHOST} == *-irix* ]] && append-cppflags -DNO_LCHMOD use bzip2 && append-cppflags -DUSE_BZIP2 use unicode && append-cppflags -DUNICODE_SUPPORT -DUNICODE_WCHAR -DUTF8_MAYBE_NATIVE append-lfs-flags #104315 append-cppflags -DLARGE_FILE_SUPPORT #281473 + sed -i \ + -e '/^CFLAGS/d' \ + -e '/CFLAGS/s!-O[0-9]\?!$(CFLAGS) $(CPPFLAGS)!' \ + -e '/^STRIP/s!=.*!=true!' \ + -e "s!CC=gcc !CC=$(tc-getCC) !" \ + -e "s!LD=gcc !LD=$(tc-getCC) !" \ + -e "s!CF = \$(CFLAGS) \$(CF_NOOPT)!CF = \$(CFLAGS) \$(CF_NOOPT) \$(CPPFLAGS)!" \ + -e "s!AS=gcc !AS=$(tc-getCC) !" \ + -e 's!LF2 = -s!LF2 = !' \ + -e 's!LF = !LF = $(LDFLAGS) !' \ + -e 's!SL = !SL = $(LDFLAGS) !' \ + -e 's!FL = !FL = $(LDFLAGS) !' \ + -e "/^#L_BZ2/s!^$(use bzip2 && echo .)!!" \ + -e 's!STRIP =.*$!STRIP = true!' \ + unix/Makefile \ + || die "sed unix/Makefile failed" + emake \ -f unix/Makefile \ ${TARGET} || die "emake failed"
Created attachment 201772 [details, diff] unzip-6.0-irix.patch Prevent IRIX build failures.
why the move of this sed statement?
Note that the ':'s in the sed statement have been changed to '!'s, so as not to trip over potential colons in IRIX CFLAGS. As it was, it looked a little odd... the current ebuild inserts $CFLAGS and $CPPFLAGS into unix/Makefile, and *then* uses append-flags/append-cppflags. This way around all of the append-*flags stuff is done, and *then* the "$CFLAGS $CPPFLAGS" are pushed into unix/Makefile. Also, the additional change to the CF variable won't work if the sed statement appears higher up. But then, I could be missing something ;)
(In reply to comment #3) > Note that the ':'s in the sed statement have been changed to '!'s, so as not to > trip over potential colons in IRIX CFLAGS. This is problematic for Gentoo in general. It will be hard to 'mandate' to not use ":" in sed statements... =/
(In reply to comment #4) > This is problematic for Gentoo in general. It will be hard to 'mandate' to not > use ":" in sed statements... =/ Sure, but if a change to teh ebuild is needed anyway, then I can't see it doing any harm (since I'm guessing that absolutely no-one uses '!' or '|' in their CFLAGS!) - and that way it'll spread... eventually. (At the same time, perhaps there *should* be a GLEP stating that ':' should not be used when modifying CFLAGS, just as any character which could break on any platform should be avoided) Actually, the list of potentially affected packages in prefix is not great: app-arch/pbzip2 app-arch/unarj app-crypt/aesutil app-doc/doxygen app-editors/elvis app-editors/hteditor app-editors/levee app-misc/ondir app-text/highlight app-text/ispell dev-lang/ferite dev-libs/cyrus-sasl dev-libs/libmemcached dev-libs/zziplib dev-util/darcs dev-util/qgit dev-util/valgrind gnome-base/gnome-keyring mail-client/mailx mail-client/pine mail-filter/procmail mail-mta/ssmtp media-gfx/tic98 media-gfx/xloadimage media-libs/aalib media-libs/ladspa-sdk media-libs/urt sci-biology/mrbayes sci-chemistry/tinker sys-devel/flex sys-power/powertop x11-libs/gtk+ x11-libs/qt-core x11-plugins/bfm ... and many of these may not even be affected (or indeed, in cases such as powertop, even work on non-Linux platforms ;)
Sorry, I should have been more specific. I, personally, don't mind to change the sed statement. I just think it will be difficult to enforce that amongst Gentoo developers, so we don't have to constantly "fix" it. A GLEP is probably a good idea. Are you interested in drafting that? We could start by filing a new bug to get the conversation off of this one. Or the mailing list. I guess this needs to be done in tandem with adding IRIX support to Prefix. Do you have a handle on the number of Prefix/IRIX users out there? I think you are pretty active in some forums, right?
your interpretation of the sed is incorrect. you missed the difference in quoting (single vs double). no flags are inserted in the src_unpack stage.
(In reply to comment #7) > your interpretation of the sed is incorrect. you missed the difference in > quoting (single vs double). no flags are inserted in the src_unpack stage. > Ah, I see - my bad. Please note that the additional: -e "s!CF = \$(CFLAGS) \$(CF_NOOPT)!CF = \$(CFLAGS) \$(CF_NOOPT) \$(CPPFLAGS)!" \ ... still needs to be present for IRIX, however.
on darwin too
sed statement added, IRIX patch added. closing
Can somebody comment if the +# ifndef __sgi +# define _LARGEFILE_SOURCE /* some OSes need this for fseeko */ +# define _LARGEFILE64_SOURCE +# endif is really necessary? Is there a problem with defining _LARGEFILE_SOURCE on irix?