Solved Updating libtorrent-rasterbar and python slave port

I'm trying to update net-p2p/libtorrent-rasterbar from 0.16.x to 1.0.x because that is the new stable release line. From what I've read, the 1.0 release offers some bug fixes that are affecting my deluge install on my server. I found this tutorial that has been very useful in getting me started in the port upgrade process, as this is my first attempt at modifying a port.

I was able to get the base port to update and build properly on my machine, but Deluge uses the slave port net-p2p/libtorrent-rasterbar-python which has build errors after my changes. Below is a copy of my changes and the build log. Thank you for any help or knowledge you can offer so I can finish this update will be appreciated.

Link to the full build log (Google Drive)

Copy of build log error:
Code:
c++ -shared -Wl,-rpath,/usr/lib:/usr/local/lib -O2 -pipe -fno-strict-aliasing build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/alert.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/big_number.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/converters.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/create_torrent.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/datetime.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/entry.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/error_code.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/fingerprint.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/ip_filter.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/magnet_uri.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/module.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/peer_info.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/session.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/session_settings.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/string.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/torrent_handle.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/torrent_info.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/torrent_status.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/utility.o build/temp.freebsd-10.0-RELEASE-p9-amd64-2.7/src/version.o -L/usr/local/lib -L/usr/lib -L/usr/local/lib -ltorrent-rasterbar -lGeoIP -lpthread -lboost_system -lboost_python -lpthread -lssl -lcrypto -lpython2.7 -o build/lib.freebsd-10.0-RELEASE-p9-amd64-2.7/libtorrent.so -L/usr/local/lib -Wl,-rpath,/usr/lib:/usr/local/lib -L../../src/.libs
/usr/bin/ld: cannot find -ltorrent-rasterbar
c++: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'c++' failed with exit status 1
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/net-p2p/libtorrent-rasterbar-python
*** Error code 1

Stop.
make: stopped in /usr/ports/net-p2p/libtorrent-rasterbar-python

diff of Makefile, distinfo and pkg-plist in libtorrent-rasterbar:
Code:
--- Makefile.new   2014-10-11 16:15:50.000000000 -0500
+++ Makefile.old   2014-10-11 10:02:33.000000000 -0500
@@ -2,7 +2,7 @@
 # $FreeBSD: head/net-p2p/libtorrent-rasterbar/Makefile 364628 2014-08-11 17:05:50Z adamw $
 PORTNAME=   libtorrent-rasterbar
