Page 2 of 6

Re: Compiling latest qBittorrent with MacPorts package manager

Posted: Sat May 10, 2014 4:30 am
by littletree76

@sledgehammer_999

With everything the same as before (same downloads of compressed archive file qbittorrent-master.zip and compressed data file GeoIP.dat.gz) but only the new macxconf.pri file replaced the old one. Compilation ran as usual with a lot of warning messages but no error encountered. The resultant qbittorrent application file qbittorrent.app was then packaged into disk image file in usual way for distribution/installation.

The resultant application can be executed and file transfer can be started with my test torrent test.torrent as usual. But after the file transfer has completed, the downloaded file is corrupted. Few attempts had been made with torrent files found randomly through Google search (mostly pirated porn movies) and the results are the same with corrupted files.

Finally I removed the directory containing all source code (and the new macxconf.pri file) and executed my compilation script build-qbittorrent to build version 3.2.0 qbittorrent application with the old macxconf.pri file. The same torrent files were tested with the qbittorrent application built with old macxconf.pri file and all files were downloaded without issue. So the conclusion is compilation runs as usual but the downloaded file is always corrupted with the new macxconf.pri configuration file for autotools.

The Unix package pkconfig has always been installed through MacPorts, please refer to my previous posts on MacPorts installation.

Code: Select all

sudo port install qt4-mac libtorrent-rasterbar pkgconfig

Following is log of what have been done on my iMac:

Code: Select all

Wangs-iMac:~$ cd project/qbittorrent
Wangs-iMac:~/project/qbittorrent$ ls -ltr
total 110224
-rw-r--r--@ 1 littletree  staff     30857 Mar 20 14:42 test.torrent
-rw-r--r--@ 1 littletree  staff    383542 Apr  3 02:17 GeoIP.dat.gz
-rw-r--r--@ 1 littletree  staff   3923531 Apr 30 03:35 qbittorrent-3.1.9.2.tar.gz
-rw-r--r--@ 1 littletree  staff   4394645 May  8 06:24 qBittorrent-master.zip
-rw-r--r--@ 1 littletree  staff  15910026 May  8 11:46 qbittorrent-3192.dmg
-rw-r--r--@ 1 littletree  staff  15872487 May  9 17:51 qbittorrent-320.dmg
-rw-r--r--  1 littletree  staff      2344 May 10 08:46 macxconf.pri.autotools
-rwxr-xr-x@ 1 littletree  staff      4659 May 10 09:06 build-qbittorrent*
-rw-r--r--  1 littletree  staff       560 May 10 10:23 qbittorrent-log.txt
-rw-r--r--@ 1 littletree  staff  15873023 May 10 10:24 qbittorrent.dmg

Wangs-iMac:~/project/qbittorrent$ unzip qBittorrent-master.zip
Wangs-iMac:~/project/qbittorrent$ cp macxconf.pri.autotools qBittorrent-master/macxconf.pri
Wangs-iMac:~/project/qbittorrent$ gzip -cd GeoIP.dat.gz > qBittorrent-master/src/geoip/GeoIP.dat

