Author Topic: Compiling latest qBittorrent with MacPorts package manager  (Read 56070 times)

sledgehammer_999

  • qBittorrent maintainer
  • Administrator
  • Forum addict
  • *****
  • Posts: 2406
  • Karma: +150/-2
    • View Profile
Re: Compiling latest qBittorrent with MacPorts package manager
« Reply #45 on: July 15, 2014, 07:28:48 am »
Can you provide the generated moc_qbtsession.cpp ?

littletree76

  • Member
  • **
  • Posts: 67
  • Karma: +3/-0
    • View Profile
Re: Compiling latest qBittorrent with MacPorts package manager
« Reply #46 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

« Last Edit: July 15, 2014, 02:29:39 pm by littletree76 »

littletree76

  • Member
  • **
  • Posts: 67
  • Karma: +3/-0
    • View Profile
New version 1.0.1 of libtorrent package
« Reply #47 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



littletree76

  • Member
  • **
  • Posts: 67
  • Karma: +3/-0
    • View Profile
Compiling qbittorrent 3.2.0 with libtorrent 1.0.1
« Reply #48 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.
« Last Edit: July 24, 2014, 07:47:50 pm by littletree76 »

littletree76

  • Member
  • **
  • Posts: 67
  • Karma: +3/-0
    • View Profile
Compiling qbittorrent 3.1.9.2 with libtorrent 0.16.17
« Reply #49 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
« Last Edit: July 18, 2014, 06:25:08 am by littletree76 »

sledgehammer_999

  • qBittorrent maintainer
  • Administrator
  • Forum addict
  • *****
  • Posts: 2406
  • Karma: +150/-2
    • View Profile
Re: Compiling latest qBittorrent with MacPorts package manager
« Reply #50 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.

littletree76

  • Member
  • **
  • Posts: 67
  • Karma: +3/-0
    • View Profile
Directories for header and library files
« Reply #51 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

sledgehammer_999

  • qBittorrent maintainer
  • Administrator
  • Forum addict
  • *****
  • Posts: 2406
  • Karma: +150/-2
    • View Profile
Re: Compiling latest qBittorrent with MacPorts package manager
« Reply #52 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

littletree76

  • Member
  • **
  • Posts: 67
  • Karma: +3/-0
    • View Profile
Re: Compiling latest qBittorrent with MacPorts package manager
« Reply #53 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.

littletree76

  • Member
  • **
  • Posts: 67
  • Karma: +3/-0
    • View Profile
Update compilation
« Reply #54 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



littletree76

  • Member
  • **
  • Posts: 67
  • Karma: +3/-0
    • View Profile
Update for qbittorrent 3.2.0
« Reply #55 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


« Last Edit: September 06, 2014, 10:52:42 am by littletree76 »

bunjicat

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Compiling latest qBittorrent with MacPorts package manager
« Reply #56 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

sledgehammer_999

  • qBittorrent maintainer
  • Administrator
  • Forum addict
  • *****
  • Posts: 2406
  • Karma: +150/-2
    • View Profile
Re: Compiling latest qBittorrent with MacPorts package manager
« Reply #57 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?

littletree76

  • Member
  • **
  • Posts: 67
  • Karma: +3/-0
    • View Profile
Re: Compiling latest qBittorrent with MacPorts package manager
« Reply #58 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.


bunjicat

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Compiling latest qBittorrent with MacPorts package manager
« Reply #59 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.

« Last Edit: September 10, 2014, 02:43:52 am by bunjicat »