pyroscope / rtorrent-ps

:art: Extended rTorrent distribution with a fully customizable canvas and colors, other feature additions, and complete docs.
http://rtorrent-ps.readthedocs.io/
GNU General Public License v2.0
464 stars 43 forks source link

Compile Errors building in FreeBSD 10.1 #4

Open ghost opened 9 years ago

ghost commented 9 years ago

I have installed libtorrent/rtorrent from the ports and it compiles just fine. There are some differences in clang and gcc and I am not capable of converting the configure flags from one to the other.

I tried to build again after the last commit. I needed to install gcc and upgrade openssl. Then I edited build.sh to change make to gmake and now things compile, until libtorrent.

I use these scripts in all of my servers and would like to get them working in my one FreeBSD server. Any help would be appreciated.

Thanks

/bin/sh ../../../libtool  --tag=CXX    --mode=compile g++ -DHAVE_CONFIG_H  -I. 
-I../../..  -I. -I./.. -I./../.. -I../../.. -I 
/home/jonnyboy/lib/rtorrent-0.9.4/include   -pipe -O2 -pthread  -DNDEBUG 
-fvisibility=hidden -D_THREAD_SAFE  -I/usr/local/include -MT option_strings.lo 
-MD -MP -MF .deps/option_strings.Tpo -c -o option_strings.lo option_strings.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. 
-I../../.. -I /home/jonnyboy/lib/rtorrent-0.9.4/include -pipe -O2 -pthread 
-DNDEBUG -fvisibility=hidden -D_THREAD_SAFE -I/usr/local/include -MT 
option_strings.lo -MD -MP -MF .deps/option_strings.Tpo -c option_strings.cc  
-fPIC -DPIC -o .libs/option_strings.o
In file included from ./../../torrent/connection_manager.h:46:0,
                 from option_strings.cc:43:
/usr/include/netinet/in_systm.h:49:9: error: 'u_int16_t' does not name a type
 typedef u_int16_t n_short;  /* short as received from the net */
         ^
/usr/include/netinet/in_systm.h:50:9: error: 'u_int32_t' does not name a type
 typedef u_int32_t n_long;  /* long as received from the net */
         ^
/usr/include/netinet/in_systm.h:52:9: error: 'u_int32_t' does not name a type
 typedef u_int32_t n_time;  /* ms since 00:00 GMT, byte rev */
         ^
In file included from ./../../torrent/connection_manager.h:47:0,
                 from option_strings.cc:43:
/usr/include/netinet/ip.h:51:2: error: 'u_char' does not name a type
  u_char ip_hl:4,  /* header length */
  ^
/usr/include/netinet/ip.h:58:2: error: 'u_char' does not name a type
  u_char ip_tos;   /* type of service */
  ^
/usr/include/netinet/ip.h:59:2: error: 'u_short' does not name a type
  u_short ip_len;   /* total length */
  ^
/usr/include/netinet/ip.h:60:2: error: 'u_short' does not name a type
  u_short ip_id;   /* identification */
  ^
/usr/include/netinet/ip.h:61:2: error: 'u_short' does not name a type
  u_short ip_off;   /* fragment offset field */
  ^
/usr/include/netinet/ip.h:66:2: error: 'u_char' does not name a type
  u_char ip_ttl;   /* time to live */
  ^
/usr/include/netinet/ip.h:67:2: error: 'u_char' does not name a type
  u_char ip_p;   /* protocol */
  ^
/usr/include/netinet/ip.h:68:2: error: 'u_short' does not name a type
  u_short ip_sum;   /* checksum */
  ^
/usr/include/netinet/ip.h:166:2: error: 'u_char' does not name a type
  u_char ipt_code;  /* IPOPT_TS */
  ^
/usr/include/netinet/ip.h:167:2: error: 'u_char' does not name a type
  u_char ipt_len;  /* size of structure (variable) */
  ^
/usr/include/netinet/ip.h:168:2: error: 'u_char' does not name a type
  u_char ipt_ptr;  /* index of current entry */
  ^
