Summary: | sci-libs/gdal-1.11.1-r1 - include/python/ogr_python.i:127: Error: Unknown SWIG preprocessor directive: To | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Juergen Rose <rose> |
Component: | [OLD] Library | Assignee: | Sci-geo Project <sci-geosciences> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | blackhack, ludovic.bellier, maggu2810, mark+gentoobugs, Martin.vGagern, phobosk, rob |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Patch proposed upstream
Patch from upstream 1.11 branch |
Description
Juergen Rose
2015-01-01 01:15:57 UTC
caused by swig-3.0.3 update. it builds fine with 3.0.2 (In reply to Oleg from comment #1) > caused by swig-3.0.3 update. it builds fine with 3.0.2 Is there any fix for gdal-1.11.1-r1 or should we mask >=swig-3.0.3? Bisected this down to https://github.com/swig/swig/commit/255c929c5636f54c16261bd92b8eea2005d61b11 intended to address https://github.com/swig/swig/issues/217. This turns silently ignored input into error messages. Apparently swig files are subject to a preprocessor similar to the C preprocessor, so anything starting with # is considered a preprocessor directive. Of course, this clashes with the Python usage of #. See http://www.swig.org/Doc3.0/SWIGDocumentation.html#SWIG_nn6 for documentation about that. Quoting from that: “the SWIG preprocessor skips all text enclosed inside a %{...%} block” So one solution would be enclosing all Python comments in such a block. But probably it's easier to simply strip all Python comments, i.e. any lines starting in / +#/. Will try formulating and testing a suitable sed later on. The following made the build succeed for me: ebuild /usr/portage/sci-libs/gdal/gdal-1.11.1-r1.ebuild clean prepare sed -i 's/^ *#.*//' /var/tmp/portage/sci-libs/gdal-*/work/*/swig/include/python/ogr_python.i ebuild /usr/portage/sci-libs/gdal/gdal-1.11.1-r1.ebuild merge Perhaps this sed command can be included in the ebuild? I've reported this issue upstream as http://trac.osgeo.org/gdal/ticket/5795, but I'm not sure the removal of comments we can do here is appropriate there, so perhaps we shouldn't wait for upstream but instead address this at the distro level right now. If not, the very least we could do would be declaring a compile time dependency on <swig-3.0.3 so that the package manager can get things right. Created attachment 393276 [details, diff]
Patch proposed upstream
Upstream asked for a patch, and I proposed this one here.
Created attachment 393298 [details, diff]
Patch from upstream 1.11 branch
Upstream fixed this using %{...%}. This is the commit they applied to their 1.11 branch, so we should be using that for our 1.11.* ebuilds I think.
12 Jan 2015; Andrey Grozin <grozin@gentoo.org> gdal-1.11.1-r1.ebuild, +files/gdal-1.11.1-swig-3.0.3.patch: Fix #534168 |