Thursday, November 29, 2018

[macppc w/ ports-gcc-6.4] Proposal to unbreak net/{lib,r}torrent

Hi David, ports,

Here is a diff that unbreaks libtorrent [1], and thus rtorrent [2],
with gcc-6.4 as ports-gcc on my macppc box [3]. It may help for sparc64
as well.

About the changes:

- Added GCC6_ARCH to arch-defines.mk: it is needed to apply fixes that
only concerned clang so far.
- libtorrent, rtorrent: modified conditional to apply tr1 fixes
- rtorrent: CHOSEN_COMPILER was base-gcc (despite what COMPILER says) and
that won't build with it. I had to enclose sparc64 specific bits
inside an if to ensure CHOSEN_COMPILER is ports-gcc.

Testing:

- It works fine here ([3] again)

Comments/feedback are indeed welcome, i guess there are better solutions i
haven't figured out.

Charlène.

[1] http://ix.io/1uSx
[2] http://ix.io/1uSy
[3] https://i.ibb.co/Srgy9mJ/capture-2018-11-30-053213-21120.png


Index: infrastructure/mk/arch-defines.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/arch-defines.mk,v
retrieving revision 1.56
diff -u -p -r1.56 arch-defines.mk
--- infrastructure/mk/arch-defines.mk 21 Nov 2018 08:03:54 -0000 1.56
+++ infrastructure/mk/arch-defines.mk 30 Nov 2018 04:06:46 -0000
@@ -18,6 +18,7 @@ APM_ARCHS = amd64 i386 loongson macppc s
BE_ARCHS = hppa m88k mips64 powerpc sparc64
LE_ARCHS = aarch64 alpha amd64 arm i386 mips64el sh
LP64_ARCHS = aarch64 alpha amd64 sparc64 mips64 mips64el
+GCC6_ARCHS = macppc sparc64
GCC4_ARCHS = alpha hppa mips64 mips64el powerpc sh sparc64
GCC3_ARCHS = m88k
# XXX easier for ports that depend on mono
@@ -41,7 +42,7 @@ GCC49_ARCHS =alpha amd64 arm hppa i386 m
# arches where there is a C++11 compiler, either clang in base or gcc4
CXX11_ARCHS = ${CLANG_ARCHS} ${GCC49_ARCHS}

-.for PROP in ALL APM BE LE LP64 CLANG GCC4 GCC3 GCC49 MONO LLVM \
+.for PROP in ALL APM BE LE LP64 CLANG GCC6 GCC4 GCC3 GCC49 MONO LLVM \
CXX11 OCAML_NATIVE OCAML_NATIVE_DYNLINK GO \
LLD RUST
. for A B in ${MACHINE_ARCH} ${ARCH}
Index: net/libtorrent/Makefile
===================================================================
RCS file: /cvs/ports/net/libtorrent/Makefile,v
retrieving revision 1.56
diff -u -p -r1.56 Makefile
--- net/libtorrent/Makefile 24 Oct 2018 14:28:09 -0000 1.56
+++ net/libtorrent/Makefile 30 Nov 2018 04:06:46 -0000
@@ -37,7 +37,7 @@ CONFIGURE_ARGS= --enable-static \
--disable-debug

.include <bsd.port.arch.mk>
-.if ${PROPERTIES:Mclang}
+.if ${PROPERTIES:Mclang} || ${PROPERTIES:Mgcc6}
# this patches *only* files containing tr1 to no longer refer to tr1
# we do it pre-patch, because autoconf passes right after us
pre-patch:
Index: net/rtorrent/Makefile
===================================================================
RCS file: /cvs/ports/net/rtorrent/Makefile,v
retrieving revision 1.63
diff -u -p -r1.63 Makefile
--- net/rtorrent/Makefile 24 Oct 2018 14:28:09 -0000 1.63
+++ net/rtorrent/Makefile 30 Nov 2018 04:06:46 -0000
@@ -25,8 +25,12 @@ MODULES= gcc4

# SIGBUS during startup on sparc64 when built using gcc 4.2.1
# https://github.com/rakshasa/rtorrent/issues/28
+# Needs to be enclosed with if with ports-gcc6, because on macppc
+# it causes the CHOSEN_COMPILER to be base-gcc and that doesn't build.
+.if ${MACHINE_ARCH} == "sparc64"
MODGCC4_ARCHS= sparc64
MODGCC4_LANGS= c++
+.endif

BUILD_DEPENDS= devel/cppunit
LIB_DEPENDS= net/libtorrent>=0.13.4 \
@@ -44,7 +48,7 @@ post-install:
${PREFIX}/share/examples/rtorrent/rtorrent.rc

.include <bsd.port.arch.mk>
-.if ${PROPERTIES:Mclang}
+.if ${PROPERTIES:Mclang} || ${PROPERTIES:Mgcc6}
# this patches *only* files containing tr1 to no longer refer to tr1
# we do it pre-patch, because autoconf passes right after us
pre-patch:

No comments:

Post a Comment