Wangs-iMac:~/project/qbittorrent$ cd qBittorrent-master
Wangs-iMac:~/project/qbittorrent/qBittorrent-master$ ./configure --with-geoip-database-embedded
Wangs-iMac:~/project/qbittorrent/qBittorrent-master$ make
Wangs-iMac:~/project/qbittorrent/qBittorrent-master$ make install
make: Nothing to be done for `install'.

Wangs-iMac:~/project/qbittorrent/qBittorrent-master$ cd src
Wangs-iMac:~/project/qbittorrent/qBittorrent-master/src$ ls -ld qbittorrent.app
drwxr-xr-x  3 littletree  staff  102 May 10 11:51 qbittorrent.app/
Wangs-iMac:~/project/qbittorrent/qBittorrent-master/src$  sudo macdeployqt qbittorrent.app -dmg
Wangs-iMac:~/project/qbittorrent/qBittorrent-master/src$ ls -ld qbittorrent.app qbittorrent.dmg
drwxr-xr-x  3 littletree  staff       102 May 10 11:51 qbittorrent.app/
-rw-r--r--@ 1 root        staff  15979451 May 10 12:13 qbittorrent.dmg

Re: Compiling latest qBittorrent with MacPorts package manager

Posted: Sat May 10, 2014 8:54 am
by sledgehammer_999
I would be interested to see the whole configure output and maybe the compilation output.
eg "./configure --with-geoip-database-embedded &> configure.log"
"make &> build.log"

These will redirect all output to the respective files. You'll be blind, you won't know what happens in the terminal until the commads will return.
Also apart from configure.log and build.log please post config.log too. Thanks.

Re: Compiling latest qBittorrent with MacPorts package manager

Posted: Sat May 10, 2014 12:29 pm
by littletree76

Please find the three requested log files and bash_profile file for Unix environment in bash shell attached with this post for your reference. Let me know when you have found something not right in these log files.

Bare in mind that all Unix packages installed through MacPorts are located under default root directory /opt/local. Though you may choose your own root directory instead of using the default one but usual /usr/local directory is not supported by and not recommended by MacPorts. Thus root directories for Unix packages (etc, bin, sbin, lib, share, include) are as follows:

Unix packages bundled in Apple Darwin Unix:    /usr
Independent open-source Unix packages:          /usr/local
MacPorts Unix package manager:                      /opt/local

Re: Compiling latest qBittorrent with MacPorts package manager

Posted: Sat May 10, 2014 12:53 pm
by sledgehammer_999
I can't find where the problem is. The only thing I noticed is that the configure script detects "g++" as the C++ compiler while make uses "clang++" as the C++ compiler.
When you do the old way of building the project, which compiler is used?
How do you know the files are corrupted? After you restart qbt it starts rechecking and downloading them again? Or at the time the download finishes the videos aren't playable?

Re: Compiling latest qBittorrent with MacPorts package manager

Posted: Sat May 10, 2014 3:08 pm
by littletree76

Clang as front-end processor together with LLVM system as back-end processor is a C, C++, and Objective-C compiler which encompasses preprocessing, parsing, optimization, code generation, assembly, and linking. It is provided by Apple's Xcode / Command Line Tools package as Xcode is a multiple-language development environment. Furthermore compared with independent compilers such as those provided by GNU, Clang and LLVM provide faster performance, better code optimisation/debugging and language compatibility/extension. Of course you can always install and use independent compilers for different languages, but I rather stick to Clang/LLVM system on any Mac platform. Refer to following website for introduction on Clang/LLVM: http://clang.llvm.org

So the answer is clang++ compiler is always used in place of g++ compiler regardless of old and new ways of building qbittorrent application on my iMac.

No error was encountered in entire download process for all torrents under test. The download process always completed successfully before seeding started. Since torrents used in the test are ISO disk image file (Ubuntu installation) and movie files, it is easy to validate by opening the ISO file with BetterZip application and movie files with Wondershare media player (compatible with multiple media formats). In all test cases, none of the files whose content can be accessed successfully with random pattern on display for all movies files. Once I have switched over to use old macxconf.pri file, contents of all the same downloaded files can be accessed without issue. Thus no content validation with CRC/MD code or checksum is necessary. Looking out of window is better/easier than reading iPhone display as far as weather forecast is concerned.

Attached with this post please find log files for qmake and make commands executed in my shell script.

Re: Compiling latest qBittorrent with MacPorts package manager

Posted: Sat May 10, 2014 10:44 pm
by sledgehammer_999
I know what clang is.
I can't find something really obvious between the logs.
Because I want to be really really sure can you conduct this experiment?
Download test.torrent with your normal build. Then do an md5sum or sha1sum on the file (or both).
Then build qbt with the configure script and redownload test.torrent. Then do md5sum/sha1sum and compare with the previous step. Are they different?

Re: Compiling latest qBittorrent with MacPorts package manager

Posted: Sun May 11, 2014 9:46 am
by littletree76

I have revamped my shell script build-qbittorrent to allow three different build mode:

release - version 3.1.9.2 built with existing macxconf.pri file (path modifications required).
alpha    - version 3.2.0 built with existing macxconf.pri file (path modifications required).
test      - version 3.2.0 built with new macxconf.pri file for autotools (macxconf.pri.autotools).

They are built with following commands once all files located in my dropbox site have been downloaded into a directory. Note test mode is strictly for software development test only and users should never need to build qbittorrent in this mode.

./build-qbittorrent -v release
./build-qbittorrent -v alpha
./build-qbittorrent -v test

Corresponding disk image files for qbittorrent application installation are shown below. The shell script also generates few log files after execution for user reference. All files have been updated in my dropbox site and ready for download.

qbittorrent-release.dmg (version 3.1.9.2)
qbittorrent-alpha.dmg    (version 3.2.0)
qbittorrent-test.dmg      (version 3.2.0)

I have tested two versions of qbittorrent application (alpha and test modes) with test.torrent found in my dropbox site and the two downloaded ISO disk image files for Ubuntu installation have exactly the same content. No idea why previously version 3.2.0 of qbittorrent application built with new macxconf.pri file always failed with corrupted file contents.

Code: Select all

Wangs-iMac:/Volumes/Data$ ls -l alpha test
alpha:
total 1562624
-rw-r--r--  1 littletree  staff  800063488 May 11 16:55 ubuntu-12.10-desktop-amd64.iso

test:
total 1562624
-rw-r--r--  1 littletree  staff  800063488 May 11 17:16 ubuntu-12.10-desktop-amd64.iso

Wangs-iMac:/Volumes/Data$ md5 alpha/*.iso test/*.iso
MD5 (alpha/ubuntu-12.10-desktop-amd64.iso) = 7ad57cadae955bd04019389d4b9c1dcb
MD5 (test/ubuntu-12.10-desktop-amd64.iso) = 7ad57cadae955bd04019389d4b9c1dcb

Re: Compiling latest qBittorrent with MacPorts package manager

Posted: Sun May 11, 2014 1:47 pm
by sledgehammer_999
Awesome. One possibility is a failing HDD for the corruption.

I'll commit the changes into git master proper.
Since you like tinkering you can try these too if you want:
1. Try --with-qt5 to do a qt5 build
2. Try --disable-gui to build the nox version of qt.
3. Try both --with-qt5 --disable-gui.

I am happy that the basic form works anyway!

Re: Compiling latest qBittorrent with MacPorts package manager

Posted: Tue May 13, 2014 6:48 am
by littletree76

To upgrade from qt4 to latest qt5, I have to figure out some ways to override qt4 package installed through MacPorts with qt5 package downloaded from http://qt-project.org/downloads. Or we can wait until qt5 package appear in MacPorts system in near future.

I have updated the shell script for building qbittorrent in hand-off manner with another build mode: nox. This mode will create standard Unix command line qbittorrent client application. Unfortunately with current set of configuration files (new macxconf.pri file for autotools and master branch at GitHub site), the make process aborted with error (refer to the make.log attached with this post). Thus the option --disable-gui given in execution of configure script does not work at all.

Other build modes (release / alpha / test) still work as usual and there is no harm in using this script for automated compilation. The updated shell script has been uploaded to my usual dropbox site together with all necessary files for successful building of qbittorrent application on any Mac (of course MacPorts and required Unix packages must be installed first).

https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3

Code: Select all

Wangs-iMac:~/project/qbittorrent$ ./build-qbittorrent -v nox
You might be prompted for administrator password.
Password:

- Compilation date: Tue May 13 14:45:15 SGT 2014
- Source directory: /Users/littletree/project/qbittorrent/qBittorrent-master
- Archive file: /Users/littletree/project/qbittorrent/qBittorrent-master.zip
- Build version: nox

-------------------------------------------------------------------------------------------

Be patient, building process is on going ..................

+ case $SUFFIX in
+ /usr/bin/unzip -q /Users/littletree/project/qbittorrent/qBittorrent-master.zip
+ /usr/bin/gzip -cd GeoIP.dat.gz
+ cd /Users/littletree/project/qbittorrent/qBittorrent-master
+ case $VERSION in
+ /bin/cp -f /Users/littletree/project/qbittorrent/macxconf.pri.autotools ./macxconf.pri
+ ./configure --with-geoip-database-embedded --disable-gui
+ /usr/bin/make -j4
+ cd /Users/littletree/project/qbittorrent/qBittorrent-master/src
+ case $VERSION in
+ echo 'Compilation has failed with current Makefile, impossibe to build application file.'
Compilation has failed with current Makefile, impossibe to build application file.
+ set +x

---------------------------------------------------------------------------------------------------------------------------------------
All done, all log files and disk image file qbittorrent-nox.dmg files can be found in directory /Users/littletree/project/qbittorrent
---------------------------------------------------------------------------------------------------------------------------------------

Wangs-iMac:~/project/qbittorrent$ ls -l *.log
-rw-r--r--  1 littletree  staff     318 May 13 14:45 qbittorrent.log
-rw-r--r--  1 littletree  staff    4613 May 13 14:45 configure.log
-rw-r--r--  1 littletree  staff   17258 May 13 14:45 config.log
-rw-r--r--  1 littletree  staff  203164 May 13 14:45 make.log

Wangs-iMac:~/project/qbittorrent$ tail -22 make.log
main.cpp:199:5: error: incomplete type 'QFont' named in nested name specifier
    QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande");
    ^~~~~~~
/opt/local/include/QtCore/qmetatype.h:319:7: note: forward declaration of 'QFont'
class QFont;
      ^
main.cpp:256:25: warning: 'daemon' is deprecated: first deprecated in OS X 10.5 [-Wdeprecated-declarations]
  if(shouldDaemonize && daemon(1, 0) != 0) {
                        ^
/usr/include/stdlib.h:267:6: note: 'daemon' declared here
int      daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0);
         ^
In file included from main.cpp:61:
In file included from ./headlessloader.h:36:
In file included from preferences/preferences.h:48:
In file included from ./misc.h:36:
/opt/local/include/libtorrent/torrent_handle.hpp:130:12: warning: private field 'unused' is not used [-Wunused-private-field]
                unsigned unused:1;
                         ^
29 warnings and 1 error generated.
make[1]: *** [main.o] Error 1
make: *** [sub-src-make_default] Error 2

Re: Compiling latest qBittorrent with MacPorts package manager

Posted: Wed May 14, 2014 3:03 am
by littletree76

The maintainer has fixed issues with nox build for Unix command-line Bittorrent client application and I have updated few files include the build shell script build-qbittorrent. They have been uploaded to usual dropbox site:

https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3

As usual, download all files exclude disk image files (dmg suffix) and Unix executable file (qbittorrent-nox) from the site and place them in a project folder and issue command in Unix as follows. Once compilation is done, use the test torrent file test.torrent to test run the qbittorrent application.

Code: Select all

Wangs-iMac:~/project/qbittorrent$ ls -l
total 56272
-rw-r--r--@ 1 littletree  staff     30857 Mar 20 14:42 test.torrent
-rw-r--r--@ 1 littletree  staff    383542 Apr  3 02:17 GeoIP.dat.gz
-rw-r--r--@ 1 littletree  staff   3923531 Apr 30 03:35 qbittorrent-3.1.9.2.tar.gz
-rw-r--r--@ 1 littletree  staff   4394659 May 14 01:50 qBittorrent-master.zip
-rwxr-xr-x@ 1 littletree  staff      6385 May 14 03:29 build-qbittorrent*
-rw-r--r--  1 littletree  staff      2346 May 14 10:35 macxconf.pri.autotools
-rw-r--r--@ 1 littletree  staff  15978777 May 14 10:39 qbittorrent-alpha.dmg
-rw-r--r--  1 littletree  staff       638 May 14 10:56 qbittorrent.log
-rwxr-xr-x  1 littletree  staff   4060768 May 14 10:58 qbittorrent-nox*
Wangs-iMac:~/project/qbittorrent$ 
Wangs-iMac:~/project/qbittorrent$ ./build-qbittorrent -h 

Usage:
 	build-qbittorrent -v release	- Building release version.
 	build-qbittorrent -v alpha	- Building alpha version.
 	build-qbittorrent -v nox	- Command line Bittorrent client in Unix.
 	build-qbittorrent -v test	- For software development test only.
 	build-qbittorrent -h		- Display help message.

Wangs-iMac:~/project/qbittorrent$ 

Using RAM drive with ccache command to improve compiler performance.

Posted: Wed May 21, 2014 9:28 am
by littletree76

If you have to compile big project repeatedly for testing, you may make use of a Unix utility ccache to cut down on compilation time. This utility can be installed through port command of MacPorts (with administrator right) as follows. It has to parse source code in order to pick up objects for caching, up to now it can only be used in compiling programs written in C/C++/Objective C/Objective C++ languages (all supported by single compiler front-end clang on all Mac platforms).

sudo port install ccache

Once it has been installed, followings are settings which affect ccache operation (refer to ccache manual page), these lines are taken from .bash_profile shell profile file located in my home directory:

-- Set ccache as prefix of compiler command to make it wrapper to the compiler during execution, note whenever the ccache wrapper can't interpret the source code properly for caching, it will fall back to the compiler as if the wrapper has not been used. In that sense it is rather fail proof.
export CC="ccache clang"
export CXX="ccache clang++"

-- Path to locate compiler, when this variable is not set it will search for the compiler through PATH environment variable and wrong one can be invoked.
export CCACHE_PATH=/usr/bin

-- This variable improve cache hit rate by relaxing stringent checks for a match, it must be adjusted for good trade-off between hit rate and accuracy of caching.
export CCACHE_SLOPPINESS=file_macro,include_file_mtime,time_macros

-- Where do the cache and log file are located in the file system. Preferably they should be located within fastest drive such as RAM drive (see implementation given below).
export CCACHE_DIR=~/Library/Caches/ccache
export CCACHE_LOGFILE=~/Library/Caches/ccache.log

-- Command to set maximum size of cache for memory management by ccache utility. The cache is managed in round-robin manner thus it will never overflow.
ccache --max-size=500M

I have updated build script build-qbittorrent to include these lines for improving compiler performance. Whether ccache has been installed or not, the script will continue to work.

To mount a RAM disk at particular location in file system for user cache file (~/Library/Caches), cut and paste following lines into window of Run Shell Script action to create an application in Automator, save the file as application and make this application as one of the user's Login Items under Users & Groups of System Preferences application. Upon every login, you will see a RAM drive mounted automatically at location ~/Library/Caches. To remove the RAM drive, just remove it from your Login Items window and then reboot computer. Original content of the Caches folder will be revealed and nothing will be lost.

You may have to adjust size of RAM cache in the script to suit your hardware specification (usually less than 300 MB is needed for most applications in Mac OS X). I have set the size parameter to 800 MB since my iMac is equipped with 16 GB of memory. If you do not want the hassle of creating RAM drive application in Automator with preferred drive size, then purchase iRamDisk utility from Mac App Store for USD 10 and caching of Caches folder in memory with user's preferred size can be achieved as well. Both Unix shell script and corresponding application created through Automator are downloadable at my usual Dropbox site.

Once you have the RAM cache in place, ccache will maintain its cache and log file in RAM memory instead of hard drive or solid-state drive when variables CCACHE_DIR and CCACHE_LOGFILE have been set as shown above. Access speed of RAM memory is many folds of hard drive and even solid-state drive (particularly if clock rate of your DDR3 memory is beyond 1600 MHz for Mac based on Ivy Bridge or Haswell chipsets). The RAM cache will benefit other applications as well and you will find Safari browser or iPhoto run much faster.

Code: Select all

#! /bin/sh
### A small shell script to create and mount ram disk.

### Mount point within file system.
MOUNT=~/Library/Caches

### Disk name shown in Mac OS Finder desktop.
NAME=Caches

### Size of disk in Mega byte.
SIZE_MB=800

## Absolute paths for all Unix executables used in this script.
## To avoid invocation of wrong executables and for ease of porting.
expr=/bin/expr
hdiutil=/usr/bin/hdiutil
newfs_hfs=/sbin/newfs_hfs
mkdir=/bin/mkdir
mount=/sbin/mount

### Creat device with disk size converted to number of 512-byte sectors.
### Assuming 1 KB = 1000 bytes (base 10) as shown in Mac OS Finder rather than following Unix convention (base 2).
### Option -kernel to place ram disk in kernel (wired memory) to avoid being swapped out to disk.
sectors=`$expr $SIZE_MB \* 1000 \* 1000 / 512`

#mydev=`hdid -kernel -nomount ram://$sectors`
mydev=`$hdiutil attach -nomount ram://$sectors`

