Bug 194811 - misc/amanda-client fails to compile with lang/perl5.20 installed
Summary: misc/amanda-client fails to compile with lang/perl5.20 installed
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-04 12:17 UTC by Trond.Endrestol
Modified: 2014-11-19 20:47 UTC (History)
2 users (show)

See Also:


Attachments
Patch to apply when lang/perl5.20 is installed (4.29 KB, patch)
2014-11-04 12:17 UTC, Trond.Endrestol
no flags Details | Diff
New patch for misc/amanda-server/Makefile (558 bytes, patch)
2014-11-19 14:00 UTC, Trond.Endrestol
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Trond.Endrestol 2014-11-04 12:17:39 UTC
Created attachment 149027 [details]
Patch to apply when lang/perl5.20 is installed

Error messages such as:

Amanda/Application.c: In function 'SWIG_AsCharPtrAndSize':
Amanda/Application.c:1580: error: 'bool' undeclared (first use in this function)
Amanda/Application.c:1580: note: each undeclared identifier is reported only once for each function it appears in
Amanda/Application.c:1580: error: expected ':' before numeric constant

appears only when lang/perl5.20 is installed, it compiles flawlessly when lang/perl5.16 is installed. I have yet to try lang/perl5.18.

I have good reason to believe this bug also affects misc/amanda-server under the same conditions.

Workaround:

Remove the three lines:

#ifdef bool
#undef bool
#endif

from these 17 files:

perl/Amanda/Application.c
perl/Amanda/Archive.c
perl/Amanda/Cmdline.c
perl/Amanda/Config.c
perl/Amanda/Debug.c
perl/Amanda/Device.c
perl/Amanda/Disklist.c
perl/Amanda/Feature.c
perl/Amanda/Header.c
perl/Amanda/Logfile.c
perl/Amanda/MainLoop.c
perl/Amanda/NDMP.c
perl/Amanda/Tapelist.c
perl/Amanda/Tests.c
perl/Amanda/Util.c
perl/Amanda/Xfer.c
perl/Amanda/XferServer.c

