qBittorrent official forums

qBittorrent => MAC => Topic started by: littletree76 on March 31, 2014, 02:12:16 AM

Title: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on March 31, 2014, 02:12:16 AM


To compile qBittorrent from latest source code in Mac OS 10.9.2, you not only need Unix packages required by qBittorrent directly (qt4-mac and lib torrent-rasterbar) but also all additional Unix packages where there are dependencies among themselves (total 33 packages). Most of these Unix packages are open-sourced and are not included in Apple's Darwin Unix (Mac OS X builds on it). Of course you can always download these open-source Unix packages (distributed in source code format), and compile all of them to fulfil all dependencies before compiling qBittorrent.

A easier way is to make use of Unix package manager  Homebrew (http://brew.sh) or MacPorts (https://www.macports.org), to take care of all dependencies among packages as well as to handle compilation and installation automatically for all required Unix packages. You will never miss a single Unix package in order to fulfil the all important dependencies.

This thread is devoted to compiling qBittorrent in Mac OS X from latest version of source code released in this site with MacPorts Unix package manager. If you want to compile qBittorrent with Homebrew Unix package manager, please refer to following thread started by pyed:

http://qbforums.shiki.hu/index.php/topic,2423.0.html

Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on March 31, 2014, 02:13:55 AM

I have just re-registered for another dropbox account with different email address as there has been problem with my original dropbox account with two-tier security validation (since I changed my mobile number and dropbox support refused to fix the problem). The qbittorrent 3.1.9 build with latest Xcode 5.1 and corresponding Command Line Tools kit and MacPorts system for Unix packages has been uploaded to this new dropbox account:

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

Note this build is compiled for any Mac model with quad-core processor thus not suitable for Mac models with dual-core processor such as Mac Mini or Macbook. If you need to test with Mac with dual-core processor, let me know and I will recompile and upload the required build.

It has been tested on mid-2011 iMac (2.8GHz Core i7, 256GB DDR, 16GB DDR3 RAM, Mac OS 10.9.2) successfully with at least 10 downloads and bandwidth between 2MB/s to 5MB/s (with 100 Mbps download and 50 Mbps upload fibre broadband Internet connection). Three downloads had been activated simultaneously without problem and no crash has been encountered so far. Make sure you have opened ports in your router to allow incoming peer connections through firewall/NAT configuration in order to achieve the above mentioned bandwidth.

Please report back any problem as soon as possible as the maintainer need to know the outcome to make version 3.1.9 build release for Mac platform.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on March 31, 2014, 02:15:15 AM

Sure the more users test it the better is the quality confirmation. I will try to compile a dual-core version and uploaded to the same dropbox account. Would you please try to download from the link provided to confirm that there is no permission issue as I have not use dropbox for long time ?
Modify message
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on March 31, 2014, 02:17:48 AM

First of all, allow me to clarify a confusion I have caused in my previous post:
The command line option "-j4" in make command line is an option which determine how many commands can be executed in parallel during the compilation process, thus it has nothing to do with the resultant build of qbittorrent 3.1.9 rather the speed of compilation. There is no distinction between dual-core and quad-core processors as far as final build of qbittorrent is concerned. Sorry for the confusion and I will not use this command line option anymore to allow compilation process to work on any Mac model regardless of number of processor cores. Thus you may download qbittorrent 3.1.9 build from link given in previous post:

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

Followings are complete log of the build process with these assumptions:
Mac OS 10.9.x Mavericks, 100 Mbps downlink and 50 Mbps uplink through broadband Internet, a port on Apple Time Capsule has been opened for incoming peer connections (this important step to improve download bandwidth can not be overemphasised). Last but not least, you are comfortable with standard Unix commands in Terminal application.

-- No Xcode installation is required (ignore it if you have already installed). Download and install Command Line Tools kit available at:
https://developer.apple.com/downloads/index.action
Free registration of developer account is required. Note Mac OS 10.9.x is bundled with xcode-select command and any invocation of developer's commands in Terminal application such as "xcode-select --install" or "gcc --version" will cause a popup on display to request for online installation of the tool kit from Apple update servers, just click on "Install" button to proceed.

-- Use xcode-select command to determine active developer directory: xcode-select --print-path
Either "/Applications/XCode.app/Contents/Developer" for Xcode installation or "/Library/Developer/CommandLineTools" for Command Line Tools kit installation will be displayed.
Set it to newly installed directory /Library/Developer/CommandLineTools with following command:
Code: [Select]
xcode-select --switch /Library/Developer/CommandLineTools

Alternatively environment variable DEVELOPER_DIR can be set to the desired directory as follows in your shell profile file. This environment variable overrides setting done through xcode-select command. Whichever directory selected for developer tools make no difference in compiling qbittorrent.
Code: [Select]
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

To trash Xcode installation to recover huge disk space, simply drag the Xcode application to trash as Apple has packaged everything within this self-contained application since release of Xcode 4.3.

-- Install MacPorts according to instructions given in: https://guide.macports.org/index.html
It is not necessary to install X11 package (for X Windows applications) for qbittorrent application. The easier way is to download installer package MacPorts-2.2.1-10.9-Mavericks.pkg and install it like any applications. Use the default /opt/local root directory for installations of all Unix packages by MacPorts. Take note of proper settings of environment variables PATH (for executable binary files) and MANPATH (for manual page documentation) in your shell after installation of MacPorts.

-- Install all Unix packages required by qbittorrent application:
Code: [Select]
sudo port install qt4-mac libtorrent-rasterbar pkgconfig

Administrator password required by the command prefix sudo. All together there will be 33 Unix packages being installed, so be patient as fetching, building and installation of these packages take time particularly if your processor or Internet connection is slow. To confirm these packages have been installed:
Code: [Select]
port installed
The following ports are currently installed:
  autoconf @2.69_2 (active)
  automake @1.14.1_1 (active)
  boost @1.55.0_2+no_single+no_static+python27 (active)
  bzip2 @1.0.6_0 (active)
  db46 @4.6.21_9 (active)
  db_select @0.1_2 (active)
  dbus @1.6.12_0+startupitem (active)
  expat @2.1.0_0 (active)
  gdbm @1.11_0 (active)
  gettext @0.18.3.2_0 (active)
  icu @51.2_1 (active)
  jpeg @9a_1 (active)
  lcms @1.19_5 (active)
  libedit @20121213-3.0_0 (active)
  libgeoip @1.5.1_0 (active)
  libiconv @1.14_0 (active)
  libmng @1.0.10_3 (active)
  libpng @1.6.9_1 (active)
  libtool @2.4.2_3 (active)
  libtorrent-rasterbar @0.16.13_0+python27 (active)
  m4 @1.4.16_0 (active)
  ncurses @5.9_2 (active)
  openssl @1.0.1f_0 (active)
  perl5 @5.12.4_0+perl5_16 (active)
  perl5.16 @5.16.1_3 (active)
  pkgconfig @0.28_0 (active)
  python27 @2.7.6_0 (active)
  python_select @0.3_3 (active)
  qt4-mac @4.8.5_1 (active)
  sqlite3 @3.8.3.1_0 (active)
  tiff @4.0.3_2 (active)
  xz @5.0.5_0 (active)
  zlib @1.2.8_0 (active)


-- Download qbittorrent 3.1.9 source compressed archive and GeoIP.dat.gz compressed data file and place them in a folder under your home directory:
Code: [Select]
ls ~/project/qbittorrent
qbittorrent-3.1.9.tar.gz   GeoIP.dat.gz
cd ~/project/qbittorrent


-- Unpack qbittorrent's source code and GeoIP.dat data file as follows:
Code: [Select]
gzip -cd qbittorrent-3.1.9.tar.gz | tar -xvf -
gzip -cd GeoIP.dat.gz > qbittorrent-3.1.9/src/geoip/GeoIP.dat


-- Modify path settings in configuration file macxconf.pri
Code: [Select]
sed -i '.backup' '/^INCLUDEPATH/,/^LIBS/ s:/opt/local:/usr/local:g' qbittorrent-3.1.9/macxconf.pri


-- Change directory to create Make file and initiate compilation, the resultant qbittorrent application file will be located in src directory.
Code: [Select]
cd qbittorrent-3.1.9
qmake qbittorrent.pro
make


-- Optional steps to package and create disk image file for future distribution:
Code: [Select]
sudo macdeployqt src/qbittorrent.app -dmg


-- Clean up directory to conserve disk space as last step:
Code: [Select]
make clean

That's it, you may want to print this log for future reference.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on March 31, 2014, 02:20:57 AM

To those who are wondering how to install Apple's Command Line Tools for developer's commands without huge Xcode installation and how to remove XCode for good, please refer to following two articles published in OSXDaily site:

http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/
http://osxdaily.com/2012/02/20/uninstall-xcode/

If you have installation of XCode version 4.3 and above, simply drag the Xcode application to trash and empty the trash, otherwise follow instructions in above article for complete removal. The difference is due to the fact that Apple has bundled all software components within self-contained Xcode application (thats why it is so huge in size and updated so often) for later versions.

There are many users install huge Xcode (5 GB in size) just to make all standard developer's commands (make, gcc, ld, cpp, clang etc with total size of just 130 MB) available in Darwin Unix environment for their software development.

qBittorrent must be configured properly to improve performance and avoid crashing due to depletion of resources on your mac. See following article on limit settings for download/upload bandwidth and number of active torrents/connections.

http://www.techsupportalert.com/optimizing-qbittorrent-speed

After you have tuned settings in qBittorrent, use following torrent to test download speed and stability. This torrent is linked to a ISO disk image file for Ubuntu installation (768 MB in size) with a lot of seeds and peers at all time. I achieved download speed of 5 MB/s without crash on my mid-2011 2.8 GHz Core i7 iMac and 100Mbps downlink / 50 Mbps uplink fibre broadband Internet connection.

https://btguard.com/support/index.php?/Knowledgebase/Article/View/4/1/how-do-i-test-my-torrent-download-speeds

Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on April 12, 2014, 12:47:48 AM

Apple has just released new version of Xcode (5.1.1, downloadable for free in Apple's Mac App Store)and corresponding Command Line Tools package on 10-April-2014. Identical essential command/library/include files which make up command line tools for developer are packaged within these two installations in two different paths (/Applications/Xcode.app/Contents/Developer for Xcode and /Library/Developer/CommandLIneTools for Command Line Tools). Either path can be selected with xcode-select command as follows for compilation of qbittorrent.

% xcode-select --switch /Applications/Xcode.app/Contents/Developer
% xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

Again environment variable DEVELOPER_DIR can be set to the desired directory to override all other settings for the same purpose.
% export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

Whether to install the huge Xcode (5 GB) or the Command Line Tools (130 MB) depends on available disk space and need for graphical development environment in developing Mac OS X and iOS applications. Command Line Tools package contains more files than Xcode installation though set of essential files are the same. Take note that for Xcode after version 4.3, locations of these command line files are actually within application package file (/Applications/Xcode.app) in Mac OS Finder.

MacPorts installation and all Unix packages ported to Mac OS X by MacPorts (all under /opt/local directory) can be upgraded to latest versions regularly as follows:

% port selfupdate
% port upgrade installed



Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on April 12, 2014, 01:32:32 AM

After upgraded Xcode (Command Line Tools) and MacPorts (all ported Unix packages) to latest version, I have created a shell script build-qbittorrent.sh for automated compilation of qbittorrent. All you have to do is download all files (locate them by following the given dropbox link) to any local directory and then execute the shell script (you will be prompted for administrator password). During compilation all warning messages can be ignored safely and a disk image file qbittorrent.dmg and a log file qbittorrent-log.txt will appear in the local directory. Administrator right is required to package qbittorrent application into disk image file.

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

% cd ~/project/qbittorrent
% ./build-qbittorrent.sh
% ls -l
total 39616
[email protected] 1 littletree  staff   3923413 Mar  1 20:43 qbittorrent-3.1.9.tar.gz
[email protected] 1 littletree  staff    357461 Mar  6 00:45 GeoIP.dat.gz
[email protected] 1 littletree  staff     30857 Mar 20 14:42 test.torrent
[email protected] 1 littletree  staff      2862 Apr 11 23:00 build-qbittorrent.sh*
-rw-r--r--  1 littletree  staff      1302 Apr 11 23:21 qbittorrent-log.txt
[email protected] 1 littletree  staff  15947184 Apr 11 23:23 qbittorrent.dmg

The same process can be repeated again and again for future releases of qbittorrent (just remember to download latest versions of the two archive files from this site). The log file is reused for each compilation run through the shell script and records date/time stamps and versions for the compilations. Of course you can just download the resultant disk image file qbittorrent.dmg for immediate installation and ignore compilation completely. A test torrent file test.torrent (for 850 MB Ubuntu installation ISO disk image file) is also provided for testing after qbittorrent has been installed. I achieved 5 MB/s download speed and completed within three minutes with 2.8 GHz Core i7 iMac and 100 Mbps / 50 Mbps fibre broadband Internet connection.

The newly compiled qbittorrent application works better than previous compiled version in that you no longer see this message "qbittorrent (not responding)" in Forced Quit Applications window (option-command-esc key combination) or Activity Monitor window.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on April 29, 2014, 01:00:31 AM

Latest release version 3.1.9.1 of qbittorrent to fix openssl Heartbleed security issue has been compiled and tested successfully. Please download the disk image file qbittorrent-3191.dmg from usual Dropbox site:

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

As usual you may compile on your own through the shell script build-qbittorrent.sh located at the same site. MacPorts has upgraded openssl to version 1.0.1g_0 so please upgrade all outdated Unix packages before compiling qbittorrent as follows:

sudo port selfupdate
sudo port upgrade outdated

Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on April 30, 2014, 05:20:41 PM

The latest version 3.1.9.2 of qbittorrent is released for changes in Windows version and does not affect Mac version. Nevertheless I have recompiled with the new source codes and tested with test.torrent successfully. Please find all updated files at usual download site:

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

Followings are versions of essential Unix packages ported through MacPorts and used in the compilation:

Code: [Select]
Wangs-iMac:~$ port installed qt4-mac boost libtorrent-rasterbar
The following ports are currently installed:
  boost @1.55.0_2+no_single+no_static+python27 (active)
  libtorrent-rasterbar @0.16.13_0+python27 (active)
  qt4-mac @4.8.5_1 (active)
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Nemo on April 30, 2014, 08:20:16 PM
Thanks for your efforts littletree76 (and pyed too), much appreciated :).
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on May 01, 2014, 01:27:40 AM

All Mac users are welcomed to try out the build. I have been using uTorrent Mac version 1.84/Beta1.9.1 for some time before decided to switch from uTorrent to qBittorrent. As far as qBittorrent is concerned, not only I can compile from latest release of source code on my mac, the user interface is more responsive during file transfers. Just look at the gap between Windows version (3.4.4) and Mac version (1.9.1) of uTorrent and you can see that Mac users have become second-class citizen for too long !

In fact after I have created the shell script build-qbittorrent.sh to automate executions for placement of data file, editing of configuration file and finally compilation, the whole process from downloading latest files to complete of compilation takes not more than half an hour on my mac. So maintenance does not take up too much time and any mac user can do it without prerequisite of technical knowledge.

I would like to invite any mac users to try out latest release (3.1.9.2) of qBittorrent either by downloading disk image file qbittorrent-3192.dmg directly or downloading all files and execute the shell script on your mac (of course it requires installations of Xcode/Command Line Tools and MacPorts first). Choice between huge Xcode and compact Command Line Tools depends on whether you need graphical development environment of Xcode for other development works (and available disk space), either one will work for compiling qBittorrent.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on May 08, 2014, 12:13:59 AM

On Monday Dropbox has disabled some links to fix bug, but the link (to my dropbox online storage) given in previous posts for downloading files is still valid and working.

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

I have modified the shell script build-qbittorrent.sh for automated compilation to allow compilation of latest alpha version of qbittorrent downloaded from GitHub site. All you have to do is to assign variable ARCHIVE at beginning of the shell script to suitable file name (refer to commented out line).

The Unix package qt4-mac has been upgraded to version 4.8.6 and latest release version of qbittorrent 3.1.9.2 has been recompiled with new version of qt4-mac and tested with test.torrent without issue.

As usual, updated files qbittorrent-3192.dmg, build-qbittorrent.sh  and qbittorrent-log.txt have been uploaded to the dropbox site.

Code: [Select]
gs-iMac:~/project/qbittorrent$ sudo port selfupdate
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.2.1 installed,
MacPorts base version 2.2.1 downloaded.
--->  Updating the ports tree
--->  MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated
Wangs-iMac:~/project/qbittorrent$ sudo port upgrade outdated
--->  Computing dependencies for qt4-mac
--->  Fetching archive for qt4-mac
--->  Attempting to fetch qt4-mac-4.8.6_0.darwin_13.x86_64.tbz2 from http://jog.id.packages.macports.org/macports/packages/qt4-mac
--->  Attempting to fetch qt4-mac-4.8.6_0.darwin_13.x86_64.tbz2 from http://lil.fr.packages.macports.org/qt4-mac
--->  Attempting to fetch qt4-mac-4.8.6_0.darwin_13.x86_64.tbz2.rmd160 from http://lil.fr.packages.macports.org/qt4-mac
--->  Installing qt4-mac @4.8.6_0
--->  Cleaning qt4-mac
--->  Computing dependencies for qt4-mac
--->  Deactivating qt4-mac @4.8.5_1
--->  Cleaning qt4-mac
--->  Activating qt4-mac @4.8.6_0
NOTE: Qt database plugins for mysql55, postgresql91, and sqlite2 are NOT installed by this port; they are installed by qt4-mac-*-plugin instead.
--->  Cleaning qt4-mac
--->  Updating database of binaries: 100.0%
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Nemo on May 08, 2014, 09:12:08 PM
Thanks mate :).
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on May 09, 2014, 03:31:39 PM

