I have experienced problems with libtorrent-rasterbar every since upgrading to FreeBSD 9, due to the separation of base iconv vs libiconv. When libtorrent-rasterbar is not linked with converters/libiconv, it fails to properly handle downloaded files containing some non-ascii characters in the filename, where they are replaced with '?'. When linking with converters/libiconv, the downloaded files are named correctly. Presumably, this is caused by the base iconv lacking some features, as discussed here: http://freebsd.1045724.n5.nabble.com/Base-iconv-sort-of-replaces-libiconv-in-FreeBSD-10-td5886786.html This issue can be fixed by removing 'iconv' from the USES line in the Makefile, which prevents Mk/Uses/iconv.mk from messing with the iconv linking. Alternatively, replacing 'iconv' with 'iconv:wchar_t' also works, which also adds 'libiconv.so:${PORTSDIR}/converters/libiconv' to LIB_DEPENDS. After compiling, verify that it's linked to libiconv: $ ldd work/libtorrent-rasterbar-0.16.19/src/.libs/libtorrent-rasterbar.so.7.0.0 work/libtorrent-rasterbar-0.16.19/src/.libs/libtorrent-rasterbar.so.7.0.0: libboost_system.so.1.55.0 => /usr/local/lib/libboost_system.so.1.55.0 (0x80195b000) libssl.so.8 => /usr/local/lib/libssl.so.8 (0x801b5e000) libcrypto.so.8 => /usr/local/lib/libcrypto.so.8 (0x801dc7000) libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x8021cd000) libGeoIP.so.1 => /usr/local/lib/libGeoIP.so.1 (0x8024c7000) libthr.so.3 => /lib/libthr.so.3 (0x80270b000) libc++.so.1 => /usr/lib/libc++.so.1 (0x802930000) libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x802bf0000) libm.so.5 => /lib/libm.so.5 (0x802e0c000) libc.so.7 => /lib/libc.so.7 (0x80081f000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x803034000)
Created attachment 153587 [details] Patch for iconv:wchar_t and building without STRIP As a sidenote, configuring with the STRIP option off fails because it tries to strip the python bindings file in the post-install target. The logic in post-install doesn't make sense, as it will strip libtorrent-rasterbar.so if STRIP is enabled, else it will strip the python binding site-packages/libtorrent.so. It's a bit of a headache to fix, as it will need to test if STRIP is enabled when executed from the libtorrent-rasterbar-python. However, as STRIP is not an option in the libtorrent-rasterbar-python Makefile it cannot test for this. Unless it's possible to test if STRIP is enabled in the master port config, a separate STRIP is needed in libtorrent-rasterbar-python. The attached patch requires the STRIP option to be removed from the EXCLUDE line in net-p2p/libtorrent-rasterbar-python/Makefile: -OPTIONS_EXCLUDE= DOCS EXAMPLES STRIP +OPTIONS_EXCLUDE= DOCS EXAMPLES
The Makefile in ports (libtorrent-rasterbar 1.0.6) can be fixed by replacing iconv with iconv:wchar_t. -USES+= compiler:c++11-lang iconv libtool pathfix pkgconfig +USES+= compiler:c++11-lang iconv:wchar_t libtool pathfix pkgconfig
Created attachment 160721 [details] Replace iconv with iconv:wchar_t to force linking with converters/libiconv Patches net-p2p/libtorrent-rasterbar/Makefile to force linking with with converters/libiconv. Tested with libtorrent-rasterbar v1.0.6.
build-test @work
A commit references this bug: Author: pi Date: Fri Sep 4 16:50:37 UTC 2015 New revision: 396112 URL: https://svnweb.freebsd.org/changeset/ports/396112 Log: net-p2p/libtorrent-rasterbar: fix use of libiconv for non-ascii file download PR: 198072 Submitted by: bro.development@gmail.com Changes: head/net-p2p/libtorrent-rasterbar/Makefile
Committed, thanks.