Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 218261 - media-gfx/icns2png-0.7 - new ebuild
Summary: media-gfx/icns2png-0.7 - new ebuild
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Default Assignee for New Packages
URL: http://www.eisbox.net/dev/icns2png
Whiteboard:
Keywords:
Depends on:
Blocks: 218263
  Show dependency tree
 
Reported: 2008-04-18 13:24 UTC by Peter Alfredsen (RETIRED)
Modified: 2008-04-19 12:27 UTC (History)
0 users

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


Attachments
icns2png-0.7.ebuild (icns2png-0.7.ebuild,794 bytes, text/plain)
2008-04-18 13:25 UTC, Peter Alfredsen (RETIRED)
Details
icns2png-0.7.ebuild (icns2png-0.7.ebuild,863 bytes, text/plain)
2008-04-18 15:09 UTC, Peter Alfredsen (RETIRED)
Details
icns2png-0.7.ebuild (icns2png-0.7.ebuild,823 bytes, text/plain)
2008-04-18 23:58 UTC, Peter Alfredsen (RETIRED)
Details
icns2png-0.7.ebuild (icns2png-0.7.ebuild,779 bytes, text/plain)
2008-04-19 12:12 UTC, Peter Alfredsen (RETIRED)
Details
icns2png-0.7-gentoo.patch (icns2png-0.7-gentoo.patch,1.26 KB, patch)
2008-04-19 12:12 UTC, Peter Alfredsen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Alfredsen (RETIRED) gentoo-dev 2008-04-18 13:24:21 UTC
icns2png converts .icns files to .png files.

Reproducible: Always

Steps to Reproduce:
Comment 1 Peter Alfredsen (RETIRED) gentoo-dev 2008-04-18 13:25:48 UTC
Created attachment 150169 [details]
icns2png-0.7.ebuild
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-04-18 14:34:56 UTC
You should _not_ pass libraries (-l*) through LDFLAGS.
Comment 3 Peter Alfredsen (RETIRED) gentoo-dev 2008-04-18 15:09:44 UTC
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"
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-04-18 23:00:28 UTC
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.
Comment 5 Peter Alfredsen (RETIRED) gentoo-dev 2008-04-18 23:58:04 UTC
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"
Comment 6 Peter Alfredsen (RETIRED) gentoo-dev 2008-04-19 12:12:04 UTC
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.
Comment 7 Peter Alfredsen (RETIRED) gentoo-dev 2008-04-19 12:12:30 UTC
Created attachment 150287 [details, diff]
icns2png-0.7-gentoo.patch
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2008-04-19 12:27:58 UTC
+*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.