Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 438608 - media-gfx/graphicsmagick-1.3.17 - ./magick/studio.h:54:36: error: missing binary operator before token ".0"
Summary: media-gfx/graphicsmagick-1.3.17 - ./magick/studio.h:54:36: error: missing bin...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: HPPA Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2012-10-16 17:27 UTC by Jeroen Roovers (RETIRED)
Modified: 2021-02-07 00:38 UTC (History)
2 users (show)

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


Attachments
files/graphicsmagick-1.3.17-ppc.patch (graphicsmagick-1.3.17-ppc.patch,773 bytes, patch)
2012-10-16 19:52 UTC, Jeroen Roovers (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2012-10-16 17:27:37 UTC
In file included from coders/art.c:36:0:
./magick/studio.h:54:36: error: missing binary operator before token ".0"

This is because of MAGICK_TARGET_CPU being set to $host_cpu, which on an hppa2.0-unknown-linux-gnu target means the dot is included. We could filter it out with a simple configure patch.

A configure.ac patch is included as well, but then aclocal complains that it wants sys-devel/autoconf-2.69.

--- graphicsmagick-1.3.17.ebuild        15 Oct 2012 06:03:16 -0000      1.1
+++ graphicsmagick-1.3.17.ebuild        16 Oct 2012 17:26:35 -0000
@@ -3,7 +3,7 @@
 # $Header: /var/cvsroot/gentoo-x86/media-gfx/graphicsmagick/graphicsmagick-1.3.17.ebuild,v 1.1 2012/10/15 06:03:16 radhermit Exp $
 
 EAPI=5
-inherit toolchain-funcs
+inherit eutils toolchain-funcs
 
 MY_P=${P/graphicsm/GraphicsM}
 
@@ -44,6 +44,10 @@
 
 S=${WORKDIR}/${MY_P}
 
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-hppa.patch
+}
+
 src_configure() {
        local depth=8
        use q16 && depth=16

--- a/configure.ac
+++ b/configure.ac
@@ -46,7 +46,7 @@
 dnl Compute the canonical host (run-time) system type variable
 AC_CANONICAL_HOST
 
-MAGICK_TARGET_CPU=$host_cpu
+MAGICK_TARGET_CPU=${host_cpu/./}
 AC_SUBST(MAGICK_TARGET_CPU)
 AC_DEFINE_UNQUOTED(MAGICK_TARGET_CPU,$MAGICK_TARGET_CPU,[Target Host CPU])
 
--- a/configure
+++ b/configure
@@ -3221,7 +3221,7 @@
 
 
 
-MAGICK_TARGET_CPU=$host_cpu
+MAGICK_TARGET_CPU=${host_cpu/./}
 
 
 cat >>confdefs.h <<_ACEOF
Comment 1 SpanKY gentoo-dev 2012-10-16 17:48:24 UTC
${var/replace} is a bash extension, so that won't cut it

looking at the code that actually uses MAGICK_TARGET_CPU, i see it is crap.  it is expanded in exactly one place (which you quoted):
magick/studio.h:#if defined(MAGICK_TARGET_CPU) && (MAGICK_TARGET_CPU == powerpc)

replace it with a simple:
#ifdef __powerpc__
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2012-10-16 19:52:05 UTC
Created attachment 326716 [details, diff]
files/graphicsmagick-1.3.17-ppc.patch

(In reply to comment #1)
> ${var/replace} is a bash extension, so that won't cut it

It isn't the only use of a bash extension in configure{,.ac}, I think.

> replace it with a simple:
> #ifdef __powerpc__
Comment 3 SpanKY gentoo-dev 2012-10-18 22:33:49 UTC
Comment on attachment 326716 [details, diff]
files/graphicsmagick-1.3.17-ppc.patch

>-MAGICK_TARGET_CPU=$host_cpu
>-AC_SUBST(MAGICK_TARGET_CPU)

you'll need to keep these two lines.  the makefile uses them when invoking rpm related code.  not relevant to us, but upstream might get upset if you broke it :).
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2013-07-21 14:22:57 UTC
I have applied the (shortened) patch to 1.3.18 for bug #477606. Would anyone like to push this upstream?
Comment 5 Agostino Sarubbo gentoo-dev 2016-09-26 12:23:30 UTC
The ppc patch in tree was pushed upstream here:
http://hg.code.sf.net/p/graphicsmagick/code/rev/20f96db7e5a1