/usr/include/netinet/ip.h:170:2: error: 'u_char' does not name a type
  u_char ipt_flg:4,  /* flags, see below */
  ^
/usr/include/netinet/ip.h:217:2: error: 'u_char' does not name a type
  u_char  ippseudo_pad; /* pad, must be zero */
  ^
/usr/include/netinet/ip.h:218:2: error: 'u_char' does not name a type
  u_char  ippseudo_p; /* protocol */
  ^
/usr/include/netinet/ip.h:219:2: error: 'u_short' does not name a type
  u_short  ippseudo_len; /* protocol length */
  ^
*** Error code 1

Stop.
make[4]: stopped in 
/usr/home/jonnyboy/temp/rtorrent-ps/libtorrent-0.13.4/src/torrent/utils
*** Error code 1

Stop.
make[3]: stopped in 
/usr/home/jonnyboy/temp/rtorrent-ps/libtorrent-0.13.4/src/torrent
*** Error code 1

Stop.
make[2]: stopped in /usr/home/jonnyboy/temp/rtorrent-ps/libtorrent-0.13.4/src
*** Error code 1

Stop.
make[1]: stopped in /usr/home/jonnyboy/temp/rtorrent-ps/libtorrent-0.13.4
*** Error code 1

Stop.
make: stopped in /usr/home/jonnyboy/temp/rtorrent-ps/libtorrent-0.13.4
ghost commented 9 years ago

I have attached the Makefile for libtorrent and rtorrent from Freebsd 10.1 ports. Maybe that can help.

Thanks

libtorrent

# $FreeBSD: head/net-p2p/libtorrent/Makefile 361670 2014-07-13 10:17:45Z madpilot $

PORTNAME=   libtorrent
PORTVERSION=    0.13.4
PORTREVISION=   1
CATEGORIES= net-p2p
MASTER_SITES=   http://libtorrent.rakshasa.no/downloads/

MAINTAINER= ports@FreeBSD.org
COMMENT=    BitTorrent Library written in C++

CONFLICTS=  rblibtorrent-[0-9]* \
        rblibtorrent-devel-[0-9]*

USES=       compiler:c++11-lang libtool pathfix pkgconfig
USE_OPENSSL=    yes
USE_LDCONFIG=   yes
GNU_CONFIGURE=  yes
CONFIGURE_ARGS= --disable-debug
CONFIGURE_ENV=  OPENSSL_LIBS="-L${OPENSSLBASE}/lib -ssl -crypto" OPENSSL_CFLAGS="-I${OPENSSLBASE}/include"

OPTIONS_DEFINE= KQUEUE IPV6
OPTIONS_DEFAULT=    KQUEUE
KQUEUE_DESC=    Use kqueue(2) support

.include <bsd.port.pre.mk>

# Disable amd64 atomic ops on i386 when using gcc
# undefined reference to __sync_add_and_fetch_8
# undefined reference to __sync_fetch_and_and_8
.if ${ARCH} == "i386" && ${COMPILER_TYPE} == "gcc"
CONFIGURE_ARGS+=    --disable-instrumentation
.endif

# Workaround to build on >= 10.x
.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1000000
CXXFLAGS+=  -std=c++11
EXTRA_PATCHES+= ${FILESDIR}/extra-clang
.endif

.if ${PORT_OPTIONS:MKQUEUE}
CONFIGURE_ARGS+=    --with-kqueue
.endif

.if ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+=    --enable-ipv6
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|-O3|${CFLAGS}|' ${WRKSRC}/configure
.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1000000
    @${FIND} ${WRKSRC} \( -name '*.h' -o -name '*.cc' \) -type f \
        -exec ${REINPLACE_CMD} -e 's/tr1::/std::/g' {} \; \
        -exec ${REINPLACE_CMD} -e 's/std::std::/std::/g' {} \; \
        -exec ${REINPLACE_CMD} -e '/namespace tr1/d' {} \; \
        -exec ${REINPLACE_CMD} -e '/include/s,tr1/,,' {} \;
    @${REINPLACE_CMD} -e 's/\.assign/.fill/' \
        ${WRKSRC}/src/torrent/utils/extents.h \
        ${WRKSRC}/src/torrent/utils/log.cc