I have refined the build script build-qbittorrent further by eliminating the need to edit this script file for building both release (3.1.9.2) and alpha (3.2.0) versions of source code. All you have to do is to download compressed archive file (qbittorrent-3.1.9.2.tar.gz or qBittorrent-master.zip in different formats) from this website or GitHub site and place them together with all other files within a directory. Note do not modify file names of the downloaded files as the script relies on proper file names to work. Then execute the script with following command line options/arguments in the directory contains all files (you can't go wrong as there are stringent checks in the script):

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

Another enhancement made to the script is all listings on display have been channeled to log files: qmake.log for qmake command, make.log for make command and qbittorrent.log for overall logging. File listing on display caused by extraction of source files from compressed archive file has also been eliminated (nobody want to read such uninteresting file listing).

I have also provided the downloaded archive file and disk image file for alpha version 3.2.0 of qbittorrent in the dropbox site. Feel free to try out the latest version 3.2.0 with extra features such as tray icon in notification area at right corner of menu bar of Mac OS Finder (unavailable in release version 3.1.9.2). Thus it is no longer necessary to maintain qbittorrent window in display during lengthy file transfers. Take note that this is a alpha version and might not be as stable as the release version 3.1.9.2, so use/test it at your own risk and please report back any bug you have found. As far as I am concerned, I have been using the alpha version 3.2.0 for all file transfers without issue so far.

Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on May 10, 2014, 12:24:01 AM
@littletree76

Could you help me migrate the build system to autotools so you won't have to edit macxconf.pri manually?

1. Download git master
2. Replace macxconf.pri with these contents: http://pastebin.com/gud9u3nN
3. Install necessary libs from macports/homebrew
4. ./configure --with-geoip-database-embedded
5. make
6. make install

And then whatever you do to package it. You can also give the --prefix arg to configure. Just be sure to always use "--with-geoip-database-embedded".

If it fails please share the config.log file and whatever is the output in the terminal. Thanks.

EDIT: You'll need pkg-config too for the library detection.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on May 10, 2014, 06:30:46 AM

@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]
sudo port install qt4-mac libtorrent-rasterbar pkgconfig


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

Code: [Select]
Wangs-iMac:~$ cd project/qbittorrent
Wangs-iMac:~/project/qbittorrent$ ls -ltr
total 110224
[email protected] 1 littletree  staff     30857 Mar 20 14:42 test.torrent
[email protected] 1 littletree  staff    383542 Apr  3 02:17 GeoIP.dat.gz
[email protected] 1 littletree  staff   3923531 Apr 30 03:35 qbittorrent-3.1.9.2.tar.gz
[email protected] 1 littletree  staff   4394645 May  8 06:24 qBittorrent-master.zip
[email protected] 1 littletree  staff  15910026 May  8 11:46 qbittorrent-3192.dmg
[email protected] 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
[email protected] 1 littletree  staff      4659 May 10 09:06 build-qbittorrent*
-rw-r--r--  1 littletree  staff       560 May 10 10:23 qbittorrent-log.txt
[email protected] 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/
[email protected] 1 root        staff  15979451 May 10 12:13 qbittorrent.dmg





Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on May 10, 2014, 10:54:08 AM
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.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on May 10, 2014, 02:29:25 PM

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
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on May 10, 2014, 02:53:07 PM
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?
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on May 10, 2014, 05:08:18 PM

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.

Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on May 11, 2014, 12:44:36 AM
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?
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on May 11, 2014, 11:46:01 AM

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]
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
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on May 11, 2014, 03:47:30 PM
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!
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on May 13, 2014, 08:48:19 AM

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]
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
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on May 14, 2014, 05:03:19 AM

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]
Wangs-iMac:~/project/qbittorrent$ ls -l
total 56272
[email protected] 1 littletree  staff     30857 Mar 20 14:42 test.torrent
[email protected] 1 littletree  staff    383542 Apr  3 02:17 GeoIP.dat.gz
-r[email protected] 1 littletree  staff   3923531 Apr 30 03:35 qbittorrent-3.1.9.2.tar.gz
[email protected] 1 littletree  staff   4394659 May 14 01:50 qBittorrent-master.zip
[email protected] 1 littletree  staff      6385 May 14 03:29 build-qbittorrent*
-rw-r--r--  1 littletree  staff      2346 May 14 10:35 macxconf.pri.autotools
[email protected] 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$
Title: Using RAM drive with ccache command to improve compiler performance.
Post by: littletree76 on May 21, 2014, 11:28:57 AM

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]
#! /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


Title: Overriding Unix packages installed through MacPorts
Post by: littletree76 on May 22, 2014, 01:19:57 PM

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/libtorrent/files/libtorrent/ 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/libtorrent/building.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]
./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]
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]
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.
Title: New flexible build scripts for qbittorrent and libtorrent-rasterbar package
Post by: littletree76 on May 29, 2014, 11:36:32 AM

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.
Title: Past and future releases for libtorrent-rasterbar and qbittorrent
Post by: littletree76 on May 30, 2014, 03:56:38 AM

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/libtorrent/files/libtorrent/

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

Both SourceForge and GitHub are popular sites for many open-source projects.
Title: Upgrading Unix packages in MacPorts
Post by: littletree76 on June 15, 2014, 05:25:23 PM

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]
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.
Title: Change in source tree structure in hosting site and libtorrent new release.
Post by: littletree76 on June 24, 2014, 04:59:25 AM

On 20-June-2014, source tree structure in qBittorrent hosting site has been revamped and previous version of qBittorrent build script build-qbittorrent no longer work completely. I have updated URL address for checking out truck branch (master copy) of qBittorrent source tree as follows:

Old:    https://github.com/qbittorrent/qBittorrent/branches/master
New:  https://github.com/qbittorrent/qBittorrent/truck

The change in source tree structure only affect checking out of truck branch (alpha version 3.2.0 under active development) but not any release version (3.1.9.2). Change in source tree structure rarely happen and any developer should be able to provide proper URL address for checkout operation. Updated new version of build script build-qbittorrent has been uploaded to Dropbox site.

Latest release version of libtorrent Unix package has also been upgraded from version 0.16.16 to version 0.16.17 and alpha version has been upgrade to 1.0.0 RC3. I have recompiled libtorrent Unix package on my iMac with the build script build-libtorrent as follows. As for the alpha version 1.0.0 RC 3 of libtorrent, I have attempted compilation with this version few weeks ago and encountered undefined symbol errors, thus not until source code of qBittorrent application has catched up with this version of libtorrent there is no point of trying to compile with this alpha version (same approach applied to latest Qt version 5.3.0).

build-libtorrent -t 0.16.17

All disk image files (qbittorrent-3.1.9.2.dmg for release version and qbittorrent-master.dmg for alpha version 3.2.0) have been rebuilt with the new libtorrent library and uploaded to the Dropbox site. They have been installed and tested successfully on my iMac with test.torrent in the Dropbox site. All versions of qBittorrent application are built with following versions of libraries:

Qt 4.8.6
Libtorrent 0.16.17.0
Boost 1.55.0

All updated files are ready for access at usual Dropbox site: https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3