$newfs_hfs -v $NAME $mydev &>/dev/null

### Mount the device at specified mount point.
### No access time update option is enabled to speed up read access.
$mkdir -p $MOUNT
$mount -o noatime -t hfs $mydev $MOUNT

### To remove the ram disk manually from file system.
# umount $MOUNT
# diskutil eject $mydev

Overriding Unix packages installed through MacPorts

Posted: Thu May 22, 2014 11:19 am
by littletree76

Some Unix packages installed through MacPorts are not the latest version, thus you may want to download the latest version directly from the project site and use it in application compilation. But before you can achieve that, you have to ensure that the compiler will pick up the right version. Every Unix package is bundled with configure script to generate Makefile before compilation. Unix command pkg-config is invoked within the script to process every configuration file (with pc file extension for package configuration) for all required Unix package/library. The library libtorrent-rasterbar is required for compilation of qbittorrent application.

Followings are what I have done to override old version 0.16.13 with the latest version 0.16.16 of Unix package libtorrent-rasterbar.

Download latest version of Unix package libtorrent-rasterbar from the project site: http://sourceforge.net/projects/libtorr ... ibtorrent/ in the form of compressed archive file libtorrent-rasterbar-0.16.16.tar.gz.

Extract source code from the archive file and compile it according to instruction given in this document: http://www.rasterbar.com/products/libto ... lding.html. The Unix library and include files are installed under default directory: /usr/local/lib and /usr/local/include with libtorrent-rasterbar.pc configuration file in this directory /usr/local/lib/pkgconfig for pkg-config command to access during execution of configure script.