See attached patch.
Comment 1 Bugzilla Automation freebsd_committer 2014-11-04 12:17:39 UTC
Maintainers CC'd
Comment 2 John Marino freebsd_committer 2014-11-09 16:16:20 UTC
Is this PR still valid after the update of amanda to 3.3.6 ?
Comment 3 Trond.Endrestol 2014-11-09 22:57:15 UTC
(In reply to John Marino from comment #2)
> Is this PR still valid after the update of amanda to 3.3.6 ?

Yes.
Comment 4 John Marino freebsd_committer 2014-11-12 17:24:07 UTC
I was going to ask if this patch still applied, but I think this might be a better fix:

(in amanda-server/Makefile)
post-install:
   ${REINPLACE_CMD} -e 's|#undef bool||g' ${WRKSRC}/perl/Amanda/Application.c


What do you think?  Will it accurately prevent the removal of the bool definition and save a repetitive patch?
Comment 5 John Marino freebsd_committer 2014-11-12 17:25:16 UTC
(In reply to John Marino from comment #4)
> I was going to ask if this patch still applied, but I think this might be a
> better fix:
> 
> (in amanda-server/Makefile)
> post-install:
>    ${REINPLACE_CMD} -e 's|#undef bool||g' ${WRKSRC}/perl/Amanda/Application.c
> 
> 
> What do you think?  Will it accurately prevent the removal of the bool
> definition and save a repetitive patch?

oh, it's 17 files.  How about?

post-install:
    ${REINPLACE_CMD} -e 's|#undef bool||g' ${WRKSRC}/perl/Amanda/*.c


17 patches is very obnoxious.
Comment 6 John Marino freebsd_committer 2014-11-19 09:59:29 UTC
Trond, I am awaiting a response.  The PR is stuck.  Will my suggestion save 17 patches?
Comment 7 Trond.Endrestol 2014-11-19 12:56:03 UTC
(In reply to John Marino from comment #5)
> (In reply to John Marino from comment #4)
> > I was going to ask if this patch still applied, but I think this might be a
> > better fix:
> > 
> > (in amanda-server/Makefile)
> > post-install:
> >    ${REINPLACE_CMD} -e 's|#undef bool||g' ${WRKSRC}/perl/Amanda/Application.c
> > 
> > 
> > What do you think?  Will it accurately prevent the removal of the bool
> > definition and save a repetitive patch?
> 
> oh, it's 17 files.  How about?
> 
> post-install:
>     ${REINPLACE_CMD} -e 's|#undef bool||g' ${WRKSRC}/perl/Amanda/*.c
> 
> 
> 17 patches is very obnoxious.

post-install will be to late in the process, this needs to happen before compilation.

Is there a make target called post-patch?
Comment 8 Trond.Endrestol 2014-11-19 12:56:36 UTC
(In reply to Trond.Endrestol from comment #7)
> (In reply to John Marino from comment #5)
> > (In reply to John Marino from comment #4)
> > > I was going to ask if this patch still applied, but I think this might be a
> > > better fix:
> > > 
> > > (in amanda-server/Makefile)
> > > post-install:
> > >    ${REINPLACE_CMD} -e 's|#undef bool||g' ${WRKSRC}/perl/Amanda/Application.c
> > > 
> > > 
> > > What do you think?  Will it accurately prevent the removal of the bool
> > > definition and save a repetitive patch?
> > 
> > oh, it's 17 files.  How about?
> > 
> > post-install:
> >     ${REINPLACE_CMD} -e 's|#undef bool||g' ${WRKSRC}/perl/Amanda/*.c
> > 
> > 
> > 17 patches is very obnoxious.
> 
> post-install will be to late in the process, this needs to happen before
> compilation.
> 
> Is there a make target called post-patch?

Or maybe pre-build?
Comment 9 John Marino freebsd_committer 2014-11-19 12:58:34 UTC
(In reply to John Marino from comment #6)
> Is there a make target called post-patch?

yes, there is and yes it should be post-patch.  It was just muscle memory that typed post-install.
Comment 10 Trond.Endrestol 2014-11-19 13:07:10 UTC
(In reply to John Marino from comment #9)
> (In reply to John Marino from comment #6)
> > Is there a make target called post-patch?
> 
> yes, there is and yes it should be post-patch.  It was just muscle memory
> that typed post-install.

All went well just now on a system running FreeBSD/amd64 9.3-STABLE r274128 with a ports tree as of r372762, and the following in misc/amanda-server/Makefile.local:

post-patch:
	${REINPLACE_CMD} -e 's|#undef bool||g' ${WRKSRC}/perl/Amanda/*.c

No need for my 17 patches as a single file, nor as 17 separate files.

Ship it!
Comment 11 John Marino freebsd_committer 2014-11-19 13:13:27 UTC
I'll promote this PR because it's two lines that somebody can cut and paste, but I highly recommend that you upload a new attachment with a patch to the makefile (don't forget to increment PORTREVISION)

some people will skip picking up a PR with no patch.


to committer: 
if there's no new patch, add this to the makefile and increment PORTREVISION:

post-patch:
	${REINPLACE_CMD} -e 's|#undef bool||g' ${WRKSRC}/perl/Amanda/*.c
Comment 12 Trond.Endrestol 2014-11-19 14:00:31 UTC
Created attachment 149587 [details]
New patch for misc/amanda-server/Makefile
Comment 13 John Marino freebsd_committer 2014-11-19 20:36:28 UTC
i'll take it -- PR timed out as well, so maintainer approval no longer required.
Comment 14 commit-hook freebsd_committer 2014-11-19 20:38:53 UTC
A commit references this bug:

Author: marino
Date: Wed Nov 19 20:38:02 UTC 2014
New revision: 372813
URL: https://svnweb.freebsd.org/changeset/ports/372813

Log:
  misc/amanda-client: Fix build with perl 5.20

  PR:		194811
  Submitted by:	Trond Endrestol
  Approved by:	maintainer timeout

Changes:
  head/misc/amanda-server/Makefile
Comment 15 John Marino freebsd_committer 2014-11-19 20:47:10 UTC
Done!