Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#56274 closed defect (fixed)

terra @0.7 Fix broken compilation

Reported by: lockhart (Thomas Lockhart) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch maintainer Cc: kencu (Ken)
Port: terra

Description

terra is very old code and clang++ has finally given up on some of the original constructs and class names. This patch for the Portfile fixes use of "array" as a class name and "typeof" (a gcc extension) by substituting "Array" and "decltype" instead.

Attachments (1)

Portfile.diff (976 bytes) - added by lockhart (Thomas Lockhart) 6 years ago.
Fix compilation problems with newer language standards.

Download all attachments as: .zip

Change History (16)

Changed 6 years ago by lockhart (Thomas Lockhart)

Attachment: Portfile.diff added

Fix compilation problems with newer language standards.

comment:1 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Status: newaccepted
Summary: terra @ 0.7 Fix broken compilationterra @0.7 Fix broken compilation

Thanks, I expect this will fix what I reported in #56238.

Since this only fixes a build problem, not a runtime problem, I don't expect a revision increase to be necessary.

There is already a patchfile in this portfile to fix compiler issues. I'm inclined to include these new changes in that patchfile, rather than use reinplace.

comment:2 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Your reinplace also changed array2 to Array2; I'm not including that in the patch, since while array apparently has new meaning under recent C++, array2 doesn't.

comment:3 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: kencu added

Oh. Ken already committed your changes in [c9a1e98f66671e9813c9b6f69c8287fae558c8b5/macports-ports].

comment:4 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 3ef0c6ef1a9446347bfc8a7812ab875c0dfec7ba/macports-ports:

terra: Move reinplaces to patchfile

And refresh and clean up patches, fix license so that port becomes
distributable, and add size to checksums.

Closes: #56238
Closes: #56274

comment:5 Changed 6 years ago by lockhart (Thomas Lockhart)

OK. The source code was last changed in 1996 so I'm just happy the stuff can compile. Thanks for applying patches!

comment:6 Changed 6 years ago by kencu (Ken)

Ah, sorry. And somehow I line-wrapped the "4" so it didnt' automatically close the ticket, to make it worse.

comment:7 Changed 6 years ago by kencu (Ken)

The new patches break builds on systems 10.8 or less.

It can be fixed by including the cxx11 1.1 PortGroup, and adding -std=c++11 to the build line. The easiest way I found to do that was to add it to the compiler spec as this port doesn't use configure. But I know this is cheating:

reinplace -E "s,@CXX@,${configure.cxx} -std=c++11,g" ${worksrcpath}/Makefile

Or we could use the old patch on older systems.

comment:8 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

comment:9 Changed 6 years ago by kencu (Ken)

Sorry to jam it in the optflags. Just easiest in the end I thought. It doesn't work on i386 for some reason (stdlib not set right?), but the others work. Still waiting on PPC, FWIW.

comment:10 in reply to:  9 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

Sorry to jam it in the optflags. Just easiest in the end I thought.

It's certainly not an optimization flag...

It doesn't work on i386 for some reason (stdlib not set right?), but the others work.

The -stdlib isn't set correctly anywhere, so I don't know why it works on other systems. There's no code in the portfile to set it. The port doesn't use the configure phase, which means the port is responsible for setting it manually.

comment:11 Changed 6 years ago by kencu (Ken)

Let me see what happens on PPC, and when I get some time I'll fix up the last few systems if you like.

comment:12 in reply to:  11 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

I'll fix up the last few systems if you like.

where by "the last few systems" you mean all systems running 10.8 or earlier. The right stdlib is not being used. The binaries that got produced for 10.6, for example, are linked with /usr/lib/libstdc++.6.dylib, but the use of the cxx11 1.1 portgroup means that we wanted it to use the MacPorts copy of libstdc++, not the system's.

On the other hand, the fact that the build succeeded with the system's libstdc++ suggests the use of the cxx11 1.1 portgroup wasn't necessary, and that this code doesn't actually require a C++11-capable C++ library.

comment:13 Changed 6 years ago by kencu (Ken)

You want me to leave it for you?

comment:14 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

I have no plans to deal with this port at the moment.

comment:15 Changed 6 years ago by kencu (Ken)

Version 0, edited 6 years ago by kencu (Ken) (next)
Note: See TracTickets for help on using tickets.