.endif

.include <bsd.port.post.mk>

rtorrent Makefile

# $FreeBSD: head/net-p2p/rtorrent/Makefile 373913 2014-12-04 14:57:47Z madpilot $

PORTNAME=   rtorrent
PORTVERSION=    0.9.4
PORTREVISION=   2
CATEGORIES= net-p2p
MASTER_SITES=   http://libtorrent.rakshasa.no/downloads/

MAINTAINER= ports@FreeBSD.org
COMMENT=    BitTorrent Client written in C++

BUILD_DEPENDS=  libtorrent=0.13.4_1:${PORTSDIR}/net-p2p/libtorrent
RUN_DEPENDS=    libtorrent=0.13.4_1:${PORTSDIR}/net-p2p/libtorrent
LIB_DEPENDS=    libcurl.so:${PORTSDIR}/ftp/curl

GNU_CONFIGURE=  yes
USES=       compiler:c++11-lang pkgconfig
LDFLAGS+=   -pthread
CONFIGURE_ARGS= --disable-debug

SUB_FILES=  pkg-message

PORTDOCS=   README

OPTIONS_DEFINE= XMLRPC IPV6 DOCS EXAMPLES
OPTIONS_DEFAULT=XMLRPC
XMLRPC_DESC=    Compile with xmlrpc-c support

.include <bsd.port.options.mk>

.if ${ARCH} == arm
BROKEN=     Does not configure on arm
.endif

# Workaround to build on >= 10.x
.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1000000
CXXFLAGS+=  -std=c++11
EXTRA_PATCHES+= ${FILESDIR}/extra-clang
.endif

.if ${PORT_OPTIONS:MXMLRPC}
CONFIGURE_ARGS+=    --with-xmlrpc-c
LIB_DEPENDS+=   libxmlrpc.so:${PORTSDIR}/net/xmlrpc-c-devel
.else
CONFIGURE_ARGS+=    --with-xmlrpc-c=no
.endif
.if ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+=    --enable-ipv6
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|-O3|${CFLAGS}|' ${WRKSRC}/configure
.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1000000
    @${FIND} ${WRKSRC} \( -name '*.h' -o -name '*.cc' \) -type f \
        -exec ${REINPLACE_CMD} -e 's/tr1::/std::/g' {} \; \
        -exec ${REINPLACE_CMD} -e 's/std::std::/std::/g' {} \; \
        -exec ${REINPLACE_CMD} -e '/namespace tr1/d' {} \; \
        -exec ${REINPLACE_CMD} -e '/include/s,tr1/,,' {} \;
.endif

post-install:
    @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
    ${INSTALL_DATA} ${WRKSRC}/doc/rtorrent.rc ${STAGEDIR}${EXAMPLESDIR}
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/${PORTDOCS} ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>
KLIM8D commented 9 years ago

I didn't have much luck either building this on freebsd 10. I hope this information can be useful finding the bug

