qBittorrent official forums

qBittorrent => MAC => Topic started by: GereeNice on April 08, 2014, 04:45:25 PM

Title: can not compile headless on osx
Post by: GereeNice on April 08, 2014, 04:45:25 PM
Hey!

Did anyone have success compiling a headless/nox version on osx? I tried to do so from qbittorrent-3.1.9.tar.gz, but I had lots of trouble. First of all libboost libraries were searched as .so files, had to modify the configure script to look for dylib-s. Probably had to make some symlinks too, I am unsure since after the first 5-6 hours I went berserk trying to fix it :D After "fixing", the code compiled, but specifying --disable-gui still generated a gui executable inside the app bundle in src/ .

Tried to brute-force modify files to switch to nox, but - of course - that didn't work out so well.

Since I could not find an official download, I have to ask if anyone had luck with it? Did I miss something? An answer or a compiled binary would be much appreciated :D

Thanks in advance!
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 08, 2014, 04:55:53 PM
Did you try to make a regular build first?
If not the building process is documented in the wiki: https://github.com/qbittorrent/qBittorrent/wiki/Compilation-guide-for-Mac-OSX-systems
You could adapt it for -nox. (I haven't build on osx since I don't own a mac).
Title: Re: can not compile headless on osx
Post by: GereeNice on April 08, 2014, 05:55:08 PM
Thanks for your time! Tried your suggestion in a freshly extracted folder.

From the guide qmake qbittorrent.pro is fine, but then make fails with "No targets specified and no makefile found". Trying the ./configure way it fails with libboost not found, but then replacing *.so to *.dylib at line 458 in configure lets me run make after.

And it creates a bundled gui app that runs well. After that I deleted the app, did a make clean and a ./configure --disable-gui && make , but the only output I found was a qbittorrent.app bundle in src/ and I could not find a qbittorrent-nox file neither in that bundle, nor anywhere else.

Summed up, normal seems to work but the headless switch feels like if it's not doing anything.
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 08, 2014, 06:44:29 PM
Maybe it doesn't name it qbittorrent-nox (not sure again)
Also the other 2 builders(stickies) didn't mention anything about boost extensions...
Btw do you build on mavericks?
Title: Re: can not compile headless on osx
Post by: GereeNice on April 08, 2014, 09:47:08 PM
Nope, I'm on 10.8 (M. Lion).

Since you mentioned not having a mac, I'd like to point out that an app bundle is basically a directory ending with ".app", containing some required (and all other) files at specific places, including the binary itself. It virtually acts as a single-file application with its own icon (if you double click it, it gets executed instead of opening up), adding itself to the dock showing it's running, etc.. Just in case you are not familiar with it, sorry for the lecture if you were  :-\  :)

On the other hand, a simple binary is the same as on linux, one file that can be executed through terminal. Getting the full bundled app for a program that's supposed to run as a service is illogical, that's why I thought something is wrong. I am pretty sure compiling in headless mode should give a single unix executable file. Running from a bundle is not only unnecessary, but even prevents it from running in the background. And unfortunately the executable file in the directory structure is definitely a gui app, not just mistakenly put in there.

Can the nogui switch get lost somewhere while compiling due to some mac-specific additions or conditions in one of the scripts? I can't rule out that my system is broken but I pretty much followed the guide and the one modification I had to make is only formal and doesn't seem relevant.

I think it would be no surprise if noone tried to make a headless build on osx nowadays, since for the common mac user it would be useless :)
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 08, 2014, 10:57:58 PM
Actually in src.pro the binary name is defined as qbittorrent-nox
On linux it seems that the --disable-gui option is enough.
I don't know why this doesn't work on mac. Maybe qt problem(qmake is used for the build)?
I suggest building the nox version in a new folder. I read somewhere that osx caches the files, so even after "make clean" you might see the older files when doing a new build.
Title: Re: can not compile headless on osx
Post by: GereeNice on April 09, 2014, 11:14:16 AM
I don't call quake directly but it is invoked in configure. Tried to build in a new folder again, only the nox version and it's all the same.

I tried to play with src.pro before and I realised that the "else" branch is the one that's executed at line 25. Meaning that configured with nogui it goes to target=qbittorrent for some reason. If I change that line to anything, it will make the bundled app with the name specified there. The TARGET = qbittorrent-nox block, and therefore probably all other nox-specific conditions are skipped.

