Opened 8 years ago

Last modified 6 years ago

#52477 closed defect

rtorrent: Update to 0.9.6 w/ patches for macOS 10.12 — at Version 5

Reported by: 3add3287 (3add3287) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: sierra haspatch Cc:
Port: rtorrent

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Updating rtorrent to 0.9.6 and adding patches to build with newer clang on macOS Sierra 10.12. New patches are from current FreeBSD ports tree. Depends on newer libtorrent in trac ticket:52476

Change History (9)

comment:1 Changed 8 years ago by 3add3287 (3add3287)

Can't upload diff to Portfile as it matches BadContent entry "rak" + "sha". The developers username, also in the Websites URL, contains that string. Will add Portfile once BadContent entries allow it

Changed 8 years ago by 3add3287 (3add3287)

Attachment: patch-extra-clang.diff added

Changed 8 years ago by 3add3287 (3add3287)

Changed 8 years ago by 3add3287 (3add3287)

comment:2 Changed 8 years ago by mf2k (Frank Schima)

Keywords: sierra, haspatchsierra haspatch

It should work now.

Changed 8 years ago by 3add3287 (3add3287)

Attachment: Portfile.diff added

comment:3 in reply to:  2 Changed 8 years ago by 3add3287 (3add3287)

Replying to mf2k@…:

It should work now.

It does indeed. Thanks!

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

Your patch adds this block:

post-patch {
    system "find ${worksrcpath} \\( -name '*.h' -or -name '*.cc' \\) -type f -print0 | xargs -0 sed -i '' -e 's/tr1::/std::/g'" 
    system "find ${worksrcpath} \\( -name '*.h' -or -name '*.cc' \\) -type f -print0 | xargs -0 sed -i '' -e 's/std::std::/std::/g'" 
    system "find ${worksrcpath} \\( -name '*.h' -or -name '*.cc' \\) -type f -print0 | xargs -0 sed -i '' -e '/namespace tr1/d'" 
    system "find ${worksrcpath} \\( -name '*.h' -or -name '*.cc' \\) -type f -print0 | xargs -0 sed -i '' -e '/include/s,tr1/,,'" 
}

Ideally, you would use fs-traverse and reinplace, instead of system calling find, xargs and sed. Maybe something like this (untested):

post-patch {
    fs-traverse f ${worksrcpath} {
        switch [file extension ${f}] {
            .cc -
            .h {
                reinplace {s/std::std::/std::/g} ${f}
                reinplace {/namespace tr1/d} ${f}
                reinplace {/namespace tr1/d} ${f}
                reinplace {/include/s,tr1/,,} ${f}
            }
        }
    }
}

It looks like this will make the port work with compilers that support the final C++11 standard, but fail with compilers that only support the transitional tr1 standard. I wonder if you should only be doing this replacing when configure.cxx_stdlib is libc++. Or alternatively, maybe this code requires libc++; if so, include the cxx11 1.0 portgroup to handle the details. We can wait on this, commit it without such changes, and see whether it fails to build on the older Buildbot workers.

The same comments apply to libtorrent in #52476.

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

Description: modified (diff)
Note: See TracTickets for help on using tickets.