Code: Select all

./configure --enable-debug=no
make clean
make
sudo make install

Once all files for new version of libtorrent-rasterbar package are in place, deactivate the old version through MacPorts and following environment variable must be set before execution of configure script otherwise pkg-config command will not find the new version. MacPorts version of the package can always be reactivated anytime with following command. Activation and deactivation procedures are a lot faster than install and uninstall procedures in MacPorts.

sudo port activate libtorrent-rasterbar

Code: Select all

sudo port deactivate libtorrent-rasterbar
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

You can confirm proper environment setup with following command to show the version of libtorrent-rasterbar library is in use:

Code: Select all

pkg-config --modversion libtorrent-rasterbar
0.16.16

Extensive testing must be conducted on qbittorrent application compiled with the new version 0.16.16 of libtorrent-rasterbar library before it can be released for public download. Following is a tabulation of various build versions compiled through the build script build-qbittorrent:

Release:    qbittorrent 3.1.9.2 (release),  Qt 4.8.6,    boost 1.55,    libtorrent-rasterbar 0.16.13 (MacPorts version activated)
Nox:          qbittorrent 3.2.0 (alpha),        Qt 4.8.6,    boost 1.55,    libtorrent-rasterbar 0.16.13 (MacPorts version activated)
Alpha:        qbittorrent 3.2.0 (alpha),        Qt 4.8.6,    boost 1.55,    libtorrent-rasterbar 0.16.15 (MacPorts version deactivated and new version installed in /usr/local)
Test:          qbittorrent 3.2.0 (alpha),          Qt 5.3        boost 1.55,    libtorrent-rasterbar 0.16.15 (MacPorts version deactivated and new version installed in /usr/local)