That is what I meant in my first post as brute force fixing files, exchanging the nox related if-else blocks. But then I got a failure that a library is not x86_64 compatible or something and I just quit, saying it's too much hacking and I must have created more errors than solving.

nox {
  QT -= gui
  TARGET = qbittorrent-nox
  DEFINES += DISABLE_GUI

} else {
  QT += xml
  CONFIG(static) {
    DEFINES += QBT_STATIC_QT
    QTPLUGIN += qico
  }
  TARGET = qbittorrent
}
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 09, 2014, 12:18:20 PM
Let's track this down.
The configure script creates a conf.pri file in the root dir. What are its contents?
Try putting this line at the start of the file:
Code: [Select]
CONFIG += nox
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 09, 2014, 12:23:25 PM
Oh and the src.pro probably should look like this:
(try this only if the above post fails and in combination with the above post)

Code: [Select]
nox {
  QT -= gui
  TARGET = qbittorrent-nox
  DEFINES += DISABLE_GUI
} else {
  QT += xml
  CONFIG(static) {
    DEFINES += QBT_STATIC_QT
    QTPLUGIN += qico
    TARGET = qbittorrent
  } 
}
Title: Re: can not compile headless on osx
Post by: GereeNice on April 09, 2014, 01:22:33 PM
conf.pri already had it, but to be sure, I added it right after the comment one more time. Didn't seem to have any effect.

Code: [Select]
# qconf

{here}

PREFIX = /usr/local
BINDIR = /usr/local/bin
DATADIR = /usr/local/share

INCLUDEPATH += /usr/local/Cellar/libtorrent-rasterbar/0.16.15/include /usr/local/Cellar/libtorrent-rasterbar/0.16.15/include/libtorrent /usr/local/include
LIBS += -lboost_system-mt.dy
CONFIG += nox
CONFIG -= debug
CONFIG += release
MANPREFIX = $$PREFIX/share

Moving TARGET inside the config bracket in src.pro caused the output to be src.app instead of qbittorrent.app . It won't run by double clicking, but I can run the executable from inside manually, which opens up the gui app.