checking build system type... x86_64-unknown-freebsd10.0
checking host system type... x86_64-unknown-freebsd10.0
checking how to print strings... printf
checking for gcc... no
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking whether cc understands -c and -o together... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... no
checking how to convert x86_64-unknown-freebsd10.0 file names to x86_64-unknown-freebsd10.0 format... func_convert_file_noop
checking how to convert x86_64-unknown-freebsd10.0 file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... freebsd10.0 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of cc... gcc3
checking for cppunit-config... no
checking for Cppunit - version >= 1.9.6... no
checking for g++... no
checking for c++... c++
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking how to run the C++ preprocessor... c++ -E
checking for ld used by c++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes
checking for c++ option to produce PIC... -fPIC -DPIC
checking if c++ PIC flag -fPIC -DPIC works... yes
checking if c++ static flag -static works... yes
checking if c++ supports -c -o file.o... yes
checking if c++ supports -c -o file.o... (cached) yes
checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... freebsd10.0 ld.so
checking how to hardcode library paths into programs... immediate
checking dependency style of c++... gcc3
checking whether byte ordering is bigendian... no
checking for user-defined CXXFLAGS... user-defined "-pipe -O2 -pthread "
checking the byte alignment... none needed
checking for TR1 support... no
checking for C++11 support... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for sysroot... no
checking for kqueue support... yes
checking whether kqueue supports pipes and ptys... no
checking for epoll support... no
checking for fallocate... no
checking size of long... 8
checking sys/vfs.h usability... no
checking sys/vfs.h presence... no
checking for sys/vfs.h... no
checking sys/statvfs.h usability... yes
checking sys/statvfs.h presence... yes
checking for sys/statvfs.h... yes
checking sys/statfs.h usability... no
checking sys/statfs.h presence... no
checking for sys/statfs.h... no
checking for statvfs... ok
checking if compiler supports __attribute__((visibility("default")))... yes
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE
checking for PTHREAD_PRIO_INHERIT... yes
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for OPENSSL... yes
checking for posix_memalign... yes
checking for madvise... yes
checking for cacheline... using default 128 bytes
checking for __builtin_popcount... yes
checking for execinfo.h... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_setname_np type... no
checking signedness of mincore parameter... signed
checking for proper overloaded template function disambiguation... yes
checking if instrumentation should be included... yes
checking if compiler supports __attribute__((unused))... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating libtorrent.pc
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/torrent/Makefile
config.status: creating src/torrent/peer/Makefile
config.status: creating src/torrent/data/Makefile
config.status: creating src/torrent/download/Makefile
config.status: creating src/torrent/utils/Makefile
config.status: creating src/data/Makefile
config.status: creating src/dht/Makefile
config.status: creating src/download/Makefile
config.status: creating src/net/Makefile
config.status: creating src/protocol/Makefile
config.status: creating src/tracker/Makefile
config.status: creating src/utils/Makefile
config.status: creating test/Makefile
config.status: creating config.h
config.status: executing libtool commands
config.status: executing depfiles commands
gmake  all-recursive
gmake[1]: Entering directory '/usr/home/rtorrent/rtorrent-ps/libtorrent-0.13.4'
Making all in src
gmake[2]: Entering directory '/usr/home/rtorrent/rtorrent-ps/libtorrent-0.13.4/src'
Making all in torrent
gmake[3]: Entering directory '/usr/home/rtorrent/rtorrent-ps/libtorrent-0.13.4/src/torrent'
Making all in data
gmake[4]: Entering directory '/usr/home/rtorrent/rtorrent-ps/libtorrent-0.13.4/src/torrent/data'
/bin/sh ../../../libtool  --tag=CXX   --mode=compile c++ -DHAVE_CONFIG_H -I. -I../../..  -I. -I./.. -I./../.. -I../../.. -I /root/lib/rtorrent-0.9.4/include   -pipe -O2 -pthread  -g -DDEBUG -fvisibility=hidden -D_THREAD_SAFE  -I/usr/local/include   -MT block.lo -MD -MP -MF .deps/block.Tpo -c -o block.lo block.cc
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -I /root/lib/rtorrent-0.9.4/include -pipe -O2 -pthread -g -DDEBUG -fvisibility=hidden -D_THREAD_SAFE -I/usr/local/include -MT block.lo -MD -MP -MF .deps/block.Tpo -c block.cc  -fPIC -DPIC -o .libs/block.o
In file included from block.cc:44:
In file included from ./../../protocol/peer_connection_base.h:42:
./../../torrent/poll.h:49:16: error: no member named 'tr1' in namespace 'std'
  typedef std::tr1::function<Poll* ()> slot_poll;
          ~~~~~^
./../../torrent/poll.h:49:29: error: expected member name or ';' after declaration specifiers
  typedef std::tr1::function<Poll* ()> slot_poll;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~^
./../../torrent/poll.h:94:10: error: unknown type name 'slot_poll'
  static slot_poll&   slot_create_poll() { return m_slot_create_poll; }
         ^
./../../torrent/poll.h:97:10: error: unknown type name 'slot_poll'
  static slot_poll    m_slot_create_poll;
         ^