Compilation of test build version with Qt5 version 5.2.1 failed and make log is attached to this post for your reference. Overriding of Qt4 installed through MacPorts with new Qt5 downloaded from http://qt-project.org/downloads can be achieved with above procedure. The configure script must be invoked with following options for Qt5 as QtDbus no longer exist and must be disabled. In fact QtDbus has never been used for Qt4 and I wonder why it must be enabled in the first place.

./configure --with-qt5=yes --enable-qt-dbus=no --with-geoip-database-embedded

All files in my Dropbox site have been updated and accessible at usual location:

https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3

P/S:
After some testings, I realised that qbittorrent 3.2.0 compiled with libtorrent-rasterbar 0.16.16 cause hangs too frequently during operation. Thus I have fall back on version 0.16.15 of libtorrent-rasterbar in compiling alpha version 3.2.0 of qbittorrent. The above table has been updated accordingly. The build shell script build-qbittorrent has also been updated with activation/deactivation of libtorrent-rasterbar package in MacPorts and you no longer have to perform it manually before compilation run. All updated files have been uploaded to usual Dropbox site. I personally use latest alpha build of qbittorrent for file transfer through peer-to-peer network with Mac OS 10.9.3 and Apple Time Capsule base station (remember to disable NAT port Mapping Protocol / NAT PMP which is the same as Upnp and open a port to improve security and bandwidth).

