Re: Best way to patch a public header file before installation
On Thu, Nov 8, 2018 at 2:53 AM Paul Wise <email@example.com> wrote:
> On Thu, Nov 8, 2018 at 4:14 AM Mathieu Malaterre wrote:
> > I'd like to patch a header file just before it gets installed. In
> > particular I'd like to remove a line that contains
> > ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT (it is either #define or #undef
> > depending on the arch). This way I make sure that my header files are
> > arch independent.
> Sounds like something that should be fixed upstream.
I reported that already, but needed a fix for an existing release.
> As a workaround, run this in override_dh_auto_install:
> sed -i /ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT/ debian/*/usr/include/*.h
Thanks, I should have thought about this myself.
> BTW, there are multi-arch dirs for arch-specific headers:
Long story short, I believe this fixes the symptoms and not the actual
bug. I would even go one step further and make that arch specific
include be restricted (Debian policy) to only a subset of packages
(gcc, libc...), since I fail to understand why there would be arch
specific information in public header (obviously for a package not
dealing with low level arch specific).
In my case, and I suspect in the vast majority of packages, this is
just lazy programming where a public header contains an implementation
detail that was used during the build but is meaningless to expose to
the final user.