icns2png converts .icns files to .png files. Reproducible: Always Steps to Reproduce:
Created attachment 150169 [details] icns2png-0.7.ebuild
You should _not_ pass libraries (-l*) through LDFLAGS.
Created attachment 150177 [details] icns2png-0.7.ebuild I'm not really trying to do that, but I see your point. It shouldn't be hardcoded like this. The problem is that if I just pass LDFLAGS to make, the build dies horribly. But if I pass the link flags together with the LDFLAGS, it succeds. So what I've done in this iteration is to get the linkerflags from the Makefile in case they change in a later version and pass them like that with the LDFLAGS. Diff from last time: --- icns2png-0.7.ebuild.old 2008-04-18 17:02:27.000000000 +0200 +++ icns2png-0.7.ebuild 2008-04-18 17:04:10.000000000 +0200 @@ -18,16 +18,17 @@ S="${WORKDIR}/${PN}" src_unpack() { unpack ${A} cd "${S}" + LDLINKFLAGS="$(grep "^LDFLAGS" Makefile)" sed -i -r -e '/^CFLAGS/d; /^LDFLAGS/d; /^CC=/d ' \ - Makefile + Makefile || die } src_compile() { - emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS} -lpng12 -lz -lm" CFLAGS="${CFLAGS}"||die + emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}${LDLINKFLAGS#*=}" CFLAGS="${CFLAGS}" || die "emake failed" } src_install() { dodir /usr/bin emake prefix="${D}/usr/" install || die "emake install failed"
Hm no this is not what I meant. You should probably patch, rather than sed, the Makefile, so that it uses this form for linking: $(CC) $(LDFLAGS) -o $@ $< -lfoo -lbar libraries should be at the end, LDFLAGS at the start.
Created attachment 150246 [details] icns2png-0.7.ebuild Hrm... I dislike diffs for something as small as this. What do you think of this: Diff against the very first ebuild. --- icns2png-0.7.ebuild.old 2008-04-18 17:02:27.000000000 +0200 +++ icns2png-0.7.ebuild 2008-04-19 01:52:46.000000000 +0200 @@ -18,16 +18,18 @@ S="${WORKDIR}/${PN}" src_unpack() { unpack ${A} cd "${S}" - sed -i -r -e '/^CFLAGS/d; /^LDFLAGS/d; /^CC=/d ' \ - Makefile + sed -i -r \ + -e '/^CCFLAGS/d; /^CC=/d ' \ + -e 's/LDFLAGS/LINKFLAGS/' \ + Makefile || die } src_compile() { - emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS} -lpng12 -lz -lm" CFLAGS="${CFLAGS}"||die + emake CC="$(tc-getCC)" CFLAGS="${CFLAGS} -Xlinker ${LDFLAGS}" || die "emake failed" } src_install() { dodir /usr/bin emake prefix="${D}/usr/" install || die "emake install failed"
Created attachment 150286 [details] icns2png-0.7.ebuild As always, Diego proves himself to be totally right. This ebuild uses a patch. Tested w/ and w/o LDFLAGS, and in every other combination I could think of. This should work. The previous one lead to undefined behaviour.
Created attachment 150287 [details, diff] icns2png-0.7-gentoo.patch
+*icns2png-0.7 (19 Apr 2008) + + 19 Apr 2008; Samuli Suominen <drac@gentoo.org> + +files/icns2png-0.7-Makefile.patch, +icns2png-0.7.ebuild: + Initial commit for bug 218261, thanks to Peter Alfredsen.