-PORTVERSION=   1.0.2
+PORTVERSION=   0.16.17
 PORTREVISION=   1
 CATEGORIES?=   net-p2p ipv6
 MASTER_SITES=   SF/${PORTNAME:S/-rasterbar//}/${PORTNAME:S/-rasterbar//}/
@@ -32,7 +32,7 @@
     --with-libiconv \
     --with-openssl=${OPENSSLBASE}
-SHLIB_VER=   8   
+SHLIB_VER=   7
 PLIST_SUB+=   SHLIB_VER="${SHLIB_VER}"
 SUB_FILES=   pkg-message
--- distinfo.new   2014-10-11 16:15:58.000000000 -0500
+++ distinfo.old   2014-10-11 10:02:42.000000000 -0500
@@ -1,3 +1,2 @@
-SHA256 (libtorrent-rasterbar-1.0.2.tar.gz) = 3c8c8e1484dfe6321271c4e51e7d5a005e13240f7f0e99908f50cc6ccd6204de
-SIZE (libtorrent-rasterbar-1.0.2.tar.gz) = 3259318
-
+SHA256 (libtorrent-rasterbar-0.16.17.tar.gz) = 67a1d29c626d991d6e39c2f9828ca70c4053d057070ce01fff9b4ad37e64aff0
+SIZE (libtorrent-rasterbar-0.16.17.tar.gz) = 3018881
--- pkg-plist.new   2014-10-11 16:16:10.000000000 -0500
+++ pkg-plist.old   2014-10-11 15:39:08.000000000 -0500
@@ -2,8 +2,6 @@
 include/libtorrent/add_torrent_params.hpp
 include/libtorrent/address.hpp
 include/libtorrent/alert.hpp
-include/libtorrent/alert_dispatcher.hpp
-include/libtorrent/alert_manager.hpp
 include/libtorrent/alert_types.hpp
 include/libtorrent/alloca.hpp
 include/libtorrent/allocator.hpp
@@ -30,13 +28,11 @@
 include/libtorrent/disk_buffer_holder.hpp
 include/libtorrent/disk_buffer_pool.hpp
 include/libtorrent/disk_io_thread.hpp
-include/libtorrent/ed25519.hpp
 include/libtorrent/entry.hpp
 include/libtorrent/enum_net.hpp
 include/libtorrent/error.hpp
 include/libtorrent/error_code.hpp
 include/libtorrent/escape_string.hpp
-include/libtorrent/export.hpp
 include/libtorrent/extensions.hpp
 include/libtorrent/extensions/logger.hpp
 include/libtorrent/extensions/lt_trackers.hpp
@@ -64,13 +60,8 @@
 include/libtorrent/io_service.hpp
 include/libtorrent/io_service_fwd.hpp
 include/libtorrent/ip_filter.hpp
-include/libtorrent/ip_voter.hpp
-include/libtorrent/kademlia/dht_observer.hpp
 include/libtorrent/kademlia/dht_tracker.hpp
 include/libtorrent/kademlia/find_data.hpp
-include/libtorrent/kademlia/get_item.hpp
-include/libtorrent/kademlia/get_peers.hpp
-include/libtorrent/kademlia/item.hpp
 include/libtorrent/kademlia/logging.hpp
 include/libtorrent/kademlia/msg.hpp
 include/libtorrent/kademlia/node.hpp
@@ -88,6 +79,7 @@
 include/libtorrent/natpmp.hpp
 include/libtorrent/packet_buffer.hpp
 include/libtorrent/parse_url.hpp
+include/libtorrent/pch.hpp
 include/libtorrent/pe_crypto.hpp
 include/libtorrent/peer.hpp
 include/libtorrent/peer_connection.hpp
@@ -101,12 +93,12 @@
 include/libtorrent/ptime.hpp
 include/libtorrent/puff.hpp
 include/libtorrent/random.hpp
+include/libtorrent/rsa.hpp
 include/libtorrent/rss.hpp
 include/libtorrent/session.hpp
 include/libtorrent/session_settings.hpp
 include/libtorrent/session_status.hpp
 include/libtorrent/settings.hpp
-include/libtorrent/sha1_hash.hpp
 include/libtorrent/size_type.hpp
 include/libtorrent/sliding_average.hpp
 include/libtorrent/socket.hpp
@@ -119,6 +111,7 @@
 include/libtorrent/storage.hpp
 include/libtorrent/storage_defs.hpp
 include/libtorrent/string_util.hpp
+include/libtorrent/struct_debug.hpp
 include/libtorrent/thread.hpp
 include/libtorrent/time.hpp
 include/libtorrent/timestamp_history.hpp
@@ -133,7 +126,7 @@
 include/libtorrent/udp_tracker_connection.hpp
 include/libtorrent/union_endpoint.hpp
 include/libtorrent/upnp.hpp
-include/libtorrent/utf%%SHLIB_VER%%.hpp
+include/libtorrent/utf8.hpp
 include/libtorrent/utp_socket_manager.hpp
 include/libtorrent/utp_stream.hpp
 include/libtorrent/version.hpp
@@ -142,8 +135,9 @@
 include/libtorrent/xml_parse.hpp
 lib/libtorrent-rasterbar.so
 lib/libtorrent-rasterbar.so.%%SHLIB_VER%%
+lib/libtorrent-rasterbar.so.%%SHLIB_VER%%.0.0
 libdata/pkgconfig/libtorrent-rasterbar.pc
-@dir include/libtorrent/aux_
-@dir include/libtorrent/extensions
-@dir include/libtorrent/kademlia
-@dir include/libtorrent
+@dirrm include/libtorrent/aux_
+@dirrm include/libtorrent/extensions
+@dirrm include/libtorrent/kademlia
+@dirrm include/libtorrent
 
I reached out to him 10 days ago without reply and have posted to the freebsd-ports mailing list looking for help before coming to this forum. Even if the maintainer does update this port, I would still like to know my shortcomings in this matter so that I can use that knowledge to take up other ports.
 
Hey cadatoiva,

I don't suppose you could share the steps you took to successfully update to 1.0.2 (probably 1.0.3, now)?
 
To get to 1.0.2, you can use the link above to the bug report (linked again here). Put the fix section into a file named patch-file.diff in the net-p2p/libtorrent-rasterbar directory, and run the patch command patch < patch-file.diff

Then update the port using whatever program you use to do that (I use ports-mgmt/portmastermyself).

The port hasn't been updated yet because qBittorrent isn't compatible with the 1.0 release of libtorrent yet. I thought I had submitted a bug report to make a new port for use in deluge and other compatible programs, but I guess that was lost in that bugzilla thing because I don't see it anymore. That bug report was updated to 1.0.3, and I'll be resubmitting it shortly.
 
You rock, cadatoiva! Thank you for the detailed reply. However, the patch is failing on me at hunk #8:
Code:
root@deluge_1:/usr/ports/net-p2p/libtorrent-rasterbar # patch < patch-file.diff
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- libtorrent-rasterbar.diff begins here ---
|--- Makefile.orig      2014-10-26 20:57:45.000000000 -0500
|+++ Makefile   2014-10-26 21:00:51.000000000 -0500
--------------------------
Patching file Makefile using Plan A...
Hunk #1 succeeded at 2 with fuzz 1.
Hunk #2 succeeded at 32 with fuzz 1.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- distinfo.orig      2014-10-26 20:57:53.000000000 -0500
|+++ distinfo   2014-10-26 20:59:38.000000000 -0500
--------------------------
Patching file distinfo using Plan A...
Hunk #1 succeeded at 1.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- pkg-plist.orig     2014-10-26 20:58:02.000000000 -0500
|+++ pkg-plist  2014-10-26 21:06:14.000000000 -0500
--------------------------
Patching file pkg-plist using Plan A...
Hunk #1 succeeded at 2.
Hunk #2 succeeded at 30.
Hunk #3 succeeded at 64.
Hunk #4 succeeded at 88.
Hunk #5 succeeded at 101.
Hunk #6 succeeded at 119.
Hunk #7 succeeded at 133.
Hunk #8 failed at 144.
1 out of 8 hunks failed--saving rejects to pkg-plist.rej
Hmm...  Ignoring the trailing garbage.
done
pkg-plist.rej:
Code:
*** 144,150 ****
  lib/libtorrent-rasterbar.so.%%SHLIB_VER%%
  lib/libtorrent-rasterbar.so.%%SHLIB_VER%%.0.0
  libdata/pkgconfig/libtorrent-rasterbar.pc
- @dir include/libtorrent/aux_
- @dir include/libtorrent/extensions
- @dir include/libtorrent/kademlia
- @dir include/libtorrent
Any ideas?
 
Looks like one of their updates removed the directory lines at the end since I've submitted the patch, as those directories aren't actually needed by the port anymore. You should be fine to compile the update from here.
 
Well, I though I was home free. Error on build:
Code:
===>  Staging for libtorrent-rasterbar-1.0.2
===>   libtorrent-rasterbar-1.0.2 depends on shared library: libboost_date_time.so - found (/usr/local/lib/libboost_date_time.so.1.55.0)
===>   libtorrent-rasterbar-1.0.2 depends on shared library: libGeoIP.so - found (/usr/local/lib/libGeoIP.so.1.6.4)
===>   libtorrent-rasterbar-1.0.2 depends on shared library: libiconv.so.3 - found (/usr/local/lib/libiconv.so.3)
===>   Generating temporary packing list
Making install in include/libtorrent
/bin/mkdir -p '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/include/libtorrent'
install  -o root -g wheel -m 0644  address.hpp add_torrent_params.hpp alert.hpp alert_manager.hpp alert_dispatcher.hpp alert_types.hpp alloca.hpp allocator.hpp assert.hpp bandwidth_limit.hpp bandwidth_manager.hpp bandwidth_socket.hpp bandwidth_queue_entry.hpp bencode.hpp bitfield.hpp bloom_filter.hpp broadcast_socket.hpp bt_peer_connection.hpp buffer.hpp build_config.hpp chained_buffer.hpp config.hpp connection_queue.hpp ConvertUTF.h copy_ptr.hpp create_torrent.hpp deadline_timer.hpp debug.hpp disk_buffer_holder.hpp disk_buffer_pool.hpp disk_io_thread.hpp ed25519.hpp entry.hpp enum_net.hpp error.hpp error_code.hpp escape_string.hpp export.hpp extensions.hpp file.hpp '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/include/libtorrent/.'
install  -o root -g wheel -m 0644  file_pool.hpp file_storage.hpp fingerprint.hpp gzip.hpp hasher.hpp http_connection.hpp http_parser.hpp http_seed_connection.hpp http_stream.hpp http_tracker_connection.hpp i2p_stream.hpp identify_client.hpp instantiate_connection.hpp intrusive_ptr_base.hpp invariant_check.hpp io.hpp io_service.hpp io_service_fwd.hpp ip_filter.hpp ip_voter.hpp lazy_entry.hpp lsd.hpp magnet_uri.hpp max.hpp natpmp.hpp packet_buffer.hpp parse_url.hpp pe_crypto.hpp peer_connection.hpp peer.hpp peer_id.hpp peer_info.hpp peer_request.hpp piece_block_progress.hpp piece_picker.hpp policy.hpp proxy_base.hpp ptime.hpp puff.hpp random.hpp '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/include/libtorrent/.'
/bin/mkdir -p '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/include/libtorrent/extensions'
install  -o root -g wheel -m 0644  extensions/logger.hpp extensions/lt_trackers.hpp extensions/metadata_transfer.hpp extensions/smart_ban.hpp extensions/ut_metadata.hpp extensions/ut_pex.hpp '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/include/libtorrent/extensions'
/bin/mkdir -p '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/include/libtorrent/aux_'
install  -o root -g wheel -m 0644  aux_/session_impl.hpp '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/include/libtorrent/aux_'
/bin/mkdir -p '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/include/libtorrent/kademlia'
install  -o root -g wheel -m 0644  kademlia/dht_tracker.hpp kademlia/dht_observer.hpp kademlia/find_data.hpp kademlia/logging.hpp kademlia/msg.hpp kademlia/node.hpp kademlia/node_entry.hpp kademlia/node_id.hpp kademlia/observer.hpp kademlia/refresh.hpp kademlia/routing_table.hpp kademlia/rpc_manager.hpp kademlia/traversal_algorithm.hpp kademlia/item.hpp kademlia/get_item.hpp kademlia/get_peers.hpp '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/include/libtorrent/kademlia'
install  -o root -g wheel -m 0644  rss.hpp session.hpp session_settings.hpp session_status.hpp settings.hpp sha1_hash.hpp size_type.hpp sliding_average.hpp socket.hpp socket_io.hpp socket_type.hpp socket_type_fwd.hpp socks5_stream.hpp ssl_stream.hpp stat.hpp storage.hpp storage_defs.hpp string_util.hpp thread.hpp time.hpp timestamp_history.hpp torrent_handle.hpp torrent.hpp torrent_info.hpp tracker_manager.hpp udp_socket.hpp udp_tracker_connection.hpp union_endpoint.hpp upnp.hpp utp_socket_manager.hpp utp_stream.hpp utf8.hpp version.hpp web_connection_base.hpp web_peer_connection.hpp xml_parse.hpp tommath.h tommath_class.h tommath_superclass.h '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/include/libtorrent/.'
Making install in src
/bin/mkdir -p '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/lib'
/bin/sh ../libtool   --mode=install /usr/bin/install -c -o root -g wheel   libtorrent-rasterbar.la '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/lib'
libtool: install: /usr/bin/install -c -o root -g wheel .libs/libtorrent-rasterbar.so.8.0.0 /usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/lib/libtorrent-rasterbar.so.8.0.0
libtool: install: (cd /usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/lib && { ln -s -f libtorrent-rasterbar.so.8.0.0 libtorrent-rasterbar.so.8 || { rm -f libtorrent-rasterbar.so.8 && ln -s libtorrent-rasterbar.so.8.0.0 libtorrent-rasterbar.so.8; }; })
libtool: install: (cd /usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/lib && { ln -s -f libtorrent-rasterbar.so.8.0.0 libtorrent-rasterbar.so || { rm -f libtorrent-rasterbar.so && ln -s libtorrent-rasterbar.so.8.0.0 libtorrent-rasterbar.so; }; })
libtool: install: /usr/bin/install -c -o root -g wheel .libs/libtorrent-rasterbar.lai /usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/lib/libtorrent-rasterbar.la
libtool: install: warning: remember to run `libtool --finish /usr/local/lib'
Making install in examples
Making install in test
Making install in bindings
Making install in python
Making install in tools
/bin/mkdir -p '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/libdata/pkgconfig'
install  -o root -g wheel -m 0644 libtorrent-rasterbar.pc '/usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/libdata/pkgconfig'
/usr/bin/strip  /usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/lib/libtorrent-rasterbar.so.8
install  -o root -g wheel -m 0644 /usr/ports/net-p2p/libtorrent-rasterbar/work/libtorrent-rasterbar-1.0.2/AUTHORS /usr/ports/net-p2p/libtorrent-rasterbar/work/libtorrent-rasterbar-1.0.2/ChangeLog /usr/ports/net-p2p/libtorrent-rasterbar/work/libtorrent-rasterbar-1.0.2/README /usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/share/doc/libtorrent-rasterbar
install  -o root -g wheel -m 0644 /usr/ports/net-p2p/libtorrent-rasterbar/work/libtorrent-rasterbar-1.0.2/docs/* /usr/ports/net-p2p/libtorrent-rasterbar/work/stage/usr/local/share/doc/libtorrent-rasterbar/docs
install: /usr/ports/net-p2p/libtorrent-rasterbar/work/libtorrent-rasterbar-1.0.2/docs/img: Inappropriate file type or format
*** [post-install] Error code 71

Stop in /usr/ports/net-p2p/libtorrent-rasterbar.
*** [stage] Error code 1

Stop in /usr/ports/net-p2p/libtorrent-rasterbar.
 
Well, if I understand it correctly, install generates an error when it's told to copy a subdirectory. 0.16.17, the version in the original port, does not have an img folder in its docs folder, while 1.0.2 does. I'm not sure how to go about fixing that in the Makefile, so the quick solution would be to make config and unselect docs as an option, then try again. That will remove the attempt to move that folder, which should also remove the error.

Sorry I can't give you a more correct answer, I'm still very new to all this.
 
Back
Top