I can't emphasise enough the important of tweaking parameters in qBittorrent application to avoid hangup (it happened to me with version 0.16.16 of libtorrent), particularly under following sections. These settings are for fibre broadband Internet connection with download bandwidth of 100 Mbps and upload bandwidth of 50 Mbps, adjust according to your Internet bandwidths. So make adjustments on these parameters before making complain. Note using a separate port for DHT causes downloading stage to start much earlier after torrent has been added.

I have been using alpha version 3.2.0 of qBittorrent application on my iMac (2.8 GHz Core-i7, 16 GB DDR3 RAM) with satisfactory result (better than uTorrent 3.1.9 which has been discarded few months ago).

[Connection]

Port used for incoming connection:                           54xxx
Use UPnP/NAT-PMP port forwarding for my router:  not checked
Use different port on each startup:                             not checked
(Make sure UPnP or NAT-PMP are disabled and specific port for incoming connections is opened on your router. Download bandwidth really suffers without any opened port.)

Global maximum number of connections:        600
Maximum number of connections per torrent:  80
Global maximum number of upload slots:        150
Maximum number of upload slots per torrent:  20

[Speed]

Upload:      4800 KiB/s (note Kilo-Byte-per-Second)
Download:  7200 KiB/s

[BitTorrent]

Enable DHT to find more peers:                    checked
Use a different port for DHT and BitTorrent:  checked
DHT port:                                                       68xx

Encryption mode:  Require encryption
(Ensure your ISP unable to block bittorrent traffic by analysing content of package.)

[Advanced]

Transfer list refresh interval:                               3000 ms
Maximum number of half-opened connections:  80
Exchange trackers with other peers:                   checked
Always announce to all trackers:                         checked
Title: Release of Mac OS 10.9.4
Post by: littletree76 on July 02, 2014, 04:17:34 AM

Apple has just released new version 10.9.4 of Mac OS X (probably the last one before launch of Mac OS 10.10 Yosemite). I updated Mac OS X on my iMac and recompiled libtorrent Unix package and qBittorrent application as follows:

build-libtorrent -t 0.16.17  (build-libtorrent -t master for version 1.0 RC3 does not compile properly with existing source code of qBittorrent)
build-qbittorrent -t 3.1.9.2
build-qbittorrent -t master (for alpha version 3.2.0)

Note the two build scripts check out source code from online source depositories according to version given in command line. Thus the source codes are always the latest (particularly true for alpha versions still under active development) and not relied on some outdated compressed archive files.

Updated disk image files have been uploaded to Dropbox site for free access. Everything work fine in new Mac OS 10.9.4, in fact most operations in qBittorrent application have been speeded up. I am not sure whether the speedup is caused by new Mac OS 10.9.4 or the effect of removing software firewall Intego NetBarrier from Mac OS X. Since I already have hardware firewall set up in my wireless router, there is no point of cascading network traffic through yet another barrier of software firewall.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Nemo on July 02, 2014, 10:37:36 PM
Thanks littletree76, great work :).
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on July 05, 2014, 09:39:07 PM
@littletree76

Just so you know, libtorrent 1.0.0 support is only available on git master. Are you testing with it? On my machine it compiles fine.
If master fails, please post compilation logs so I can see what is happening.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on July 08, 2014, 01:46:24 AM

@sledgehammer_999

When I mentioned failure in compilation , it meant the latest trunks (master copys) of source trees for both libtorrent and gbittorrent do not work properly together few weeks ago. Then I could compile any version of libtorrent Unix package through my build script build-libtorrent without issue in older Mac OS 10.9.3, just specify the required version as command line argument as follows (argument "master" for trunk of source tree for both build scripts). In both build scripts, all source codes are checked out directly from source depository through svn client without using any compressed archive file, hence they are always the latest versions still under development at the time of script execution.

build-libtorrent -t master
-- for trunk version 1.0.0-RC3 of libtorrent source tree at: svn://svn.code.sf.net/p/libtorrent/code/trunk

Once the libtorrent library has been compiled and installed successfully under default /usr/local directory in Mac OS 10.9.4, I use another build script build-qbittorrent to compile and build qbittorrent application with the newly installed libtorrent library, that was when error messages appeared during make process and the process was halted without completion.

build-qbittorrent -t master
-- for trunk version 3.2.0 of qbittorrent source tree at: https://github.com/qbittorrent/qBittorrent/trunk

Today I have just executed the build-libtorrent build script again to compile trunk version (1.1.0) of libtorrent package and it failed, so I reverted back to older release version 1.0.0 (released on  2-Jul-2014) and compilation still failed. So I reverted back yet older release versions 1.0.0-RC3 (released on 23-Jun-2014) and 1.0.0-RC (released on 8-May-2014), surprisingly both compilations failed this time (in new Mac OS 10.9.4). Please find four make log files generated during compilations of libtorrent package attached with this post.

build-libtorrent -t master (alpha version 1.1.0)
build-libtorrent -t 1.0
build-libtorrent -t 1.0-rc3
build-libtorrent -t 1.0-rc

Failure occurred at the same spot (file ciso646 not found) during the make process for versions 1.0.0, 1.0.0-RC3 and 1.0.0-RC whereas make process never start properly at all for latest trunk version 1.1.0.

  CC       ../ed25519/src/add_scalar.lo
In file included from ../ed25519/src/add_scalar.c:1:
In file included from ../ed25519/src/ed25519.h:6:
In file included from ../include/libtorrent/config.hpp:55:
In file included from /opt/local/include/boost/config.hpp:35:
/opt/local/include/boost/config/compiler/clang.hpp:175:10: fatal error: 'ciso646' file not found
#include <ciso646>
         ^
1 error generated.
make[1]: *** [../ed25519/src/add_scalar.lo] Error 1
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on July 08, 2014, 07:44:24 AM
I can't review the logs atm but just so you know libtorrent 1.0.0 now resides here: svn://svn.code.sf.net/p/libtorrent/code/branches/RC_1_0/
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on July 08, 2014, 09:43:16 PM
Try the latest from the RC_1_0 branch. If it still fails please share here:
1. Your libtorrent configuration options
2. The output of make
3. Boost version used.

I'll to forward them to the libtorrent author.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on July 10, 2014, 05:18:01 AM

Previously my build script build-libtorrent for building libtorrent check out source code through tags instead of branches directory of libtorrent source tree. But I have tried both source directories and both compilations failed in latest Mac OS 10.9.4 for the same cause (file ciso646 not found). From now on I will only check out source code through branches instead of tags directory for both libtorrent and qbittorrent. Please find configure.log, config.log and make log files attached with this post for your reference.

The version of boost package in use is 1.55.0_6 which is the latest installed through MacPorts 2.3.1 package manager. As for configuration before compilation, following two lines are taken from my build script build-libtorrent:
autotool.sh
configure --enable-debug=no

Followings are log of compilation process and last 30 lines of make log file extracted from display of Terminal application (similar to any Unix terminal) in Mac OS 10.9.4.

Code: [Select]
Wangs-iMac:~/project/libtorrent$ ./build-libtorrent -b RC_1_0
You might be prompted for administrator password.

Checking out source code from svn repository at following address:
svn://svn.code.sf.net/p/libtorrent/code/branches/RC_1_0
Please be patient ......

Source code checked out successfully from svn repository.
Checked out revision 10097.

Executions of configuration and compilation started, please refer to log files for details.
Source directory: RC_1_0

+ cd RC_1_0
+ ./autotool.sh
+ ./configure --enable-debug=no
++ /usr/sbin/sysctl -n hw.physicalcpu
+ PHYSICAL_CORES=4
+ /usr/bin/make --silent clean
Making clean in include/libtorrent
Making clean in src
rm -f ./so_locations
Making clean in examples
Making clean in test
Making clean in bindings
Making clean in python
Making clean in tools
+ /usr/bin/make -j4
+ STATUS=2
+ set +x

Compilation failed, please refer to log file /Users/littletree/project/libtorrent/make.log.

Wangs-iMac:~/project/libtorrent$ tail -30 make.log
clang: warning: argument unused during compilation: '-I ../ed25519/src'
clang: warning: argument unused during compilation: '-I /opt/local/include'
clang: warning: argument unused during compilation: '-I /opt/local/include'
clang: warning: argument unused during compilation: '-I /opt/local/include'
  CC       ../ed25519/src/add_scalar.lo
  CC       ../ed25519/src/fe.lo
In file included from ../ed25519/src/add_scalar.c:1:
In file included from ../ed25519/src/ed25519.h:6:
In file included from ../include/libtorrent/config.hpp:45:
In file included from /opt/local/include/boost/config.hpp:35:
/opt/local/include/boost/config/compiler/clang.hpp:175:10: fatal error: 'ciso646' file not found
#include <ciso646>
         ^
  CC       ../ed25519/src/ge.lo
