Browse Source

- Patch from Cristian Greco to fix compilation against libtorrent 0.13.1. Big changes were made recently in libtorrent to allow integration in Debian.

adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
c9631c2a3f
  1. 32
      configure
  2. 2
      qbittorrent.qc
  3. 70
      qcm/libtorrent.qcm
  4. 2
      src/src.pro

32
configure vendored

@ -18,9 +18,11 @@ Main options:
--help This help text. --help This help text.
Dependency options: Dependency options:
--with-libtorrent-inc=[path] Path to libtorrent include files --with-libtorrent-inc=[path] Path to libtorrent-rasterbar include
--with-libtorrent-lib=[path] Path to libtorrent library files files
--with-libtorrent-static-lib=[path] Path to libtorrent .a file --with-libtorrent-lib=[path] Path to libtorrent-rasterbar library
files
--with-libtorrent-static-lib=[path] Path to libtorrent-rasterbar .a file
--with-libboost-inc=[path] Path to libboost include files --with-libboost-inc=[path] Path to libboost include files
--with-libcurl-inc=[path] Path to libcurl include files --with-libcurl-inc=[path] Path to libcurl include files
--with-libcurl-lib=[path] Path to libcurl library files --with-libcurl-lib=[path] Path to libcurl library files
@ -357,21 +359,21 @@ public:
return(QT_VERSION >= 0x040300); return(QT_VERSION >= 0x040300);
} }
}; };
#line 1 "libtorrent.qcm" #line 1 "libtorrent-rasterbar.qcm"
/* /*
-----BEGIN QCMOD----- -----BEGIN QCMOD-----
name: libtorrent name: libtorrent-rasterbar
arg: with-libtorrent-inc=[path], Path to libtorrent include files arg: with-libtorrent-inc=[path], Path to libtorrent-rasterbar include files
arg: with-libtorrent-lib=[path], Path to libtorrent library files arg: with-libtorrent-lib=[path], Path to libtorrent-rasterbar library files
arg: with-libtorrent-static-lib=[path], Path to libtorrent .a file arg: with-libtorrent-static-lib=[path], Path to libtorrent-rasterbar .a file
-----END QCMOD----- -----END QCMOD-----
*/ */
class qc_libtorrent : public ConfObj class qc_libtorrent_rasterbar : public ConfObj
{ {
public: public:
qc_libtorrent(Conf *c) : ConfObj(c) {} qc_libtorrent_rasterbar(Conf *c) : ConfObj(c) {}
QString name() const { return "libtorrent >= 0.13"; } QString name() const { return "libtorrent-rasterbar >= 0.13"; }
QString shortname() const { return "libtorrent"; } QString shortname() const { return "libtorrent-rasterbar"; }
bool exec(){ bool exec(){
QString s; QString s;
s = conf->getenv("QC_WITH_LIBTORRENT_INC"); s = conf->getenv("QC_WITH_LIBTORRENT_INC");
@ -405,7 +407,7 @@ public:
s = conf->getenv("QC_WITH_LIBTORRENT_LIB"); s = conf->getenv("QC_WITH_LIBTORRENT_LIB");
if(!s.isEmpty()) { if(!s.isEmpty()) {
if(!conf->checkLibrary(s, "torrent")) { if(!conf->checkLibrary(s, "torrent-rasterbar")) {
return false; return false;
} }
conf->addLib(QString("-L") + s); conf->addLib(QString("-L") + s);
@ -417,7 +419,7 @@ public:
sl << "/usr/local/lib64/"; sl << "/usr/local/lib64/";
bool found = false; bool found = false;
foreach(s, sl){ foreach(s, sl){
if(conf->checkLibrary(s, "torrent")){ if(conf->checkLibrary(s, "torrent-rasterbar")){
found = true; found = true;
break; break;
} }
@ -705,7 +707,7 @@ cat >$1/modules_new.cpp <<EOT
o = new qc_qt4(conf); o = new qc_qt4(conf);
o->required = true; o->required = true;
o->disabled = false; o->disabled = false;
o = new qc_libtorrent(conf); o = new qc_libtorrent_rasterbar(conf);
o->required = true; o->required = true;
o->disabled = false; o->disabled = false;
o = new qc_libboost(conf); o = new qc_libboost(conf);

2
qbittorrent.qc

@ -6,7 +6,7 @@
<dep type='qt4'> <dep type='qt4'>
<required/> <required/>
</dep> </dep>
<dep type='libtorrent'> <dep type='libtorrent-rasterbar'>
<required/> <required/>
</dep> </dep>
<dep type='libboost'> <dep type='libboost'>

70
qcm/libtorrent.qcm

@ -1,70 +0,0 @@
/*
-----BEGIN QCMOD-----
name: libtorrent
arg: with-libtorrent-inc=[path], Path to libtorrent include files
arg: with-libtorrent-lib=[path], Path to libtorrent library files
arg: with-libtorrent-static-lib=[path], Path to libtorrent .a file
-----END QCMOD-----
*/
class qc_libtorrent : public ConfObj
{
public:
qc_libtorrent(Conf *c) : ConfObj(c) {}
QString name() const { return "libtorrent >= 0.13"; }
QString shortname() const { return "libtorrent"; }
bool exec(){
QString s;
s = conf->getenv("QC_WITH_LIBTORRENT_INC");
if(!s.isEmpty()) {
if(!conf->checkHeader(s, "libtorrent/lsd.hpp")) {
return false;
}
}else{
QStringList sl;
sl << "/usr/include";
sl << "/usr/local/include";
bool found = false;
foreach(s, sl){
if(conf->checkHeader(s, "libtorrent/lsd.hpp")){
found = true;
break;
}
}
if(!found) {
return false;
}
}
conf->addIncludePath(s);
conf->addIncludePath(s+QDir::separator()+"libtorrent");
s = conf->getenv("QC_WITH_LIBTORRENT_STATIC_LIB");
if(!s.isEmpty() && QFile::exists(s) && s.endsWith(".a")){
conf->addLib(s);
return true;
}
s = conf->getenv("QC_WITH_LIBTORRENT_LIB");
if(!s.isEmpty()) {
if(!conf->checkLibrary(s, "torrent")) {
return false;
}
conf->addLib(QString("-L") + s);
}else{
QStringList sl;
sl << "/usr/lib/";
sl << "/usr/lib64/";
sl << "/usr/local/lib/";
sl << "/usr/local/lib64/";
bool found = false;
foreach(s, sl){
if(conf->checkLibrary(s, "torrent")){
found = true;
break;
}
}
if(!found) return false;
conf->addLib(QString("-L") + s);
}
return true;
}
};

2
src/src.pro

@ -81,7 +81,7 @@ QMAKE_CXXFLAGS_RELEASE += -fwrapv -O2
QMAKE_CXXFLAGS_DEBUG += -fwrapv -O1 QMAKE_CXXFLAGS_DEBUG += -fwrapv -O1
CONFIG += link_pkgconfig CONFIG += link_pkgconfig
PKGCONFIG += "libtorrent libcurl" PKGCONFIG += "libtorrent-rasterbar libcurl"
!contains(DEFINES, HAVE_MAGICK){ !contains(DEFINES, HAVE_MAGICK){
message(ImageMagick disabled) message(ImageMagick disabled)

Loading…
Cancel
Save