In file included from block.cc:44:
In file included from ./../../protocol/peer_connection_base.h:47:
In file included from ./../../protocol/extensions.h:47:
./../../torrent/download_info.h:57:16: error: no member named 'tr1' in namespace 'std'
  typedef std::tr1::function<uint64_t ()>                              slot_stat_type;
          ~~~~~^
./../../torrent/download_info.h:57:29: error: expected member name or ';' after declaration specifiers
  typedef std::tr1::function<uint64_t ()>                              slot_stat_type;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~^
./../../torrent/download_info.h:59:26: error: no member named 'tr1' in namespace 'std'
  typedef std::list<std::tr1::function<void ()> >                      signal_void_type;
                    ~~~~~^
./../../torrent/download_info.h:59:49: error: expected member name or ';' after declaration specifiers
  typedef std::list<std::tr1::function<void ()> >                      signal_void_type;
  ~~~~~~~                                       ^
./../../torrent/download_info.h:60:26: error: no member named 'tr1' in namespace 'std'
  typedef std::list<std::tr1::function<void (const std::string&)> >    signal_string_type;
                    ~~~~~^
./../../torrent/download_info.h:60:46: error: expected expression
  typedef std::list<std::tr1::function<void (const std::string&)> >    signal_string_type;
                                             ^
./../../torrent/download_info.h:60:67: error: expected member name or ';' after declaration specifiers
  typedef std::list<std::tr1::function<void (const std::string&)> >    signal_string_type;
  ~~~~~~~                                                         ^
./../../torrent/download_info.h:159:3: error: unknown type name 'signal_void_type'
  signal_void_type&   signal_tracker_success() const               { return m_signalTrackerSuccess; }
  ^
./../../torrent/download_info.h:160:3: error: unknown type name 'signal_string_type'
  signal_string_type& signal_tracker_failed() const                { return m_signalTrackerFailed; }
  ^
./../../torrent/download_info.h:171:3: error: unknown type name 'slot_stat_type'
  slot_stat_type&     slot_left()                                  { return m_slotStatLeft; }
  ^
./../../torrent/download_info.h:172:3: error: unknown type name 'slot_stat_type'
  slot_stat_type&     slot_completed()                             { return m_slotStatCompleted; }
  ^
./../../torrent/download_info.h:198:3: error: unknown type name 'slot_stat_type'
  slot_stat_type      m_slotStatLeft;
  ^
./../../torrent/download_info.h:199:3: error: unknown type name 'slot_stat_type'
  slot_stat_type      m_slotStatCompleted;
  ^
./../../torrent/download_info.h:201:11: error: unknown type name 'signal_void_type'
  mutable signal_void_type    m_signalTrackerSuccess;
          ^
./../../torrent/download_info.h:202:11: error: unknown type name 'signal_string_type'
  mutable signal_string_type  m_signalTrackerFailed;
          ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Makefile:480: recipe for target 'block.lo' failed
gmake[4]: *** [block.lo] Error 1
gmake[4]: Leaving directory '/usr/home/rtorrent/rtorrent-ps/libtorrent-0.13.4/src/torrent/data'
Makefile:623: recipe for target 'all-recursive' failed
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory '/usr/home/rtorrent/rtorrent-ps/libtorrent-0.13.4/src/torrent'
Makefile:561: recipe for target 'all-recursive' failed
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory '/usr/home/rtorrent/rtorrent-ps/libtorrent-0.13.4/src'
Makefile:493: recipe for target 'all-recursive' failed
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory '/usr/home/rtorrent/rtorrent-ps/libtorrent-0.13.4'
Makefile:401: recipe for target 'all' failed
gmake: *** [all] Error 2

openssl version: OpenSSL 1.0.1e-freebsd 11 Feb 2013 pkg-config: 0.28 gmake: 4.1 c++: FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 gcc49: gcc49 (FreeBSD Ports Collection) 4.9.3 20150520 (prerelease)

I have changed (make to gmake, gcc to gcc49) in the build.sh and changed some of the build dependencies to the following