Qt 5.2.1 has also been upgraded to newly released version Qt 5.3 but the result of compiling it with qbittorrent 3.2.0 (for test build only) remain the same. Compilation log make.log is attached with this post. I need anyone who is familiar with Qt programming to enlighten me on what has gone wrong based on error messages shown in the log.

New flexible build scripts for qbittorrent and libtorrent-rasterbar package

Posted: Thu May 29, 2014 9:36 am
by littletree76

I have revamped build shell script build-qbittorrent for the last time with new feature. It suppose to be used together with another shell script build-libtorrent. All source files and data file are checked out from online project repository directly instead of relying on compressed archive files. This approach will ensure that all the source code and data are always up to date.

The shell script build-libtorrent is meant for building and installing any version of libtorrent-rasterbar Unix package. It should be executed before running build-qbittorrent to build qbittorrent application. The libtorrent-rasterbar package installed through MacPorts has become redundant and no longer needed, it should be deactivated or uninstalled for good. Create a project directory under your home directory and set the variable PROJECT_DIR in the shell script accordingly and you are good to go. The script will check out source code directly from online repository, then compile and install the library under default /usr/local directory.

sudo port uninstall libtorrent-rasterbar

cd ~/project/libtorrent
./build-libtorrent -t 0.16.16
or
./build-libtorrent -t master (for alpha version 1.0)