I did not try to mix them since the second attempt seemingly corrupts the output.
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 09, 2014, 01:37:18 PM
Pff the problem might be simpler than thought. I thought that osx used unixconf.pri too, but no it has it's own(macxconf.pri).
You can either put CONFIG += nox in there OR copy the relevant lines for the conf.pri from unixconf.pri.
I suggest doing the former first.
Title: Re: can not compile headless on osx
Post by: GereeNice on April 09, 2014, 01:47:46 PM
The macxconf.pri addition is progress, now it makes a correctly named qbittorrent-nox bundle. (Though I still think it shouldn't pack it up like this).

Unfortunately I ran into some compilation issues, the same I had with my own brute force fixes. One step forward, one step back.

Code: [Select]
Undefined symbols for architecture x86_64:
  "MainWindow::MainWindow(QWidget*, QStringList const&)", referenced from:
      _main in main.o
  "QMainWindow::~QMainWindow()", referenced from:
      MainWindow::~MainWindow() in main.o
  "QMessageBox::setWindowTitle(QString const&)", referenced from:
      ShutdownConfirmDlg::ShutdownConfirmDlg(QString const&) in qbtsession.o
      LegalNotice::userAgreesWithNotice() in main.o
  "QMessageBox::setIcon(QMessageBox::Icon)", referenced from:
      ShutdownConfirmDlg::ShutdownConfirmDlg(QString const&) in qbtsession.o
  "QMessageBox::setText(QString const&)", referenced from:
      ShutdownConfirmDlg::ShutdownConfirmDlg(QString const&) in qbtsession.o
      LegalNotice::userAgreesWithNotice() in main.o
  "QMessageBox::addButton(QMessageBox::StandardButton)", referenced from:
      ShutdownConfirmDlg::ShutdownConfirmDlg(QString const&) in qbtsession.o
  "QMessageBox::addButton(QString const&, QMessageBox::ButtonRole)", referenced from:
      LegalNotice::userAgreesWithNotice() in main.o
  "QMessageBox::QMessageBox(QWidget*)", referenced from:
      LegalNotice::userAgreesWithNotice() in main.o
  "QMessageBox::QMessageBox(QWidget*)", referenced from:
      ShutdownConfirmDlg::ShutdownConfirmDlg(QString const&) in qbtsession.o
  "QMessageBox::~QMessageBox()", referenced from:
      LegalNotice::userAgreesWithNotice() in main.o
  "QMessageBox::~QMessageBox()", referenced from:
      ShutdownConfirmDlg::askForConfirmation(QString const&) in qbtsession.o
      ShutdownConfirmDlg::~ShutdownConfirmDlg() in qbtsession.o
      non-virtual thunk to ShutdownConfirmDlg::~ShutdownConfirmDlg() in qbtsession.o
      ShutdownConfirmDlg::ShutdownConfirmDlg(QString const&) in qbtsession.o
      ShutdownConfirmDlg::~ShutdownConfirmDlg() in qbtsession.o
      non-virtual thunk to ShutdownConfirmDlg::~ShutdownConfirmDlg() in qbtsession.o
  "GeoIPManager::loadDatabase(libtorrent::session*)", referenced from:
      QBtSession::configureSession() in qbtsession.o
  "IconProvider::getIconPath(QString const&)", referenced from:
      HttpConnection::respond() in httpconnection.o
  "IconProvider::instance()", referenced from:
      HttpConnection::respond() in httpconnection.o
  "QApplication::setStyleSheet(QString const&)", referenced from:
      _main in main.o
  "QApplication::setLayoutDirection(Qt::LayoutDirection)", referenced from:
      _main in main.o
  "QApplication::setQuitOnLastWindowClosed(bool)", referenced from:
      _main in main.o
  "QApplication::exec()", referenced from:
      _main in main.o
  "QApplication::desktop()", referenced from:
      misc::screenCenter(QWidget*) in misc.o
  "QApplication::palette()", referenced from:
      QBtSession::QBtSession() in qbtsession.o
      QBtSession::configureSession() in qbtsession.o
      QBtSession::processBigRatios() in qbtsession.o
      QBtSession::deleteTorrent(QString const&, bool) in qbtsession.o
      QBtSession::initWebUi() in qbtsession.o
      QBtSession::addMagnetUri(QString, bool, bool, QString const&) in qbtsession.o
      QBtSession::addTorrent(QString, bool, QString, bool) in qbtsession.o
      ...
  "QApplication::~QApplication()", referenced from:
      _main in main.o
      QMacApplication::~QMacApplication() in main.o
      QMacApplication::~QMacApplication() in main.o
  "QFontMetrics::~QFontMetrics()", referenced from:
      _main in main.o
  "QSplashScreen::QSplashScreen(QPixmap const&, QFlags<Qt::WindowType>)", referenced from:
      _main in main.o
  "QMacApplication::setReadyToProcessEvents()", referenced from:
      _main in main.o
  "SessionApplication::SessionApplication(QString const&, int&, char**)", referenced from:
      _main in main.o
  "ShutdownConfirmDlg::staticMetaObject", referenced from:
      ShutdownConfirmDlg::ShutdownConfirmDlg(QString const&) in qbtsession.o
  "QtSingleApplication::sendMessage(QString const&, int)", referenced from:
      _main in main.o
  "QtSingleApplication::setActivationWindow(QWidget*, bool)", referenced from:
      _main in main.o
  "QtSingleApplication::isRunning()", referenced from:
      _main in main.o
  "QPen::QPen(QColor const&)", referenced from:
      _main in main.o
  "QPen::~QPen()", referenced from:
      _main in main.o
  "QFont::insertSubstitution(QString const&, QString const&)", referenced from:
      _main in main.o
  "QFont::QFont(QString const&, int, int, bool)", referenced from:
      _main in main.o
  "QFont::~QFont()", referenced from:
      _main in main.o
  "QColor::setNamedColor(QString const&)", referenced from:
      QBtSession::configureSession() in qbtsession.o
      QBtSession::setListeningPort(int) in qbtsession.o
      QBtSession::initWebUi() in qbtsession.o
      QBtSession::addTorrent(QString, bool, QString, bool) in qbtsession.o
      QBtSession::readAlerts() in qbtsession.o
      QBtSession::handleIPFilterError() in qbtsession.o
      Smtp::logError(QString const&) in smtp.o
      ...
  "QColor::QColor(Qt::GlobalColor)", referenced from:
      _main in main.o
  "QColor::QColor(unsigned int)", referenced from:
      QBtSession::downloadFromUrl(QString const&, QList<QNetworkCookie> const&) in qbtsession.o
  "QCursor::pos()", referenced from:
      misc::screenCenter(QWidget*) in misc.o
  "QDialog::exec()", referenced from:
      ShutdownConfirmDlg::askForConfirmation(QString const&) in qbtsession.o
      LegalNotice::userAgreesWithNotice() in main.o
  "QPixmap::QPixmap(QString const&, char const*, QFlags<Qt::ImageConversionFlag>)", referenced from:
      _main in main.o
  "QPixmap::~QPixmap()", referenced from:
      _main in main.o
  "QWidget::setWindowFlags(QFlags<Qt::WindowType>)", referenced from:
      ShutdownConfirmDlg::ShutdownConfirmDlg(QString const&) in qbtsession.o
  "QWidget::move(QPoint const&)", referenced from:
      ShutdownConfirmDlg::ShutdownConfirmDlg(QString const&) in qbtsession.o
      LegalNotice::userAgreesWithNotice() in main.o
  "QPainter::setPen(QPen const&)", referenced from:
      _main in main.o
  "QPainter::setFont(QFont const&)", referenced from:
      _main in main.o
  "QPainter::drawText(QPointF const&, QString const&)", referenced from:
      _main in main.o
  "QPainter::QPainter(QPaintDevice*)", referenced from:
      _main in main.o
  "QPainter::~QPainter()", referenced from:
      _main in main.o
  "QPalette::~QPalette()", referenced from:
      QBtSession::QBtSession() in qbtsession.o
      QBtSession::configureSession() in qbtsession.o
      QBtSession::processBigRatios() in qbtsession.o
      QBtSession::deleteTorrent(QString const&, bool) in qbtsession.o
      QBtSession::initWebUi() in qbtsession.o
      QBtSession::addMagnetUri(QString, bool, bool, QString const&) in qbtsession.o
      QBtSession::addTorrent(QString, bool, QString, bool) in qbtsession.o
      ...
  "QMessageBox::clickedButton() const", referenced from:
      LegalNotice::userAgreesWithNotice() in main.o
  "QFontMetrics::width(QString const&, int) const", referenced from:
      _main in main.o
  "QDesktopWidget::screenNumber(QWidget const*) const", referenced from:
      misc::screenCenter(QWidget*) in misc.o
  "QDesktopWidget::screenNumber(QPoint const&) const", referenced from:
      misc::screenCenter(QWidget*) in misc.o
  "QDesktopWidget::isVirtualDesktop() const", referenced from:
      misc::screenCenter(QWidget*) in misc.o
  "QDesktopWidget::availableGeometry(int) const", referenced from:
      misc::screenCenter(QWidget*) in misc.o
  "QColor::name() const", referenced from:
      QBtSession::addConsoleMessage(QString, QColor) in qbtsession.o
  "QDialog::result() const", referenced from:
      ShutdownConfirmDlg::askForConfirmation(QString const&) in qbtsession.o
  "QWidget::frameGeometry() const", referenced from:
      misc::screenCenter(QWidget*) in misc.o
  "QWidget::window() const", referenced from:
      misc::screenCenter(QWidget*) in misc.o
  "QPainter::fontMetrics() const", referenced from:
      _main in main.o
  "QPalette::brush(QPalette::ColorGroup, QPalette::ColorRole) const", referenced from:
      QBtSession::QBtSession() in qbtsession.o
      QBtSession::configureSession() in qbtsession.o
      QBtSession::processBigRatios() in qbtsession.o
      QBtSession::deleteTorrent(QString const&, bool) in qbtsession.o
      QBtSession::initWebUi() in qbtsession.o
      QBtSession::addMagnetUri(QString, bool, bool, QString const&) in qbtsession.o
      QBtSession::addTorrent(QString, bool, QString, bool) in qbtsession.o
      ...
  "vtable for MainWindow", referenced from:
      MainWindow::~MainWindow() in main.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for QMacApplication", referenced from:
      _main in main.o
      QMacApplication::~QMacApplication() in main.o
      QMacApplication::~QMacApplication() in main.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for ShutdownConfirmDlg", referenced from:
      ShutdownConfirmDlg::ShutdownConfirmDlg(QString const&) in qbtsession.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
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-nox.app/Contents/MacOS/qbittorrent-nox] Error 1
make: *** [sub-src-make_default] Error 2
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 09, 2014, 02:02:30 PM
Did you try a clean compilation? All this references is for code disabled for the nox version...
Title: Re: can not compile headless on osx
Post by: GereeNice on April 09, 2014, 02:22:32 PM
I might not have, gave it another try to be sure, sorry. Here are my exact steps:


Among a lot of other warnings (which is normal I presume, had them on successful compile too) it fails with a font (uh?) issue. However weird, this is in line with the previous symptoms.

Code: [Select]
/usr/local/Cellar/libtorrent-rasterbar/0.16.15/include/libtorrent/storage.hpp:291:45: warning:
      unused parameter 'rd' [-Wunused-parameter]
                bool verify_resume_data(lazy_entry const& rd, ...
                                                          ^
/usr/local/Cellar/libtorrent-rasterbar/0.16.15/include/libtorrent/storage.hpp:291:61: warning:
      unused parameter 'error' [-Wunused-parameter]
                bool verify_resume_data(lazy_entry const& rd, error_code& e...
                                                                          ^
/usr/local/Cellar/libtorrent-rasterbar/0.16.15/include/libtorrent/storage.hpp:292:33: warning:
      unused parameter 'rd' [-Wunused-parameter]
                bool write_resume_data(entry& rd) const { return false; }
                                              ^
main.cpp:195:5: error: incomplete type 'QFont' named in nested name specifier
    QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande");
    ^~~~~~~
/usr/local/Cellar/qt/4.8.5/include/QtCore/qmetatype.h:319:7: note: forward
      declaration of 'QFont'
class QFont;
      ^
27 warnings and 1 error generated.
make[1]: *** [main.o] Error 1
make: *** [sub-src-make_default] Error 2
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 09, 2014, 02:31:05 PM
OK. This is simple and it actually makes sense since the nox version was never tested on osx.
Go to main.cpp:190 and change the ifdef to this:
Code: [Select]
#if defined(Q_OS_MACX) && !defined(DISABLE_GUI)
Sidenote: It appears that the configure script is totally useless on osx. It only benefits linux. So instead of ./configure --disable-gui, just do "qmake qbittorrent.pro" to reproduce the makefile.
(of course you'll still need to edit macxconf.pri for the CONFIG += nox)
Title: Re: can not compile headless on osx
Post by: GereeNice on April 09, 2014, 03:26:22 PM
You are the man! ;D I got the nox executable and it seems to be okay, will try to set it up sometime soon!

Though I have the following remarks:

And just out of curiosity, what will be the official way of fixing the issue? Apart from the obvious main.cpp addition. Will the forementioned and the missing nogui switch be revised or just added to the wiki to use them in the correct order and edit macxconf.pri if you want a headless build?
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 09, 2014, 03:58:45 PM
You are the man! ;D I got the nox executable and it seems to be okay, will try to set it up sometime soon!

Though I have the following remarks:
  • qmake qbittorrent.pro only works if I run configure before. On a fresh folder the make command after qmake gives: make: *** No targets specified and no makefile found.  Stop.

Try one of these(in the order defined) instead of the configure script:
Code: [Select]
qmake "CONFIG += release nox" "CONFIG -= debug" qbittorrent.pro
qmake -macx "CONFIG += release nox" "CONFIG -= debug" qbittorrent.pro
qmake -macx "CONFIG += release nox" "CONFIG -= debug" qbittorrent.pro
qmake -makefile "CONFIG += release nox" "CONFIG -= debug" qbittorrent.pro
qmake -makefile -macx "CONFIG += release nox" "CONFIG -= debug" qbittorrent.pro
  • Bundling the nox build is an error, the app has a huge "no entry sign" on the icon and won't run with a double click. Only the executable is needed.

Does the bundle include the libraries too(qt, boost, libtorrent, openssl etc)? If yes, I don't know how else you could distribute it, since the binary will not run on other machines that don't have these libs installed.

And just out of curiosity, what will be the official way of fixing the issue? Apart from the obvious main.cpp addition. Will the forementioned and the missing nogui switch be revised or just added to the wiki to use them in the correct order and edit macxconf.pri if you want a headless build?

I am revising the build system for 3.2.x. I will take this into account. Are you willing to make test builds in the future to see if my changes work?
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 09, 2014, 04:05:46 PM
After reading the qmake manual, I want you to try this in order to disable the bundle:

1. If the above qmake instructions work try this:
Code: [Select]
qmake "CONFIG += release nox" "CONFIG -= app_bundle debug" qbittorrent.pro
2. If the above doesn't work edit macxconf.pri and put
Code: [Select]
CONFIG -= app_bundle
Title: Re: can not compile headless on osx
Post by: GereeNice on April 09, 2014, 04:48:57 PM
Yeah, sure thing! That's the least I can do. Though I can not guarantee a 100% availability - but if my schedule allows me, I am glad to be of assistance.

So.. Neither of those qmake candidates worked for me.

And the bundle does not contain the libraries, but you are right, the executable won't run on another mac, tried it. Having homebrew installed can be a requirement for developers, or if you plan to have an official build you can pack it into an installer .pkg file to move the dylib-s into place. Or I don't know, if the compiled binary could load them from a specified directory, like, a lib/ folder next to it, that could be another solution too. Now it tries to find them in /usr/local/lib/ but on that dev-free iMac I don't even have /usr/local/ at all.

Tried CONFIG -= app_bundle with the configure method and it's good to go.
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 09, 2014, 05:46:09 PM
When you run "qmake blah blah qbittorrent.pro" did any file get created in the root folder?
You can try this:
Code: [Select]
qmake "CONFIG += release nox" "CONFIG -= app_bundle debug" -o Makefile qbittorrent.pro
Did you copy the entire bundle on the new machine or just the binary?

Quote
Tried CONFIG -= app_bundle with the configure method and it's good to go.

Does this mean that it didn't create a bundle, just a binary?
Title: Re: can not compile headless on osx
Post by: GereeNice on April 10, 2014, 10:28:46 AM
Quote
When you run "qmake blah blah qbittorrent.pro" did any file get created in the root folder?

Yes, a qbittorrent.xcodeproj bundle. And the latest one made a Makefile.xcodeproj . Xcode can open it but it doesn't really seem valid to me. But I'm unfamiliar with Xcode.

Quote
Does this mean that it didn't create a bundle, just a binary?

Yes it does, a single unix binary with the correct name and content.

Quote
Did you copy the entire bundle on the new machine or just the binary?

No I didn't, since it does not contain the libraries and only the Contents/MacOS/qbittorrent file is useful. The other branches of the directory tree are for the gui version, in this form it's invalid. Have any thoughts or suggestions regarding this?
Title: Re: can not compile headless on osx
Post by: GereeNice on April 10, 2014, 10:41:54 AM
To avoid confusion, the middle attachment is a tree of the gui build, not the nox. But it's all the same for the headless, it just puts a different binary into the gui bundle.
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 10, 2014, 02:46:45 PM
Please try this one final thing for creating the makefile. (be sure to do it in a clean dir)
Code: [Select]
qmake -makefile -macx -o Makefile "CONFIG += release nox" "CONFIG -= app_bundle debug"  qbittorrent.pro
What file is created now? I would expect to create only "Makefile".
Title: Re: can not compile headless on osx
Post by: GereeNice on April 10, 2014, 02:54:13 PM
Makefile.xcodeproj again  :-\

The last line of qmake is a warning, does this help you in any way? Weird that it's looking for an xcodeproj file.

Code: [Select]
WARNING: Ignored (not found) '/Volumes/Data/Users/gereenice/Desktop/qbittorrent-3.1.9/src/qbittorrent-nox.xcodeproj'
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 10, 2014, 02:55:30 PM
If it still creates a *.xcodeproj file then try this:
Code: [Select]
qmake -makefile -unix -o Makefile "CONFIG += release nox" "CONFIG -= app_bundle debug"  qbittorrent.pro
Title: Re: can not compile headless on osx
Post by: GereeNice on April 10, 2014, 03:00:29 PM
+1 warning, same result. I only managed to get a conf.pri after a successful ./configure .

Code: [Select]
WARNING: /Volumes/Data/Users/gereenice/Desktop/qbittorrent-3.1.9/unixconf.pri:9: Unable to find file for inclusion conf.pri
Project MESSAGE: Project is built in RELEASE mode.
Project MESSAGE: Disabling debug output.
WARNING: Ignored (not found) '/Volumes/Data/Users/gereenice/Desktop/qbittorrent-3.1.9/src/qbittorrent-nox.xcodeproj'
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 10, 2014, 03:05:15 PM
The point of the qmake aproach is to ultimately make a valid Makefile for make. The conf.pri isn't need for mac, only for the other unix targets(linux). However the configure script seems to make a valid Makefile via qmake and I can't undertand what we are doing wrong....
Title: Re: can not compile headless on osx
Post by: GereeNice on April 10, 2014, 03:12:51 PM
Can this be helpful from configure at line 1582?
Quote
$qm conf4.pro >/dev/null

And there it is from just a few lines before:
Quote
cat >$1/conf4.pro <<EOT
CONFIG  += console
CONFIG  -= app_bundle
QT      -= gui
TARGET   = conf

HEADERS += conf4.h
SOURCES += conf4.cpp


DEFINES += HAVE_MODULES

EOT

I'm a bit lost in that, but it seems like the magic is happening somewhere around there, maybe this can give an idea.
Title: Re: can not compile headless on osx
Post by: GereeNice on April 10, 2014, 03:14:25 PM
The qmake with the -unix switch was the accepted linux approach? I would assume that if there is a (another) command line to create a makefile on linux with qmake that might work here too.
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 10, 2014, 03:17:55 PM
hmm, what are the contents of Makefile.xcodeproj? (copy the first ~20 lines)

edit: with -macx switch
Title: Re: can not compile headless on osx
Post by: GereeNice on April 10, 2014, 03:21:32 PM
That's a bundle not a single file, but the main content is just like the one I sent you the screenshot of earlier. Made and attached a new with:

Quote
qmake -makefile -macx -o Makefile "CONFIG += release nox" "CONFIG -= app_bundle debug"  qbittorrent.pro
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 10, 2014, 03:24:06 PM
I need to think. I am out of ideas now.
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 10, 2014, 03:27:28 PM
I found something in stackoverflow.com:
Code: [Select]
qmake -makefile -macx -spec macx-g++ -o Makefile "CONFIG += release nox" "CONFIG -= app_bundle debug"  qbittorrent.pro
Title: Re: can not compile headless on osx
Post by: GereeNice on April 10, 2014, 03:39:53 PM
Forgot about the main.cpp fix for a moment, but finally it compiled (properly)! :D Had a small notice, but it's all good :)
Quote
-macx is deprecated.

Great Success!

(http://c3e308.medialib.glogster.com/media/ee/ee94091aae164f90e30e489dbde668f99ebb672a7db30789f4ae6d420d5c9907/borat-thumbs-up-jpg.jpg)
Title: Re: can not compile headless on osx
Post by: GereeNice on April 10, 2014, 03:44:34 PM
Can I have an off-topic question? Only if we are through the compilation issues, of course. I can't seem to find an option for sequential downloads in headless, while I think it's in the gui. Is it hidden somewhere or missing? Should I open a new thread for this request or can you post me _any kind_ of dirty fix (source mod, etc)? I'd need the client to script/automate downloads and having them in preview mode would be pretty much the base of it.
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 10, 2014, 04:05:12 PM
Great!

To tell you the truth I haven't used the nox build at all. Probably this isn't exposed since you can't find it. Also the webui doesn't have this option too.
I may implement it for 3.2.x, if I remember it. Unfortunately I cannot give quick/dirty source fix.

Thanks for the help. I think we solved all the problems now.
Title: Re: can not compile headless on osx
Post by: GereeNice on April 10, 2014, 04:15:51 PM
I would really appreciate it, thank you.

Message me in case you need something tested on osx, I'll try to be of assistance.
Title: Re: can not compile headless on osx
Post by: sledgehammer_999 on April 10, 2014, 04:18:00 PM
Message me in case you need something tested on osx, I'll try to be of assistance.

OK. Thanks.