BUILD_DEPS=$(cat <<.
wget:wget
subversion:svn
build-essential:gmake
build-essential:c++
patch:patch
libtool:libtoolize
automake:aclocal
autoconf:autoconf
automake:automake
.
)
gamanakis commented 9 years ago

I think I resolved this on FreeBSD 10.1p13. The following steps are required:

  1 diff --git a/build.sh b/build.sh
  2 index 8a8cf4b..c213738 100755
  3 --- a/build.sh
  4 +++ b/build.sh
  5 @@ -79,8 +79,8 @@ export LC_ALL
  6  export SED_I="sed -i -e"
  7  case "$(uname -s)" in
  8      FreeBSD)
  9 -        export CFLAGS="-pipe -O2 -pthread ${CFLAGS}"
 10 -        export LDFLAGS="-s -lpthread ${LDFLAGS}"
 11 +        export CFLAGS="-pipe -O2 -pthread -I/usr/include -I/usr/local/include ${CFLAGS}"
 12 +        export LDFLAGS="-s -lpthread -L/usr/lib -lz -L/usr/local/lib ${LDFLAGS}"
 13          export SED_I="sed -i '' -e"
 14          ;;
 15      Linux)
 16 @@ -108,7 +108,7 @@ set_build_env() {
 17      local dump="$1"
 18      local quot="$2"
 19      $dump export CPPFLAGS="$quot-I $INST_DIR/include ${CPPFLAGS}$quot"
 20 -    $dump export CXXFLAGS="$quot$CFLAGS$quot"
 21 +    $dump export CXXFLAGS="$quot$CFLAGS -std=c++11$quot"
 22      $dump export LDFLAGS="$quot-L$INST_DIR/lib ${LDFLAGS}$quot"
 23      $dump export PKG_CONFIG_PATH="$quot$INST_DIR/lib/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}$quot"
 24  }
 25 @@ -330,6 +330,28 @@ build_deps() {
 26  }
 27 
 28  build() { # Build and install all components
 29 +
 30 +    #patch for FreeBSD 10.1
 31 +    cd libtorrent-$LT_VERSION
 32 +    patch -p0 < /usr/ports/net-p2p/libtorrent/files/*
 33 +    find ./ \( -name '*.h' -o -name '*.cc' \) -type f \
 34 +       -exec sed -i -e 's/tr1::/std::/g' {} \; \
 35 +       -exec sed -i -e 's/std::std::/std::/g' {} \; \
 36 +       -exec sed -i -e '/namespace tr1/d' {} \; \
 37 +       -exec sed -i -e '/include/s,tr1/,,' {} \;
 38 +    sed -i -e 's/\.assign/.fill/' \
 39 +        ./src/torrent/utils/extents.h \
 40 +        ./src/torrent/utils/log.cc
 41 +
 42 +    cd ../rtorrent-$RT_VERSION
 43 +    patch -p0 < /usr/ports/net-p2p/rtorrent/files/*
 44 +    find ./ \( -name '*.h' -o -name '*.cc' \) -type f \
 45 +       -exec sed -i -e 's/tr1::/std::/g' {} \; \
 46 +       -exec sed -i -e 's/std::std::/std::/g' {} \; \
 47 +       -exec sed -i -e '/namespace tr1/d' {} \; \
 48 +       -exec sed -i -e '/include/s,tr1/,,' {} \;
 49 +    cd ../
 50 +
 51      ( cd libtorrent-$LT_VERSION && ( test ${SVN:-0} = 0 || automagic ) \
 52          && ./configure $CFG_OPTS_LT && make && make DESTDIR=$INST_DIR prefix= install )
 53      $SED_I s:/usr/local:$INST_DIR: $INST_DIR/lib/pkgconfig/*.pc $INST_DIR/lib/*.la
 54 @@ -412,6 +434,27 @@ extend() { # Rebuild and install libtorrent and rTorrent with patches applied
 55      popd
 56      bold "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
 57 
 58 +    #patch for FreeBSD 10.1
 59 +    cd libtorrent-$LT_VERSION
 60 +    patch -p0 < /usr/ports/net-p2p/libtorrent/files/*
 61 +    find ./ \( -name '*.h' -o -name '*.cc' \) -type f \
 62 +       -exec sed -i -e 's/tr1::/std::/g' {} \; \
 63 +       -exec sed -i -e 's/std::std::/std::/g' {} \; \
 64 +       -exec sed -i -e '/namespace tr1/d' {} \; \
 65 +       -exec sed -i -e '/include/s,tr1/,,' {} \;
 66 +    sed -i -e 's/\.assign/.fill/' \
 67 +        ./src/torrent/utils/extents.h \
 68 +        ./src/torrent/utils/log.cc
 69 +
 70 +    cd ../rtorrent-$RT_VERSION
 71 +    patch -p0 < /usr/ports/net-p2p/rtorrent/files/*
 72 +    find ./ \( -name '*.h' -o -name '*.cc' \) -type f \
 73 +       -exec sed -i -e 's/tr1::/std::/g' {} \; \
 74 +       -exec sed -i -e 's/std::std::/std::/g' {} \; \
 75 +       -exec sed -i -e '/namespace tr1/d' {} \; \
 76 +       -exec sed -i -e '/include/s,tr1/,,' {} \;
 77 +    cd ../
 78 +
 79      # Build it (note that libtorrent patches ALSO influence the "vanilla" version)
 80      ( set +x ; cd libtorrent-$LT_VERSION && automagic && \
 81          ./configure $CFG_OPTS_LT && make clean && make && make prefix=$INST_DIR install )
 82 diff --git a/patches/command_pyroscope.cc b/patches/command_pyroscope.cc
 83 index 99a195f..6b08c71 100644
 84 --- a/patches/command_pyroscope.cc
 85 +++ b/patches/command_pyroscope.cc
 86 @@ -45,11 +45,11 @@
 87  #include "control.h"
 88  #include "command_helpers.h"
 89 
 90 -#if (RT_HEX_VERSION >= 0x000901)
 91 -    #define _cxxstd_ tr1
 92 -#else
 93 +//#if (RT_HEX_VERSION >= 0x000901)
 94 +//    #define _cxxstd_ tr1
 95 +//#else
 96      #define _cxxstd_ std
 97 -#endif
 98 +//#endif
 99 
100 
101  // handle for message log file
102 diff --git a/patches/ui_pyroscope.cc b/patches/ui_pyroscope.cc
103 index ddc6bfc..f044258 100644
104 --- a/patches/ui_pyroscope.cc
105 +++ b/patches/ui_pyroscope.cc
106 @@ -35,11 +35,11 @@ python -c 'print u"\u22c5 \u22c5\u22c5 \u201d \u2019 \u266f \u2622 \u260d \u2318
107  #include "control.h"
108  #include "command_helpers.h"
109  
110 -#if (RT_HEX_VERSION >= 0x000901)
111 -    #define _cxxstd_ tr1
112 -#else
113 +//#if (RT_HEX_VERSION >= 0x000901)
114 +//    #define _cxxstd_ tr1
115 +//#else
116      #define _cxxstd_ std
117 -#endif
118 +//#endif
119  
120  #if defined(CMD2_ANY)
121         #define D_INFO(item) (item->info())
122 @@ -785,7 +785,7 @@ torrent::Object network_history_sample() {
123  void initialize_command_ui_pyroscope() {
124  #if defined(CMD2_ANY)
125         #define PS_VARIABLE_COLOR(key, value) \
126 -               control->object_storage()->insert_c_str(key, value, rpc::object_storage::flag_string_type); \
127 +               control->object_storage()->insert_c_str(key, value, rpc::flag_string_type); \
128                 CMD2_ANY(key, _cxxstd_::bind(&rpc::object_storage::get, control->object_storage(),   \
129                         torrent::raw_string::from_c_str(key)));  \
130                 CMD2_ANY_STRING(key ".set", _cxxstd_::bind(&rpc::object_storage::set_color_string, control->object_storage(), \
gamanakis commented 9 years ago

Pull request submitted. The patch above does NOT compile correctly, should be used as proof of concept.