The build-qbittorrent shell script is used very much the same way as the build-libtorrent script, namely create a project directory and set the variable PROJECT_DIR accordingly. Both scripts have the same command line options/arguments, namely particular release number to build. When the argument "master" is used in place of release number, it means the master copy or trunk branch within the source code tree, this is the alpha version under active development.

cd ~/project/qbittorrent
./build-qbittorrent -t 3.1.9.2
or
./build-qbittorrent -t master (for alpha version 3.2.0)

The latest version of data file GeoIP.dat used in translation between IP addresses and countries is downloaded by the script automatically as well. Thus you do not need any files to run both scripts.

I have tested both scripts to create following disk image files for qbittorrent installation: qbittorrent-master.dmg and qbittorrent-3.1.9.2.dmg

qbittorrent-master.dmg:  qbittorrent 3.2.0 (alpha),      Qt 4.8.6,  boost 1.55,  libtorrent-rasterbar 0.16.16
qbittorrent-3.1.9.2.dmg:  qbittorrent 3.1.9.2 (release), Qt 4.8.6,  boost 1.55,  libtorrent-rasterbar 0.16.16

Both versions have been tested with test.torrent file without any issue. All files have been uploaded to usual Dropbox site for free access. If you do not want to build on your own, simply download any of the disk image files for installation in Mac OS 10.9.3.

https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3

With these two shell scripts, you should be able to build qbittorrent application with any versions of source code available in the project sites (hosted by SourceForge and GitHub) without my assistance at all.

Past and future releases for libtorrent-rasterbar and qbittorrent

Posted: Fri May 30, 2014 1:56 am
by littletree76

In case you wonder what release numbers are available as command line arguments to the two shell script build-libtorrent and build-qbittorrent, you can check up in following websites:

libtorrent-rasterbar:
http://sourceforge.net/projects/libtorr ... ibtorrent/

qbittorrent:
https://github.com/qbittorrent/qBittorrent/releases

Both SourceForge and GitHub are popular sites for many open-source projects.

Upgrading Unix packages in MacPorts

Posted: Sun Jun 15, 2014 3:25 pm
by littletree76

Lately there are few Unix packages have been upgraded (include boost and openssl) in MacPorts. They have been installed with following commands:

sudo port self update
sudo port upgrade outdated
sudo port uninstall inactive

Since Unix package libtorrent-rasterbar in MacPorts has been superseded by any release installed through script build-libtorrent, it becomes redundant and has been uninstalled in MacPort. Followings are essential Unix packages required to use both build scripts build-qbittorrent and build-libtorrent:

Code: Select all

Wangs-iMac:~$ port installed
The following ports are currently installed:
  apr @1.5.1_0 (active)
  apr-util @1.5.3_0 (active)
  autoconf @2.69_2 (active)
  automake @1.14.1_2 (active)
  boost @1.55.0_6+no_single+no_static+python27 (active)
  bzip2 @1.0.6_0 (active)
  ccache @3.1.9_0 (active)
  curl-ca-bundle @7.37.0_0 (active)
  cyrus-sasl2 @2.1.26_3+kerberos (active)
  db46 @4.6.21_9 (active)
  db_select @0.1_2 (active)
  dbus @1.8.2_0 (active)
  expat @2.1.0_0 (active)
  gdbm @1.11_0 (active)
  gettext @0.19.1_0 (active)
  icu @53.1_0 (active)
  jpeg @9a_1 (active)
  kerberos5 @1.11.3_0 (active)
  lcms @1.19_5 (active)
  libcomerr @1.42.9_0 (active)
  libedit @20121213-3.0_0 (active)
  libiconv @1.14_0 (active)
  libmagic @5.18_1 (active)
  libmng @1.0.10_3 (active)
  libpng @1.6.12_0 (active)
  libtool @2.4.2_3 (active)
  lynx @2.8.7rel.2_1+ssl (active)
  m4 @1.4.16_0 (active)
  ncurses @5.9_2 (active)
  openssl @1.0.1h_0 (active)
  perl5 @5.12.4_0+perl5_16 (active)
  perl5.16 @5.16.3_0 (active)
  pkgconfig @0.28_0 (active)
  python27 @2.7.7_0 (active)
  python_select @0.3_3 (active)
  qt4-mac @4.8.6_0 (active)
  serf1 @1.3.4_0 (active)
  sqlite3 @3.8.4.3_0 (active)
  subversion @1.8.9_0 (active)
  tiff @4.0.3_4 (active)
  xz @5.0.5_0 (active)
  zlib @1.2.8_0 (active)

Once all Unix packages have been upgraded, just execute the build scripts to rebuild both libtorrent library and qbittorrent application:

build-libtorrent -t 0.16.16
build-qbittorrent -t 3.1.9.2 or build-qbittorrent -t master (for alpha version 3.2.0)

To remove existing qbittorrent installation completely before installation of new version, execute following command line in Terminal application (note Darwin Unix is case-insensitive by default unless case-sensitive option has been chosen during Mac OS X installation):

sudo find -d ~/library -name '*q[bB]ittorrent*' -exec rm -rf {} \; -ls

Reboot your Mac computer before installation of new version from disk image file (qbittorrent-3.1.9.2.dmg or qbittorrent-master.dmg) otherwise any settings cached in memory will be used. All files have been updated in dropbox site for free access.

https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3

P/S:
I have accidentally missed out libtool Unix package as build-libtorrent build script requires it, error has been corrected and apology for any confusion. The error was caused by the fact that I need extra Unix packages to compile other open-source projects such as Chromium Browser and Lame MP3 Encoder beside qBittorrent application, the libtool Unix package was uninstalled due to dependency in removing unnecessary packages for compiling qBittorrent application and libtorrent library. Error has been corrected and it should not have affected disk image files in Dropbox site.