1 error generated.
make[1]: *** [../ed25519/src/add_scalar.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
clang: warning: argument unused during compilation: '-I .'
clang: warning: argument unused during compilation: '-I ../include'
clang: warning: argument unused during compilation: '-I ../ed25519/src'
clang: warning: argument unused during compilation: '-I /opt/local/include'
clang: warning: argument unused during compilation: '-I /opt/local/include'
clang: warning: argument unused during compilation: '-I ../ed25519/src'
clang: warning: argument unused during compilation: '-I .'
clang: warning: argument unused during compilation: '-I ../include'
clang: warning: argument unused during compilation: '-I ../ed25519/src'
clang: warning: argument unused during compilation: '-I /opt/local/include'
clang: warning: argument unused during compilation: '-I /opt/local/include'
clang: warning: argument unused during compilation: '-I ../ed25519/src'
make: *** [all-recursive] Error 1

All versions of Unix packages installed through MacPorts package manger are shown below:
Code: [Select]
Wangs-iMac:~/project/libtorrent$ 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.6_0 (active)
  expat @2.1.0_0 (active)
  gdbm @1.11_0 (active)
  gettext @0.19.1_1 (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.8_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)
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on July 14, 2014, 02:20:45 AM
Reported this upstream. Hopefully arvid will be able to fix it. bug report: https://code.google.com/p/libtorrent/issues/detail?id=648
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on July 14, 2014, 02:31:56 AM
Until arvid responds AND if you have time, retry a build of the latest RC_1_0. I see that he has pushed changes on how ed25519 is being built, so it might have fixed your problem.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on July 14, 2014, 08:48:15 AM

Yes I have noticed changes in branch RC_1_0 of source tree as well. I used my build script build-libtorrent to check out source from that branch RC_1_0 (version 1.0.1) and libtorrent package compiled successfully this time without issue.

build-libtorrent -b RC_1_0

But when I rebuild both release 3.1.9.2 and master copy (alpha version 3.2.0) of qbittorrent (checked out source code directly from tag release-3.1.9.2 and master of source tree) with this new release of libtorrent package, both compilations failed. Please find log files for make processes of libtorrent 1.0.1, qbittorrent 3.1.9.2 and qbittorrent 3.2.0 attached with this post.

build-qbittorrent -t 3.1.9.2
build-qbittorrent -t master

Note in both of my build scripts, I have switched from checking out source code from tags directories to branches directories, unfortunately compilation for qbittorrent 3.1.9.2 failed with source code checked out from branch v3_1_x, so I have to revert back to checking out source code from tag release-3.1.9.2 (though no such problem with master version 3.2.0 of qbittorrent source tree). Probably by comparing source code between following two locations should be able to pinpoint differences between tag release-3.1.9.2 and branch v3_1_x. I use svn client to check out all source code in both build scripts since it is compatible with github source depository.

https://github.com/qbittorrent/qBittorrent/tags/release-3.1.9.2
https://github.com/qbittorrent/qBittorrent/branches/v3_1_x
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on July 14, 2014, 02:42:11 PM
v3_1_x: The errors are due to using libtorrent 1.0.x. That branch doesn't have support for it. Only for 0.15.x and 0.16.x
master: That single error is totally weird. The code disables that function when libtorrent 1.0.0 is used. Are you sure you did a clean build of that branch and it didn't have leftovers from a build against libtorrent 0.16.x?
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on July 14, 2014, 07:26:17 PM

I am very sure that before a new build for libtorrent is installed, all files related to old build of libtorrent are hunted down (through Unix find command) and removed from default installation directory /usr/local in Mac OS 10.9.4. In my build script build-libtorrent for building all versions of libtorrent Unix package, you should find following two lines at the end of the script:

find -d /usr/local -iname '*libtorrent*' -exec $rm -rf {} \; -ls
sudo make -j1 install

Even without the first line to remove all existing files of old build, the next line where "make install" is executed should over-write existing files in default installation directory (/usr/local). When building master version (3.2.0) of qbittorrent with new macxconf.pri file provided by you sometime ago (autotools are in use), following error messages always appear in configure log file:

configure: Running qmake to generate the makefile...
/Users/littletree/project/qbittorrent/qBittorrent/trunk/macxconf.pri:7: Unknown test function: sts

Which means following section of configuration instructions have been invalid and bypassed all the time during the configure process:

sts($$OUT_PWD/../conf.pri) {
    include($$OUT_PWD/../conf.pri)
} else {
    include(conf.pri)
}

Can this be the cause of failure in compiling qbittorrent 3.2.0 application with new version 1.0.1 of libtorrent package ? Please find two log files generated during the configure process attached with this post.

Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on July 14, 2014, 08:45:13 PM
I have successfully built 3.2.0 with libtorrent 1.0.1 on Windows.

You delete the files from the final destination but what about the build directory? Is it cleaned?

You seem to either have copied the maxconf.pri incompletely or I provided an incomplete version of it. "sts($$OUT_PWD/../conf.pri) {" should be "exists($$OUT_PWD/../conf.pri) {"
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on July 15, 2014, 05:43:19 AM

All files related to libtorrent under default third-party software install directory /usr/local are cleared before new versions of the files are installed. Similarly build directories where both of my build scripts build-libtorrent and build-qbittorrent are located are always cleared completely before executions of the scripts to build new versions. Thus follows are content of both build directories before executions of both scripts:

~/project/qbittorrent:
test.torrent
macxconf.pri.autotools
build-qbittorrent

~/project/libtorrent:
build-libtorrent

I am able to do that because all source files are always checked out from online source depository in real time according to version specified on command line when the build scripts are executed. Even the GeoIP.dat data file is downloaded in real time in the build script. Thus no compressed archive files or any other files are needed before executions of the scripts since source files are not handled independently but all of them are always checked out in one go. Another advantage is I never have to worry about dependencies among these source files.

So I disable use of compiler cache (through Unix ccache command) in both scripts, edit macxconf.pri configuration file to correct the typo error and rebuild both libtorrent package (version 1.0.1 checked out from branch RC_1_0) and qbittorrent application (version 3.2.0 checked out from trunk directory). The Unix package libtorrent 1.0.1 was built successfully whereas same error happened again at the same spot during make process for qbittorrent 3.2.0 application. Please find a log file generated during make process of qbittorrent attached with this post.

Judge by error message, probably there is conflict in member setDHTPort of data structure QBtSession between qbittorrent application and libtorrent package.

Code: [Select]
Wangs-iMac:~/project/qbittorrent$ tail -8 qbittorrent-make-master.log
/usr/bin/clang++ -c -pipe -DTORRENT_USE_OPENSSL -DWITH_SHIPPED_GEOIP_H -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_DYN_LINK -DTORRENT_LINKING_SHARED -I/usr/local/include -I/usr/local/include/libtorrent -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.9 -Wall -W -DWITH_GEOIP_EMBEDDED -DQT_NO_DEBUG_OUTPUT -DVERSION=\"v3.2.0alpha\" -DVERSION_MAJOR=3 -DVERSION_MINOR=2 -DVERSION_BUGFIX=0 -DQT_NO_CAST_TO_ASCII -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DBOOST_FILESYSTEM_VERSION=2 -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/local/share/qt4/mkspecs/macx-g++ -I. -I. -I/opt/local/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtXml.framework/Versions/4/Headers -I. -Iqtsingleapp -Iqtlibtorrent -Iwebui -Iwebui/qjson -Itracker -Ipreferences -Ilineedit/src -Iproperties -Isearchengine -Irss -Itorrentcreator -Igeoip -Ipowermanagement -I/opt/local/Library/Frameworks/QtXml.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/include -I. -F/opt/local/Library/Frameworks -F/opt/local/lib -o moc_alertdispatcher.o moc_alertdispatcher.cpp
moc_qbtsession.cpp:361:22: error: no member named 'setDHTPort' in 'QBtSession'
        case 68: _t->setDHTPort((*reinterpret_cast< int(*)>(_a[1]))); break;
                 ~~  ^
1 error generated.
make[1]: *** [moc_qbtsession.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [sub-src-make_default] Error 2
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on July 15, 2014, 07:28:48 AM
Can you provide the generated moc_qbtsession.cpp ?
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on July 15, 2014, 08:18:15 AM

I recompiled libtorrent 1.0.1 and qbittorrent 3.2.0 to regenerate all files. Please find the file moc_qbtsession.cpp attached with this post. I have also created a compressed tarball file qbittorrent.tar.bz (using tar and bzip2 commands, size = 8.67 MB) to encapsulate entire build directory for qbittorrent 3.2.0 application (exclude all Unix hidden files) and uploaded to my usual Dropbox site. Feel free to download the compressed tarball file to examine its content.

tar --exclude '.*' -cf - qBittorrent | bzip2 -cvf - >qbittorrent.tar.bz

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

Title: New version 1.0.1 of libtorrent package
Post by: littletree76 on July 16, 2014, 04:17:44 PM

Compilation of qbittorrent 3.2.0 with new version 1.0.1 of libtorrent in Mac OS 10.9.4 has failed for unknown reason. Still pending investigation by maintainer of qbittorrent. Please find the log file generated during make process attached with this post. Updated compressed tarball file qbittorrent.tar.bz which contain all source files has also been uploaded to my Dropbox site:

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


Title: Compiling qbittorrent 3.2.0 with libtorrent 1.0.1
Post by: littletree76 on July 17, 2014, 05:55:18 PM

Hallelujah ! alpha version 3.2.0 of qbittorrent application finally has been compiled properly with latest release version 1.0.1 of libtorrent Unix package by adding following line into macxconf.pri.autotools file (attached with this post). This configuration file replaces older macxconf.pri file checkout from online qbittorrent source depository as changes in this file have not been committed into the source depository yet.

INCLUDEPATH += /usr/include/openssl /usr/include /opt/local/include/boost /opt/local/include /usr/local/include

Since all paths included in this variable for all header files are valid for all third-party Unix packages installed through MacPorts (under default directory /opt/local) on any Mac, I will leave it as it is in the configuration file macxconf.pri.autotools. All paths begin with /opt/local must be modified to /usr/local only when you are using Homebrew package manger or downloading individual Unix packages and compile/install manually on your own. Apparently this configuration file was written for MacPorts package manager initially by previous maintainers. I wonder whether we should commit all changes in macxconf.pri configuration file into trunk of source tree for alpha version 3.2.0 of qbittorrent application ?

Updated configuration file macxconf.pri.autotools and disk image file qbittorrent-master.dmg built with source of qbittorrent 3.2.0 and libtorrent 1.0.1 have been uploaded to my Dropbox site.
Title: Compiling qbittorrent 3.1.9.2 with libtorrent 0.16.17
Post by: littletree76 on July 18, 2014, 04:00:02 AM

The release version 3.19.2 of qbittorrent application can only be compiled with older version 0.16.17 but not latest version 1.0.1 of critical Unix package libtorrent. Since the macxconf.pri configuration file was written originally with MacPorts package manager in mind, I removed following command from qbittorrent build script to change all paths begin with /opt/local (MacPorts) to /usr/local (Homebrew and individual  Unix packages) in the configuration file. Then I recompiled qbittorrent 3.1.9.2 with libtorrent 0.16.17 and sure enough resultant qbittorrent application works without issue.

$sed -i '.backup' '/^INCLUDEPATH/,/^LIBS/ s:/opt/local:/usr/local:g' ./macxconf.pri

In fact I have doubt on my mind to make such modifications in macxconf.pri configuration file for some time since I switched from Homebrew (default directory /usr/local) to MacPorts (default directory /opt/local). Compilation still work with MacPorts all along even though paths for header and library files have been wrong is because configure script always scan default directory /opt/local/lib/pkgconfig for all files with pc extension. Thus regardless of settings of INCLUDEPATH and LIBS variables in macxconf.pri configuration file, proper header (INCLUDEPATH) and library (LIBS) files were always located in resultant Makefile after execution of configure script. Note though you can compile MacPorts from source files with arbitrary installation root directory, setting the directory to /usr/local is not supported by MacPorts (read warning in MacPorts site before you proceed).

Instead of keep modifying original version of macxconf.pri file for every compilation run, why not just add few more paths to these two variables in original configuration file in following section:

# Special include/libs paths (macports)
INCLUDEPATH += /usr/include/openssl /usr/include /usr/local/include/boost /usr/local/include /opt/local/include/boost /opt/local/include
LIBS += -L/usr/local/lib -L/opt/local/lib

Of course prerequisite is not to install duplicate third-party Unix packages in Mac OS X at the same time through MacPorts, Homebrew or individual Unix packages downloaded from project sites. This does not make sense and will cause confusion in locating header and library files. So you use the same package either from MacPorts (/opt/local) or Homebrew (/usr/local) or individual packages (/usr/local). It is quite tiring to maintain both systems of MacPorts and Homebrew on same Mac at the same time and I don't see the point of doing that. Though you can always supplement MacPorts/Homebrew system with individual packages downloaded from project sites when you need latest versions which might not be available in MacPorts/Homebrew (this is the case for libtorrent package).

Frankly speaking, I have sticked to qbittorrent 3.2.0 (alpha version) after few test runs months ago and qbittorrent 3.1.9.2 (release version) has been largely ignored. With properly opened DHT port and port for incoming connections on router, performance and download bandwidth have been fantastic beside slightly more features for qbittorrent 3.2.0.

All updated files (almost all) have been uploaded to Dropbox site for sharing.
https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on July 18, 2014, 08:16:55 AM
Just a note: I am going to migrate macxconf.pri to autotools anyway, so I'll take into account INCLUDEPATHS too. Don't know when that will happen though.
Title: Directories for header and library files
Post by: littletree76 on July 24, 2014, 07:57:34 PM

I have added following lines into macxconf.pri.autotools configuration file. Content of this file is meant to replace original macxconf.pri configuration file checked out from online source depository in my build script for qbittorrent (build-qbittorrent). Thus this file is always needed (the only one needed) in running the build script until these changes have been committed into source depository by the maintainer of qbittorrent application.

# Default directories for header files bundled with Mac OS X.
INCLUDEPATH += /usr/include/openssl /usr/include
# Directories for header files installed through Homebrew package manager or individual Unix packages.
INCLUDEPATH += /usr/local/include/boost /usr/local/include
# Directories for header files installed trhough MacPorts package manager.
INCLUDEPATH += /opt/local/include/boost /opt/local/include
# Directories for all third-party library files not bundled with Mac OS X.
LIBS += -L/usr/local/lib -L/opt/local/lib

Updated macxconf.pri.autotools file has been uploaded to usual Dropbox site for sharing.
https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on July 24, 2014, 09:57:58 PM
FYI this will help me foolproof the autotools script: http://qbforums.shiki.hu/index.php/topic,2709.0.html
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on July 25, 2014, 02:44:02 AM

I suppose variables such as INCLUDEPATH and LIBS are cumulative (take note of += assignment operator) for assignments to it thus they can appear in multiple lines in configuration file. You do not have to split assignments according to assignment types rather you may want to consider removal of duplicate assignments.
Title: Update compilation
Post by: littletree76 on July 28, 2014, 04:10:45 AM

I have made slight change in qbittorrent build script build-qbittorrent:

Replace file transfer command /usr/bin/lwp-download with much more versatile/popular command /usr/bin/curl, the rest of script remain the same and the script should be executed as before ( with macxconf.pri.autotools configuration file in same folder as the script ). Version 7.30.0 of /usr/bin/curl command is bundled with Mac OS X installation, of course you can always install latest version 7.37.1 of /opt/local/bin/curl command through MacPorts ( "sudo port install curl" ) but it is not necessary as only basic function of the command is used in the script.

./build-qbittorrent -t 3.1.9.2
./build-qbittorrent -t master ( for alpha version 3.2.0 )

A recompilation of critical Unix package libtorrent 1.0.1 has been done as well to pick out bug fixes committed in online source depository lately. Version 3.2.0 of qbittorrent application has been recompiled with the new build script and new library of libtorrent 1.0.1. New disk image file qbittorrent-master.dmg and new build script build-qbittorrent have been uploaded to Dropbox site for sharing.

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


Title: Update for qbittorrent 3.2.0
Post by: littletree76 on September 06, 2014, 10:39:16 AM

I have upgraded boost library from version 1.55 to version 1.56 through MacPorts system. The version of libtorrent library remain at the latest release version 1.0.1 and version of Qt library remain at 4.8.6. Both build scripts for libtorrent and qbittorrent remain the same as before. Recompiled qbittorrent 3.2.0 with new version of boost library and to pick up all changes made in source code of qbittorrent 3.2.0 as of today (2014-09-06). The latest version of qbittorrent 3.2.0 is much more stable/complete than previous version. The newly compiled qbittorrent-master.dmg disk image file for installation is available at usual Dropbox site for free download.

To recompile everything with all files downloaded from the Dropbox site in same directory (you only need three files and nothing else: the two build scripts and temporary configuration file macxconf.pri.autotools):

./build-libtorrent -t libtorrent-1_0_1
./build-qbittorrent -t master

I just started new job as software consultant in a new startup company, I will try my best to update the builds at the Dropbox site amid busy work schedule. You may ask what is the point ? The point is qbittorrent is the very few open-source non-profit driven and reliable bitorrent application available to the forgotten Mac OS X platform.

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


Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: bunjicat on September 08, 2014, 09:06:33 PM
Newb here.  Running into a problem.  Not sure how to proceed.

server:qbittorrent steve$ sudo ./build-qbittorrent -t master
Password:
You might be prompted for administrator password.

- Compilation date: Mon Sep  8 12:00:46 PDT 2014
- Build version: master
- Source directory: qBittorrent

- Environment variables during compilation:

ccache (compiler cache to enhance compilation speed):
CC=
CXX=
CCACHE_PATH=
CCACHE_SLOPPINESS=
CCACHE_DIR=
CCACHE_LOGFILE=
CCACHE_CPP2=
CCACHE_DISABLE=

pkg-config (executed in configure script):
QT_QMAKE=/opt/local/bin/qmake
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
Version of libtorrent-rasterbar library in use: 1.0.1

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

Be patient, building process is on going ..................
Processor cores for multi-threading: 2

+ case $TAG in
+ /opt/local/bin/svn checkout --depth empty https://github.com/qbittorrent/qBittorrent qBittorrent
+ cd qBittorrent
+ /opt/local/bin/svn update trunk
+ STATUS=127
+ cd /Users/steve/project/qbittorrent
+ set +x
Source code checkout failed with following errors:
./build-qbittorrent: line 175: /opt/local/bin/svn: No such file or directory

Probably you have specified invalid release, please try again.

thanks
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on September 08, 2014, 10:15:27 PM
Sometimes the libtorrent svn repo has problems and times out. Can you rerun the script in a clean folder?
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on September 09, 2014, 03:52:42 AM
Probably you have not install svn client in MacPorts system yet. Execute following command line in Terminal application to confirm.

port installed | grep svn

If you see nothing listed, then issue following command (administrator password required as it requires writing into /opt/local directory):

sudo port install svn

Once svn client has been installed, my build script should not break as I have been using it countless times on my iMac.

Alternatively since Mac OS X come with bundled version of svn client (older version at /usr/bin/svn), you may edit my build script to change from /opt/local/bin/svn to /usr/bin/svn. This build script has been created for portability across different Unix platforms, so just edit the command variable at beginning of script and its all done.

Good luck.

Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: bunjicat on September 10, 2014, 12:16:27 AM
Thanks for the quick reply.  Got svn working by changing script.  Installed libtorrent fine.  Error installing qbittorrent build.  It keeps calling on qBittorrent/trunk but it does not exist.

server:qbittorrent steve$ sudo ./build-qbittorrent -t master
You might be prompted for administrator password.

- Compilation date: Tue Sep  9 15:14:33 PDT 2014
- Build version: master
- Source directory: qBittorrent

- Environment variables during compilation:

ccache (compiler cache to enhance compilation speed):
CC=
CXX=
CCACHE_PATH=
CCACHE_SLOPPINESS=
CCACHE_DIR=
CCACHE_LOGFILE=
CCACHE_CPP2=
CCACHE_DISABLE=

pkg-config (executed in configure script):
QT_QMAKE=/opt/local/bin/qmake
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
Version of libtorrent-rasterbar library in use: 1.0.1

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

Be patient, building process is on going ..................
Processor cores for multi-threading: 2

+ case $TAG in
+ /usr/bin/svn checkout --depth empty https://github.com/qbittorrent/qBittorrent qBittorrent

+ cd qBittorrent
+ /usr/bin/svn update trunk
+ STATUS=0
+ cd /Users/steve/project/qbittorrent
+ set +x
Source code checked out successfully from svn repository.
  Skipped paths: 1


+ /opt/local/bin/port -q deactivate libtorrent-rasterbar
++ echo http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
++ /usr/bin/sed 's/^..*\/\([^/][^/]*\)$/\1/'
+ GEOIP_FILE=GeoIP.dat.gz
+ /bin/rm -f GeoIP.dat.gz
+ /usr/bin/curl -LO http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  403k  100  403k    0     0   486k      0 --:--:-- --:--:-- --:--:--  485k
+ case $TAG in
+ /usr/bin/gzip -cd GeoIP.dat.gz
./build-qbittorrent: line 212: /Users/steve/project/qbittorrent/qBittorrent/trunk/src/geoip/GeoIP.dat: No such file or directory
+ case $TAG in
+ cd /Users/steve/project/qbittorrent/qBittorrent/trunk
./build-qbittorrent: line 230: cd: /Users/steve/project/qbittorrent/qBittorrent/trunk: No such file or directory
+ /bin/cp -f /Users/steve/project/qbittorrent/macxconf.pri.autotools ./macxconf.pri
+ /opt/local/bin/aclocal -I m4
+ /opt/local/bin/autoconf
+ ./configure --with-geoip-database-embedded
+ /usr/bin/make --silent clean
make: *** No rule to make target `clean'.  Stop.
+ /usr/bin/make -j2
+ STATUS=2
+ set +x

Compilation failed, please find details in log file /Users/steve/project/qbittorrent/make.log

Attempted to install mainline version.  It failed also.

server:qbittorrent steve$ sudo ./build-qbittorrent -t 3.1.9.2
You might be prompted for administrator password.

This script only build qBittorrent application from version 3.1.x.x onward.
Please refer to following site for all valid tags of source tree:
https://github.com/qbittorrent/qBittorrent/tags

server:qbittorrent steve$ sudo ./build-qbittorrent -t release-3.1.9.2
You might be prompted for administrator password.

- Compilation date: Tue Sep  9 17:40:37 PDT 2014
- Build version: release-3.1.9.2
- Source directory: release-3.1.9.2

- Environment variables during compilation:

ccache (compiler cache to enhance compilation speed):
CC=
CXX=
CCACHE_PATH=
CCACHE_SLOPPINESS=
CCACHE_DIR=
CCACHE_LOGFILE=
CCACHE_CPP2=
CCACHE_DISABLE=

pkg-config (executed in configure script):
QT_QMAKE=/opt/local/bin/qmake
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
Version of libtorrent-rasterbar library in use: 1.0.1

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

Be patient, building process is on going ..................
Processor cores for multi-threading: 2

+ case $TAG in
+ /usr/bin/svn checkout --depth infinity https://github.com/qbittorrent/qBittorrent/tags/release-3.1.9.2 release-3.1.9.2

+ STATUS=1
+ set +x
Source code checkout failed with following errors:
Error validating server certificate for 'https://github.com:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
Certificate information:
 - Hostname: github.com
 - Valid: from Tue, 08 Apr 2014 00:00:00 GMT until Tue, 12 Apr 2016 12:00:00 GMT
 - Issuer: www.digicert.com, DigiCert Inc, US
 - Fingerprint: a0:c4:a7:46:00:ed:a7:2d:c0:be:cb:9a:8c:b6:07:ca:58:ee:74:5e
(R)eject, accept (t)emporarily or accept (p)ermanently? svn: E175002: Unable to connect to a repository at URL 'https://github.com/qbittorrent/qBittorrent/tags/release-3.1.9.2'
svn: E175002: OPTIONS of 'https://github.com/qbittorrent/qBittorrent/tags/release-3.1.9.2': Server certificate verification failed: issuer is not trusted (https://github.com)

Probably you have specified invalid release, please try again.

Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on September 15, 2014, 12:56:49 AM

Allow me to reiterate what must be done before running the two build scripts:

-- Install Xcode or Command Line Tools (part of Xcode distribution) according to details I have given at beginning of this thread.

-- Install MacPorts package management system and details are given in this thread as well.

-- Once MacPorts has been in place, install necessary/extra third-party Unix packages not bundled with Mac OS X. Note svn Unix client is packaged in subversion package and there is no such thing as svn package (sorry for causing confusion). There may be dependancies among these packages but MacPorts will take care of them automatically (likely qt4-mac depends on boost thus boost does not have to be included in port command line but it won't hurt specifying boost in command line). Note since the version of libtorrent installed through MacPorts is too old, do not specify it in the port command line, instead use the build script build-qbittorrent to build any version (refer to early portion of this thread for usage information). The compiler cache ccache is for accelerate compilation process and is optional (time saved is not too much). Use command "port installed" to confirm all installed packages.

sudo port install qt4-mac boost pkgconfig subversion ccache
port installed

To update MacPorts system and all installed Unix packages, run following command sequence regularly:

sudo port selfupdate
sudo port upgrade outdated
sudo port uninstall inactive

-- Download following three files from my Dropbox site for latest copies: https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3
Take note of release dates of these three files (YYYY/MM/DD format):

build-libtorrent                   --  2014/08/04
build-qbittorrent                 --  2014/08/04
macxconf.pri.autotools      --  2014/07/21
-- used by build-qbittorrent temporary until maintainer has committed these changes into online GitHub repository https://github.com/qbittorrent/qBittorrent

-- Gather these three files in same directory and execute the two build scripts to build libtorrent library and qbittorrent application. Just type name of the scripts and press return when you can not remember command line syntax. After execution of build-qbittorrent script, a disk image file qbittorrent-<version>.dmg will appear in the same directory for standard installation in Mac OS X.

build-libtorrent -t libtorrent-1_0_2
-- Latest libtorrent version 1.0.2 only work with latest alpha version 3.2.0 but not release version 3.1.9.2 of libtorrent (requires libtorrent version 0.16.x).

build-qbittorrent -t master
-- master version means latest alpha version 3.2.0, use "-t release-3.1.9.2" for release version 3.1.9.2 of qbittorrent application.

Followings are what I have just done to build latest versions of qbittorrent with latest versions of libtorrent library and resultant disk image files can be downloaded from the Dropbox site. Peer discovery seems improved when qbittorrent 3.2.0 is built with latest version 1.0.2 of libtorrent library. Following is a log of compilation process for release version 3.1.9.2 of qbittorrent application when build script build-qbittorrent was executed:

Code: [Select]
Wangs-iMac:~/project/qbittorrent$ ./build-qbittorrent -t release-3.1.9.2
You might be prompted for administrator password.

- Compilation date: Mon Sep 15 06:46:07 SGT 2014
- Build version: release-3.1.9.2
- Source directory: release-3.1.9.2

- Environment variables during compilation:

ccache (compiler cache to enhance compilation speed):
CC=ccache clang
CXX=ccache clang++
CCACHE_PATH=/usr/bin
CCACHE_SLOPPINESS=file_macro,include_file_mtime,time_macros
CCACHE_DIR=/Users/littletree/Library/Caches/ccache
CCACHE_LOGFILE=/Users/littletree/Library/Caches/ccache.log
CCACHE_CPP2=
CCACHE_DISABLE=

pkg-config (executed in configure script):
QT_QMAKE=/opt/local/bin/qmake
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
Version of libtorrent-rasterbar library in use: 0.16.9

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

Be patient, building process is on going ..................
Processor cores for multi-threading: 4

+ case $TAG in
+ /opt/local/bin/svn checkout --depth infinity https://github.com/qbittorrent/qBittorrent/tags/release-3.1.9.2 release-3.1.9.2
+ STATUS=0
+ set +x
Source code checked out successfully from svn repository.
Checked out revision 6005.


+ /opt/local/bin/port -q deactivate libtorrent-rasterbar
++ echo http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
++ /usr/bin/sed 's/^..*\/\([^/][^/]*\)$/\1/'
+ GEOIP_FILE=GeoIP.dat.gz
+ /bin/rm -f GeoIP.dat.gz
+ /usr/bin/curl -LO http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  403k  100  403k    0     0   125k      0  0:00:03  0:00:03 --:--:--  125k
+ case $TAG in
+ /usr/bin/gzip -cd GeoIP.dat.gz
+ case $TAG in
+ cd /Users/littletree/project/qbittorrent/release-3.1.9.2
+ /opt/local/bin/qmake qbittorrent.pro
+ /usr/bin/make --silent clean
Project MESSAGE: On Mac OS X, GeoIP database must be embedded.
Project MESSAGE: Project is built in RELEASE mode.
Project MESSAGE: Disabling debug output.
Project MESSAGE: GeoIP.dat was found in src/geoip/.
Project MESSAGE: qtAddLibrary: found framework QtXml in directory /opt/local/Library/Frameworks
Project MESSAGE: qtAddLibrary: found framework QtGui in directory /opt/local/Library/Frameworks
Project MESSAGE: qtAddLibrary: found framework QtNetwork in directory /opt/local/Library/Frameworks
Project MESSAGE: qtAddLibrary: found framework QtCore in directory /opt/local/Library/Frameworks
+ /usr/bin/make -j4
+ STATUS=0
+ set +x
WARNING:
WARNING: "qbittorrent.app/Contents/Resources/qt.conf" already exists, will not overwrite.
WARNING: To make sure the plugins are loaded from the correct location,
WARNING: please make sure qt.conf contains the following lines:
WARNING: [Paths]
WARNING:   Plugins = PlugIns


cache directory                     /Users/littletree/Library/Caches/ccache
cache hit (direct)                     9
cache hit (preprocessed)               0
cache miss                           212
called for link                        2
called for preprocessing              13
preprocessor error                     1
bad compiler arguments                 2
autoconf compile/link                 26
no input file                         11
files in cache                       795
cache size                          36.9 Mbytes
max cache size                     500.0 Mbytes

------------------------------------------------------------------------------------------------------------------------------
All done, resultant log files and application installation file are located in directory /Users/littletree/project/qbittorrent
------------------------------------------------------------------------------------------------------------------------------
Title: Xcode/Command Line Tools upgrade
Post by: littletree76 on September 19, 2014, 05:35:43 PM

Just upgraded Mac OS X from 10.9.4 to 10.9.5 and Xcode from version 5.1.1 to version 6.0.1 (corresponding upgrade for Command Line Tools available for download as well). I noticed that I have used older version of libtorrent (version 0.16.9) instead of latest version 0.16.18 for previous build of release version 3.1.9.2 of qbittorrent application. Thus I have rebuild both versions (3.1.9.2 and 3.2.0) of qbittorrent application with latest compatible releases (0.16.18 and 1.0.2) of libtorrent library.

Both disk image files ready for installation in Mac OS 10.9.5 are available for download at Dropbox site together with the two shell script files (build-libtorrent, build-qbittorrent) and a configuration file (macxconf.pri.autotools) for building everything (make sure you have installed Xcode/Command Line Tools and MacPorts with required Unix packages first).

./build-libtorrent -t libtorrent-0_16_18
./build-qbittorrent -t release-3.1.9.2

./build-libtorrent -t libtorrent-1_0_2
./build-qbittorrent -t master

Dropbox site: https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3
Title: Compiling new release 3.1.10
Post by: littletree76 on September 28, 2014, 02:15:00 AM

Today I have attempted compilation of new release 3.1.10 (released 7 days ago). Note there is oversight in build script build-qbittorrent which does not cater for three-digit release number (3.1.x instead of 3.1.x.x). I have updated the shell script and uploaded to Dropbox site for public access. So make sure you have downloaded following three files from the Dropbox site before attempting to compile the new release: build-libtorrent, build-qbittorrent and macxconfig.pri.autotools

Once the three files have been downloaded to a common folder, issue following commands in Terminal application for fully automated compilation (again Xcode and MacPorts and required Unix packages must be installed first, see my earlier posts in this thread. I am using Xcode 6.0.1, MacPorts 2.3.1 in Mac OS 10.9.5 without issue).

./build-libtorrent -t libtorrent-0_16_18
./build-qbittorrent -t release-3.1.10

Unfortunately there are some incompatibilities in source code when you try to compile them in Mac OS X environment (see last 50 lines of make.log file after compilation as shown below), awaiting maintainer to fix these issues before I can attempt to compile again hopefully within next week. Complete make.log file is attached with this note for members to download and provide some enlightenments.

If you really have to compile qbittorrent in Mac OX (10.9.5) right now, you may try with the latest alpha version 3.2.0 as follows (note support for different version of libtorrent library). Alternatively you may just download the resultant disk image file qbittorrent-master.dmg I have just uploaded to Dropbox site for immediate installation in Mac OS 10.9.5.

./build-libtorrent -t libtorrent-1_0_2
./build-qbittorrent -t master

I haven't encounter any serious bug in using the alpha version 3.2.0 of qbittorrent application yet but if you do please let the maintainer know about it for rectification in source code.

Code: [Select]
Wangs-iMac:~/project/qbittorrent$ tail -50 make.log
misc.cpp:140:7: error: reference to overloaded function could not be resolved; did you mean to call it?
  if (sleep)
      ^~~~~
/usr/include/unistd.h:475:3: note: possible target for call
         sleep(unsigned int) __DARWIN_ALIAS_C(sleep);
         ^
/usr/local/include/libtorrent/thread.hpp:59:22: note: possible target for call
        TORRENT_EXPORT void sleep(int milliseconds);
                            ^
fs_utils.cpp:378:15: warning: 'FSFindFolder' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
  OSErr err = FSFindFolder(kUserDomain, kApplicationSupportFolderType, false, &ref);
              ^
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h:286:1: note: 'FSFindFolder' has been explicitly marked deprecated here
FSFindFolder(
^
fs_utils.cpp:383:7: warning: 'FSRefMakePath' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
  if (FSRefMakePath(&ref, reinterpret_cast<UInt8 *>(ba.data()), ba.size()) == noErr)
      ^
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:4086:18: note: 'FSRefMakePath' has been explicitly marked deprecated here
extern OSStatus  FSRefMakePath(const FSRef *ref, UInt8 *path, UInt32 pathBufferSize)     __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
                 ^
fs_utils.cpp:405:15: warning: 'FSFindFolder' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
  OSErr err = FSFindFolder(kUserDomain, kCachedDataFolderType, false, &ref);
              ^
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h:286:1: note: 'FSFindFolder' has been explicitly marked deprecated here
FSFindFolder(
^
fs_utils.cpp:410:7: warning: 'FSRefMakePath' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
  if (FSRefMakePath(&ref, reinterpret_cast<UInt8 *>(ba.data()), ba.size()) == noErr)
      ^
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:4086:18: note: 'FSRefMakePath' has been explicitly marked deprecated here
extern OSStatus  FSRefMakePath(const FSRef *ref, UInt8 *path, UInt32 pathBufferSize)     __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
                 ^
misc.cpp:141:5: error: use of undeclared identifier 'EventToSend'
    EventToSend = kAESleep;
    ^
misc.cpp:143:5: error: use of undeclared identifier 'EventToSend'
    EventToSend = kAEShutDown;
    ^
misc.cpp:142:3: warning: add explicit braces to avoid dangling else [-Wdangling-else]
  else
  ^
misc.cpp:159:47: error: use of undeclared identifier 'EventToSend'
  error = AECreateAppleEvent(kCoreEventClass, EventToSend, &targetDesc,
                                              ^
1 warning and 4 errors generated.
make[1]: *** [misc.o] Error 1
make[1]: *** Waiting for unfinished jobs....
4 warnings generated.
make: *** [sub-src-make_default] Error 2
Title: Successful compilation for latest release 3.1.10
Post by: littletree76 on October 06, 2014, 03:41:30 AM

Necessary fixes have just been committed into branch v3_1_x of qbittorrent source tree. I have modified build script build-qbittorrent to include branch beside release tag of source tree so that users can compile latest source code with necessary fixes incorporated as follows:

./build-libtorrent -t libtorrent-0_16_18
./build-qbittorrent -b v3_1_x

Take note command line option t for tag and option b for branch. Once these fixes have been released with tag 3.1.10, you should be able to compile qbittorrent application as follows to produce disk image file qbittorrent-release-3.1.10.dmg for installation in Mac OS X.

./build-libtorrent -t libtorrent-0-16-18
./build-qbittorrent -t release-3.1.10

I have done just that to produce new disk image file: qbittorrent-v3_1_x.dmg ready for installation in Mac OS 10.9.5. Both build scripts (libtorrent and qbittorrent) and the disk image files have been uploaded to Dropbox site for free download.

https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3
Title: Mac OS 10.10 Yosemite with Xcode/Command Line Tools 6.1
Post by: littletree76 on October 18, 2014, 10:56:17 AM

Few hours after Apple announced availability of Mac OS 10.10 Yosemite at Mac App Store for free upgrade in the Apple event, I upgraded Mac OS 10.9.5 on my iMac. Today I also upgraded Xcode/Command Line Tools from version 6.0.1 to latest version 6.1. There are few commits in source code of libtorrent (branch version 1.0.3 available) and qbittorrent to be picked up as well.

Unfortunately compiling Alpha version 3.2.0 qbittorrent with branch version 1.0.3 of libtorrent failed with following error messages in make log file:

/usr/bin/clang++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.10 -o qbittorrent.app/Contents/MacOS/qbittorrent qtsingleapplication.o qtlocalpeer.o qbtsession.o qtorrenthandle.o torrentspeedmonitor.o alertdispatcher.o torrentstatistics.o torrentmodel.o shutdownconfirm.o httpserver.o httpconnection.o httprequestparser.o httpresponsegenerator.o btjson.o prefjson.o httpheader.o httprequestheader.o httpresponseheader.o json_parser.o json_scanner.o parser.o serializer.o qtracker.o options_imp.o preferences.o lineedit.o propertieswidget.o peerlistwidget.o trackerlist.o proptabbar.o downloadedpiecesbar.o pieceavailabilitybar.o searchengine.o searchtab.o engineselectdlg.o rss_imp.o rsssettingsdlg.o feedlistwidget.o rssmanager.o rssfeed.o rssfolder.o rssarticle.o automatedrssdownloader.o rssdownloadrule.o rssdownloadrulelist.o cookiesdlg.o rssfile.o rssparser.o torrentcreatordlg.o torrentcreatorthread.o geoipmanager.o powermanagement.o main.o downloadthread.o scannedfoldersmodel.o misc.o fs_utils.o smtp.o dnsupdater.o mainwindow.o ico.o transferlistwidget.o torrentcontentmodel.o torrentcontentmodelitem.o torrentcontentmodelfolder.o torrentcontentmodelfile.o torrentcontentfiltermodel.o sessionapplication.o torrentimportdlg.o executionlog.o previewselect.o iconprovider.o updownratiodlg.o loglistwidget.o addnewtorrentdialog.o autoexpandabledialog.o statsdialog.o messageboxraised.o statussortfilterproxymodel.o qmacapplication.o programupdater.o moc_qtsingleapplication.o moc_qtlocalpeer.o moc_qbtsession.o moc_bandwidthscheduler.o moc_torrentspeedmonitor.o moc_filterparserthread.o moc_alertdispatcher.o moc_torrentstatistics.o moc_torrentmodel.o moc_shutdownconfirm.o moc_httpserver.o moc_httpconnection.o moc_qtracker.o moc_options_imp.o moc_advancedsettings.o moc_preferences.o moc_lineedit.o moc_propertieswidget.o moc_peerlistwidget.o moc_proplistdelegate.o moc_trackerlist.o moc_downloadedpiecesbar.o moc_peerlistdelegate.o moc_peerlistsortmodel.o moc_peeraddition.o moc_trackersadditiondlg.o moc_pieceavailabilitybar.o moc_proptabbar.o moc_searchengine.o moc_searchtab.o moc_engineselectdlg.o moc_pluginsource.o moc_searchlistdelegate.o moc_supportedengines.o moc_searchsortmodel.o moc_rss_imp.o moc_rsssettingsdlg.o moc_feedlistwidget.o moc_rssmanager.o moc_rssfeed.o moc_rssfolder.o moc_rssarticle.o moc_automatedrssdownloader.o moc_cookiesdlg.o moc_rssparser.o moc_torrentcreatordlg.o moc_torrentcreatorthread.o moc_geoipmanager.o moc_powermanagement.o moc_downloadthread.o moc_filesystemwatcher.o moc_scannedfoldersmodel.o moc_qinisettings.o moc_smtp.o moc_dnsupdater.o moc_mainwindow.o moc_transferlistwidget.o moc_transferlistdelegate.o moc_transferlistfilterswidget.o moc_transferlistsortmodel.o moc_torrentcontentmodel.o moc_torrentcontentfiltermodel.o moc_deletionconfirmationdlg.o moc_statusbar.o moc_reverseresolution.o moc_speedlimitdlg.o moc_about_imp.o moc_previewselect.o moc_previewlistdelegate.o moc_downloadfromurldlg.o moc_trackerlogin.o moc_sessionapplication.o moc_torrentimportdlg.o moc_executionlog.o moc_updownratiodlg.o moc_loglistwidget.o moc_addnewtorrentdialog.o moc_autoexpandabledialog.o moc_statsdialog.o moc_messageboxraised.o moc_statussortfilterproxymodel.o moc_qmacapplication.o moc_programupdater.o qrc_icons.o qrc_lang.o qrc_about.o qrc_webui.o qrc_lineeditimages.o qrc_search.o qrc_geoip.o   -F/opt/local/Library/Frameworks -F/opt/local/lib  -L/opt/local/lib -L/usr/local/lib -ltorrent-rasterbar -lz -lboost_system-mt -framework Carbon -framework IOKit -F/opt/local/Library/Frameworks -F/opt/local/lib -framework QtXml -framework QtCore -framework QtGui -framework QtNetwork
Undefined symbols for architecture x86_64:
  "libtorrent::base32decode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      misc::magnetUriToHash(QString const&) in misc.o
  "libtorrent::has_parent_path(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      TorrentImportDlg::on_browseContentBtn_clicked() in torrentimportdlg.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [qbittorrent.app/Contents/MacOS/qbittorrent] Error 1
make: *** [sub-src-make_default] Error 2

So I have to revert back to release tag version 1.0.2 of libtorrent to compile with source code of latest version 3.2.0 qbittorrent application. Followings are what I have done to upgrade MacPorts to match with new Mac OS X and to proceed with the compilation.

-- To install latest version 6.1 of Command Line Tools (for compiler, linker etc):
Issue this command "xcode-select --install" in Terminal application and click on Install button when prompted with popup.

-- Download right version of package file from following website to upgrade MacPorts from version 2.3.1 (for Mac OS Mavericks) to version 2.3.2 (for Mac OS Yosemite).
https://www.macports.org/install.php

-- Once new MacPorts is in place, issue following commands in Terminal application to upgrade the rest of MacPorts components and all Unix third-party packages (take some time to complete):
sudo port selfupdate
sudo port upgrade outdated
sudo port uninstall inactive

-- Compile qbittorrent application with right combinations of versions for source code of qbittorrent application and libtorrent library with build scripts.

For release version 3.1.10 of qbittorrent:

./build-libtorrent -b RC_0_16                (latest branch version)
./qbittorrent -b v3_1_x                          (latest branch version)

For Alpha version 3.2.0 of qbittorrent:

./build-libtorrent -t libtorrent-1_0_2       (latest tag release version)
./qbittorrent -b master                           (latest alpha version)

Note I have updated both build scripts to change command line option for master/truck version from t (for tag release) to b (for branch release) as now both scripts must cater to branch releases and strictly speaking master/truck version has to be considered as branch of source tree but not tag release. Previously both scripts catered to only tag but not branch releases.

All updated build scripts and resultant disk image files have been uploaded to usual Dropbox site for free download: https://www.dropbox.com/sh/45qkagvurvxh3tp/UX0Ni-BVK3
Take note this is probably the last time I compile for Mac OS 10.9.x Mavericks platform (disk image files in mavericks folder in the Dropbox site), you have to compile on your own with the two build scripts and macxconf.pri.autotools configuration file for any future releases of libtorrent/qbittorrent in the old Mac OS 10.9.x Mavericks environment. I will continue to build future versions of qbittorrent application in new Mac OS 10.10.x Yosemite environment and place them in yosemite folder in the Dropbox site.

It is definitely worth to upgrade from Mavericks to Yosemite when your Mac hardware can support the new Mac OS X, every operation become snappier with eye pleasing icon/theme. Over short period of time, Apple will iron out those trivial issues with the new Mac OS X.

Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Nemo on October 18, 2014, 05:02:50 PM
Thanks for your time and efforts mate.
Title: Lastet builds for release version 3.1.11 and alpha version 3.2.0
Post by: littletree76 on October 27, 2014, 09:35:23 AM

Both versions have been compiled successfully in Mac OS 10.10 and tested in Mac OS 10.10 Yosemite and previous Mac OS 10.9.5 Mavericks without issue. Thus there is no need for different builds between these two versions of Mac OS X and all old builds have been removed from my Dropbox site and the latest builds have been uploaded for free download.

These builds are linked statically as self-contained application thus no extra library installation is required for execution. Just drag the application file from mounted disk image to the Applications folder and then run it just like any other applications.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: MrGreg on October 30, 2014, 05:41:27 AM
Hi Littletree,

So does this mean you have successfully built Alpha version 3.2.0 qbittorrent with branch version 1.0.3 of libtorrent? Or is your latest alpha release based on libtorrent 1.0.2? Thanks...
Title: Lastet builds for release version 3.1.11 and alpha version 3.2.0
Post by: littletree76 on October 30, 2014, 05:51:12 AM

Libraries used in compiling latest version of qbittorrent application:

Alpha version 3.2.0 (source not compatible with branch version 1.0.3 of libtorrent library yet).
libtorrent - release version 1.0.2
boost  - 1.56
qt-mac - 4.86

Release version 3.1.11 (source not compatible with any version of libtorrent above 1.x ).
libtorrent - branch version 0.16.18 (with latest fixes implemented)
boost - 1.56
qt-mac - 4.86
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Nemo on October 30, 2014, 09:08:28 PM
Thanks littletree76.
Title: New builds for both 3.1.11 and 3.2.0 versions
Post by: littletree76 on November 06, 2014, 03:36:02 PM

I have recompiled both versions (3.2.0 and 3.1.11) in freshly installed Mac OS 10.10 Yosemite environment (because iMac crashed by booting into safe mode and 4TB data migration to new LaCie RAID storage connected to the iMac) with latest Xcode 6.1 and only tag release versions of libtorrent (1.0.2 and 0.16.18 respectively to versions of qbittorrent application). The resultant disk image files for direct installation (they are statically linked thus no library installation required) are available at usual Dropbox site.

Both versions have been tested in Mac OS 10.10 Yosemite on my mid-2011 iMac and Mac OS 10.9.5 Mavericks on mid-2012 Macbook pro (borrowed from colleague in office with standard Mac OS 10.9.5 installation) and with my test torrent (available at the Dropbox site as well) with very good download bandwidth (10 MiB/sec for 100 Mbps broadband Internet connection) and without any issues. Thus just make sure that users received the same disk image files as in the Dropbox site.

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

For those users who are still using Mac OS X older than 10.9.x version (two generations away mainly because their rather old Mac hardwares do not support newer Mac OS X) , if the pre-compiled qbittorrent application does not work then they have to compile with the two build scripts also available at the Dropbox site. Of course you have to install Xcode or Command Line Tools and MacPorts first before running the two build scripts as follows:

-- Xcode or Command Line Tools
Download latest Xcode from Mac App Store or Apple developer site (with free account registration) for any older versions. To install Command Line Tools without the huge Xcode installation, just issue following command in Terminal application (Apple Darwin Unix):
xcode-select --install

--MacPorts Unix package manager for porting any required third-party Unix packages for compilation.
Download readily available installer (correspond to your Mac OS X version) from following site and follow instructions on display to install. Once installed port command will be available for execution in Apple Darwin Unix environment. After MacPorts installation is done, issue command "sudo port selfupdate" to update the port map.
https://www.macports.org/install.php

-- Porting of all required third-party Unix packages.
Issue following command line in Terminal application as super user to transfer raw source files for compilation on your Mac (it takes some time for such number of packages and note libtorrent package is not required since it has been handled by build-libtorrent shell script as follows).
sudo port install qt4-mac boost pkgconfig subversion ccache

-- Run the build scripts to build libtorrent library and qbittorrent application in Unix environment on your Mac.
./build-libtorrent -t libtorrent-0_16_18 for qbittorrent 3.1.11
or:
./build-libtorrent -t libtorrent-1_0_2 for qbittorrent 3.2.0
followed by:
./build-qbittorrent -t release-3.1.11 for qbittorrent 3.1.11
or:
./build-qbittorrent -b master for qbittorrent 3.2.0

If your are using Hackintosh (hacked Mac OS X installed on PC machine) or other non-standard Mac OS X installations, then probably you can forget about qbittorrent application when the precompiled versions and the build scripts do not work on your Mac (I do not know how to fix your problem).
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: littletree76 on January 17, 2015, 11:20:03 AM
Finally first project for my new job is coming to end and I can find time to pick up where I left off for qbittorrent.

Today I have attempted compilation with all lastest versions of libtorrent-rasterbar, boost and qbittorrent using latest release of Xcode 6.1.1 and updated Macports 2.3.3. Since libtorrent-rasterbar 1.0.3 has been released in Macports system, I have reverted from former version hosted in the SVN site: svn.code.sf.net to the Macports version in my build-qbittorrent script. So the build script build-libtorrent is no longer needed for this build.

Mac OS 10.10.1
Xcdoe or Command Line Tools - 6.1.1
Macports - 2.3.3
qt4-mac - 4.8.6 (installed through Macports)
boost - 1.57 (installed through Macports)
libtorrent-rasterbar - 1.0.3 (installed through Macports)
qbittorrent - 3.2.0 (checked out from github.com/qbittorrent/qBittorrent on 17-Jan-2015)

There is a problem in configure script bundled with the checked out trunk (master) version of qbittorrent. Particularly in this script, the sed command processes argument list wrongly and variable QBT_CONF_EXTRA_CFLAGS has been set with entirely wrong value. As such the automatic configuration process aborts and no Makefile is generated. Nevertheless this problem has been circumvented in my build-qbittorrent script temporarily until permanent fix is released. The configuration process able to proceed with proper Makefile generated. This was the biggest problem encountered by those who have attempted qbittorrent compilation with my build-qbittorrent script.

However after make command is initiated in build-qbittorrent script to proceed with final compilation, following error occurs and remedy can only be done in source code by the maintainer. The complete make file (error happens from line 142 onward) is attached with this post for reference. I suppose this is a trivial font issue to be corrected in code for Mac OS version.

Code: [Select]
/usr/bin/clang++ -c -pipe -DTORRENT_USE_OPENSSL -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_DYN_LINK -                   DTORRENT_LINKING_SHARED -I/opt/local/include/libtorrent -g -O2 -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.10 -Wall -W -DWITH_GEOIP_EMBEDDED -DQT_NO_DEBUG_OUTPUT -      DVERSION_MAJOR=3 -DVERSION_MINOR=2 -DVERSION_BUGFIX=0 -DVERSION_BUILD=0 -DVERSION=\"v3.2.0alpha\" -DQT_NO_CAST_TO_ASCII -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -   DBOOST_FILESYSTEM_VERSION=2 -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/local/share/qt4/mkspecs/macx-g++ -I. -I. -I/opt/local/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtGui.framework/Versions/4/   Headers -I/opt/local/Library/Frameworks/QtXml.framework/Versions/4/Headers -I/usr/include/openssl -I/usr/include -I/opt/local/include/boost -I. -Iqtsingleapp -Iqtlibtorrent -      Iwebui -Iwebui/qjson -Itracker -Ipreferences -Ilineedit/src -Iproperties -Isearchengine -Irss -Itorrentcreator -Igeoip -Ipowermanagement -I/opt/local/Library/Frameworks/QtXml.     framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/include -I. -F/opt/local/Library/Frameworks -F/opt/local/lib -o application.o application.cpp
/usr/bin/clang++ -c -pipe -DTORRENT_USE_OPENSSL -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_DYN_LINK -                   DTORRENT_LINKING_SHARED -I/opt/local/include/libtorrent -g -O2 -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.10 -Wall -W -DWITH_GEOIP_EMBEDDED -DQT_NO_DEBUG_OUTPUT -      DVERSION_MAJOR=3 -DVERSION_MINOR=2 -DVERSION_BUGFIX=0 -DVERSION_BUILD=0 -DVERSION=\"v3.2.0alpha\" -DQT_NO_CAST_TO_ASCII -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -   DBOOST_FILESYSTEM_VERSION=2 -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/local/share/qt4/mkspecs/macx-g++ -I. -I. -I/opt/local/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtGui.framework/Versions/4/   Headers -I/opt/local/Library/Frameworks/QtXml.framework/Versions/4/Headers -I/usr/include/openssl -I/usr/include -I/opt/local/include/boost -I. -Iqtsingleapp -Iqtlibtorrent -      Iwebui -Iwebui/qjson -Itracker -Ipreferences -Ilineedit/src -Iproperties -Isearchengine -Irss -Itorrentcreator -Igeoip -Ipowermanagement -I/opt/local/Library/Frameworks/QtXml.     framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/include -I. -F/opt/local/Library/Frameworks -F/opt/local/lib -o mainwindow.o mainwindow.cpp
/usr/bin/clang++ -c -pipe -DTORRENT_USE_OPENSSL -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_EXCEPTION_DISABLE -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_DYN_LINK -                   DTORRENT_LINKING_SHARED -I/opt/local/include/libtorrent -g -O2 -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.10 -Wall -W -DWITH_GEOIP_EMBEDDED -DQT_NO_DEBUG_OUTPUT -      DVERSION_MAJOR=3 -DVERSION_MINOR=2 -DVERSION_BUGFIX=0 -DVERSION_BUILD=0 -DVERSION=\"v3.2.0alpha\" -DQT_NO_CAST_TO_ASCII -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -   DBOOST_FILESYSTEM_VERSION=2 -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/local/share/qt4/mkspecs/macx-g++ -I. -I. -I/opt/local/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtGui.framework/Versions/4/   Headers -I/opt/local/Library/Frameworks/QtXml.framework/Versions/4/Headers -I/usr/include/openssl -I/usr/include -I/opt/local/include/boost -I. -Iqtsingleapp -Iqtlibtorrent -      Iwebui -Iwebui/qjson -Itracker -Ipreferences -Ilineedit/src -Iproperties -Isearchengine -Irss -Itorrentcreator -Igeoip -Ipowermanagement -I/opt/local/Library/Frameworks/QtXml.     framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/opt/local/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/include -I. -F/opt/local/Library/Frameworks -F/opt/local/lib -o ico.o ico.cpp
application.cpp:50:9: 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;
      ^     
1 error generated.
make[1]: *** [application.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [sub-src-make_default] Error 2
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Rainmaker on July 21, 2015, 07:51:47 AM
I'm running Yosemite 10.10.4 and tried to compile the latest v3.2.1 from source. I followed the guide in the Wiki (over at Github) for using MacPorts but kept getting error2 messages on make. I then tried to follow the Brew instructions and that fails too. I then combed through this thread to try to glean some hints but got nowhere. :(

I eventually tried to run your scripts but it won't recognise 3_2_x and even when trying to run for trunk it says it can only build on version 3.1.x onwards. ARGH!  :o I've compiled and built 3.2.1 from source on Debian without issues and I'd love to build it for my MacBook Pro too. Windows gets new versions instantly but we're always waiting around for someone to hopefully build Linux and Mac apps. I'm happy to do them myself if only I could crack how.

Can anyone kindly offer some advice? I'm pulling out my hair!
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: ignas2526 on July 27, 2015, 04:47:57 PM
Any luck with compiling version 3.2.1 on the mac?
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Rainmaker on July 27, 2015, 06:03:19 PM
Any luck with compiling version 3.2.1 on the mac?

Not from me, but I did try a few more times. I'm a noob though (I'm only used to Linux). Hopefully littletree76 or one of the other gurus will help us out in time. We have to remember this is a community effort and nobody's getting paid for their time.  8)
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: ignas2526 on July 29, 2015, 04:31:14 PM
After about 6 hours of trying I did manage to compile qBittorrent 3.2.1. Unfortunately, it crashes with "Segmentation fault: 11".
The compilation of qBittorrent is super broken.
Firstly geoip.pri kept nagging that GeoIP.dat doesn't exist in src/gui/geoip/ when it did. I had to edit geoip.pri and remove those checks. When I opened geoip.qrc, it did show GeoIP.dat correctly. Then the autoconf or whichever brain damaged program makes src/Makefile inserted a bunch of lowercase letter N's where it was not needed:
Code: [Select]
CXXFLAGS      = -pipe -nI/opt/local/includenDTORRENT_USE_OPENSSLnDBOOST_ASIO_HASH_MAP_BUCKETS=1021nDBOOST_EXCEPTION_DISABLEnDBOOST_ASIO_ENABLE_CANCELIOnDBOOST_ASIO_DYN_LINKnDTORRENT_LINKING_SHAREDnI/opt/local/includenI/opt/local/include/libtorrentnI/opt/local/include -g -O2 -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.9 -Wall -W $(DEFINES)
I had to manually edit src/Makefile and fix typos.

I have no idea why qBittorrent crashes for me. Configure finished fine, Makefile, apart from the incorrect variable above which I've fixed, ran fine.
I've compiled with qt4-mac and libtorrent-rasterbar installed through macports. qBittorrent seems to not want to install with qt5-mac.

Edit:
The src/Makefile is generated by qmake which gets this broken line from conf.pri . conf.pri is generated by configure. I suspect problem is in configure script.
Also, I've opened qBittorrent project with Qt Creator and it seems that it doesn't compile at all with Qt5.4. Does qBittorrent even support Qt5?
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: ignas2526 on August 02, 2015, 02:55:42 PM
I've managed to compile qBittorrent 3.2.2
* The configure or some other brain damaged program still messes up the Makefile as I've described in my previous post. Makefile requires editing
* The geoip.pri still fails to detect existing GeoIp.dat. Editing out detection lines from geoip.pri solves the problem.

Vaguely compilation process:
libtorrent-rasterbar compilation
...
cd qBittorrent
./configure
...
* Makefile and geopip.pri hacking *
...
* A bunch of macport calls here *
...
./configure
make
otool -L qbittorrent.app/Contents/MacOS/qbittorrent
* A bunch of calls such like this one: * sudo install_name_tool -change /opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork @loader_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork qbittorrent.app/Contents/MacOS/qbittorrent
...
macdeployqt qbittorrent.app  -dmg

And that's all.
Download link: https://mega.co.nz/#!W8F2iSpD!1dV5Bsv4uTzeIx6hqmTu8feYT_AFNZ8eO_aQX28EaRw (https://mega.co.nz/#!W8F2iSpD!1dV5Bsv4uTzeIx6hqmTu8feYT_AFNZ8eO_aQX28EaRw)

Unlike 3.2.0 which would not download anything for me, this version seems to download stuff, however, connection always stays "No direct connections" and DHT node count stays at 0. UPnP fails with 500 internal error. Manual port mapping doesn't seem to work either.
Also, all http://... trackers always have status "Not Working". I had this problem in 3.1.12, 3.2.0 and 3.2.2. This pretty much makes it impossible to use private trackers as well as any http trackers.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Rainmaker on August 02, 2015, 02:58:52 PM
Thanks for reporting back and for your efforts. Looks like I'm stuck with uTorrent Mac for a while longer yet.  :-\
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: ignas2526 on August 02, 2015, 03:07:07 PM
Thanks for reporting back and for your efforts. Looks like I'm stuck with uTorrent Mac for a while longer yet.  :-\
How come? Is it because of the issues I've listed? Are you having them too?
Try running 3.2.2 I've compiled. Maybe you won't have issues I'm having.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Rainmaker on August 02, 2015, 09:49:00 PM
How come? Is it because of the issues I've listed? Are you having them too?
Try running 3.2.2 I've compiled. Maybe you won't have issues I'm having.

Fair point. I'll install it later if/when I get chance and report back. Thanks for taking the time to compile and for getting it to build successfully. :)
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Rainmaker on August 02, 2015, 10:19:46 PM
Your 3.3.2 build wouldn't launch at all for me mate. It seems it's calling on specific libraries/dependencies in /opt rather than having them bundled in the package (I assume you got these via MacPorts or whatever). Thanks anyway, I know you must have spent some sweat on this! Also funny that 3.3.3 is out already... we need to catch a break lol.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on August 06, 2015, 12:48:30 AM
Can you guys test my "test build"??? -> http://builds.shiki.hu/temp/qbittorrent_3.2.3_really_a_test_build.dmg
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Rainmaker on August 06, 2015, 12:51:38 AM
Can you guys test my "test build"??? -> http://builds.shiki.hu/temp/qbittorrent_3.2.3_really_a_test_build.dmg

I'll be able to test in an hour or so if nobody else gets there first. I'll let you know mate. Cheers!
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Rainmaker on August 06, 2015, 02:21:30 AM
Can you guys test my "test build"??? -> http://builds.shiki.hu/temp/qbittorrent_3.2.3_really_a_test_build.dmg

Works great on my 2012 MBP (OS X 10.10.4).  Thanks! 8)

EDIT: I don't want to take the pee, as I know you must be busy enough!... But if you ever got around to it would you consider a quick guide on how you compiled for future reference? I don't mind contributing builds in the future, so long as I know how to do it! I compile qBittorrent on Linux without issues but the Mac compile had me running into issues constantly. Just an idea. Thanks again.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on August 06, 2015, 06:09:36 PM
Can you try my final build that uses libtorrent 1.0.6 and confirm that it launches? (I want to upload it to sf.net)
Link: http://builds.shiki.hu/temp/qbittorrent_3.2.3_final.dmg

Can you guys test my "test build"??? -> http://builds.shiki.hu/temp/qbittorrent_3.2.3_really_a_test_build.dmg

Works great on my 2012 MBP (OS X 10.10.4).  Thanks! 8)

EDIT: I don't want to take the pee, as I know you must be busy enough!... But if you ever got around to it would you consider a quick guide on how you compiled for future reference? I don't mind contributing builds in the future, so long as I know how to do it! I compile qBittorrent on Linux without issues but the Mac compile had me running into issues constantly. Just an idea. Thanks again.

(keep in mind that I have a clean environment)
Code: [Select]
brew install --build-bottle openssl
brew install --build-bottle boost
brew install --build-bottle geoip
brew install --build-bottle libtorrent-rasterbar
brew install --build-bottle qt4
brew install gnu-sed

I install gnu-sed because Mac OS X's sed garbles the conf.pri output. Installing it will not be needed after this bug is fixed: https://github.com/qbittorrent/qBittorrent/issues/3169
(also you may need gawk)
I use "--build-bottle" because it builds for the oldest supported CPU (IIRC core 2 duo). This is why the previous releases were failing. They were built for newer CPUs.

Then you extract the qbt source, you download and put GeoIP.dat to src/gui/geoip and issue:
Code: [Select]
./configure --disable-qt-bus
Finally:
Code: [Select]
macdeployqt src/qbittorrent.app -dmg
And that gives you a .dmg file in src/

However there are 2 problems with my package that I can't seem to solve:
1. HTTPS doesn't work. Try it with an RSS feed. If you put HTTPS in front of it, it doesn't download. If you change it to HTTP it will download. QtNetwork is responsible for this. My hunch is that it doesn't "see openssl". However, I don't know how to solve this yet.
2. macdeployqt doesn't copy the necessary qt plugins into the folder structure. This makes qbt unable to load jpg/gif/ico icons. (look at the tracker icons at the sidepanel. They should have icons).
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: Rainmaker on August 07, 2015, 04:58:03 PM
Can you try my final build that uses libtorrent 1.0.6 and confirm that it launches? (I want to upload it to sf.net)
Link: http://builds.shiki.hu/temp/qbittorrent_3.2.3_final.dmg

So sorry for the delay replying this time. I had surgery recently, still recovering. I can confirm the final build installs and opens perfectly for me (2012 MBP with Core i5, 4GB RAM, OS X Yosemite 10.10.4).

Search works, downloading from search works, importing magnets and torrents works and SOCKS5 works. The only thing I did notice was favicons for https trackers are still failing (404) but I think I remember you saying that was a known issue.

Thanks so much for the info on compiling. I'll have a play around later and see if I can get it working. At least then there's an extra person contributing builds when new releases come out.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: sledgehammer_999 on August 08, 2015, 01:18:49 PM
I am sorry for your surgery.
Anyway I uploaded another build to sf.net. This build seems to also work for HTTPS and have tracker icons in the sidepanel for me. Please test it and give me feedback.
Title: Re: Compiling latest qBittorrent with MacPorts package manager
Post by: ignas2526 on July 17, 2016, 10:29:49 PM
Any news on compiling the 3.3.5 version for the mac? The 3.3.4 suffers from some very annoying bugs: the addition dialog gets stuck when adding multiple torrents and qBittorrent refuses keep some torrents: as soon as I close it, they vanish. Judging by the news 3.3.5 should fix them.
Edit: just restarted the program and every single torrent except for one are gone. Lately, it seems to me that qBittorrent lost it: the most basic things keep breaking... I feel that it is time to think about switching to a more stable torrent client.