papyros / qml-extras

OBSOLETE - SEE QML-MATERIAL REPOSITORY
https://github.com/papyros/qml-material
63 stars 22 forks source link

Installing with a directory prefix #3

Closed MazeChaZer closed 9 years ago

MazeChaZer commented 9 years ago

I am trying to create an Arch Linux package to install these plugins on my system, but the compilation fails and I cannot figure out why. I have the latest qt5-declarative and qt5-tools packages installed on my 64 bit Arch Linux. This is the console output of the compilation:

$ qmake
$ make check
cd tests/ && ( test -e Makefile || /usr/lib/qt/bin/qmake /tmp/qml-extras/tests/tests.pro -o Makefile ) && make -f Makefile check
make[1]: Entering directory '/tmp/qml-extras/tests'
g++ -c -pipe -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Wall -W -D_REENTRANT -fPIE -DQUICK_TEST_SOURCE_DIR="\"/tmp/qml-extras/tests\"" -DQT_NO_DEBUG -DQT_QMLTEST_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/usr/lib/qt/mkspecs/linux-g++ -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtQuickTest -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtQml -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtCore -I. -o tst_extras.o tst_extras.cpp
g++ -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1 -Wl,-rpath-link,/usr/lib -o tst_extras tst_extras.o   -lQt5QuickTest -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGL -lpthread 
QT_PLUGIN_PATH=/usr/lib/qt/plugins LD_LIBRARY_PATH=/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}  ./tst_extras  -import "/tmp/qml-extras/tests/../modules"
********* Start testing of extras *********
Config: Using QtTest library 5.4.0, Qt 5.4.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 4.9.2)
PASS   : extras::Document Tests::initTestCase()
PASS   : extras::Document Tests::test_datachanged()
PASS   : extras::Document Tests::test_loaddocument()
PASS   : extras::Document Tests::test_savedocument()
PASS   : extras::Document Tests::cleanupTestCase()
PASS   : extras::HttpTests::initTestCase()
QDEBUG : extras::HttpTests::test_getgoogle() qml: GET http://www.google.com undefined
QDEBUG : extras::HttpTests::test_getgoogle() qml: Headers {}
QDEBUG : extras::HttpTests::test_getgoogle() qml: Calling back with no error...
PASS   : extras::HttpTests::test_getgoogle()
PASS   : extras::HttpTests::cleanupTestCase()
PASS   : extras::PromiseTests::initTestCase()
PASS   : extras::PromiseTests::test_createpromise()
PASS   : extras::PromiseTests::test_createpromises()
PASS   : extras::PromiseTests::cleanupTestCase()
Totals: 12 passed, 0 failed, 0 skipped, 0 blacklisted
********* Finished testing of extras *********
make[1]: Leaving directory '/tmp/qml-extras/tests'
$ make DESTDIR="/tmp/qml-extras" install
cd tests/ && ( test -e Makefile || /usr/lib/qt/bin/qmake /tmp/qml-extras/tests/tests.pro -o Makefile ) && make -f Makefile install
make[1]: Entering directory '/tmp/qml-extras/tests'
mkdir: cannot create directory '/usr/tests': Permission denied
Makefile:663: recipe for target 'install_target' failed
make[1]: *** [install_target] Error 1
make[1]: Leaving directory '/tmp/qml-extras/tests'
Makefile:54: recipe for target 'sub-tests-install_subtargets' failed
make: *** [sub-tests-install_subtargets] Error 2
bgdncz commented 9 years ago

The Travis build passes, the problem is, you don't have permissions for mkdir

MazeChaZer commented 9 years ago

Oh I see, it seems that the DESTDIR option I'm trying to pass to make install doesn't have any effect. I would like to be able to install the files to a certain subdirectory and not into / so that I can package them. I also tried the prefix option now, but it doesn't work neither. Is there any command line option to change the installation root?

bgdncz commented 9 years ago

@MazeChaZer Wait, I'm confuesed. The log you posted was for make check. If you want to install the components you just have to run qmake && sudo make install. This will install the framework in the Qt modules folder, so that you could do this in qml: import Material 0.1. What do you actually want to do?

MazeChaZer commented 9 years ago

Ok, this is a little complicated for me, too, because all this packaging stuff is quite new to me, but I try to explain again what I want to archieve.

In the log I posted above I ran 3 commands:

$ qmake
$ make check
$ make DESTDIR="/tmp/qml-extras" install

qmake and make check ran perfectly fine, while make DESTDIR="/tmp/qml-extras" install fails because it tries to install the files into the system directories.

Now what I want to archive: I want to create an Arch Linux package. To do this, I want to install all the files of the project into a subdirectory /tmp/qml-extras so that I can bundle all of them in an installable package. So for example, instead of /usr/lib/qt/qml I want the QML files to be installed into /tmp/qml-extras/usr/lib/qt/qml.

For other projects that use make without qmake the above install command works, there you can just specify the DESTDIR parameter and all files are installed into this path rather than into the root directory. I am wondering if this is also possible with qmake.

Thanks for your responses so far, they were a big help getting closer to the core of the problem.

bgdncz commented 9 years ago

@MazeChaZer In that case you don't even need to do anything. make install basically just moves the files. You can just copy paste :) BTW, I am pretty sure @iBeliever said no arch packages at this time (I think so). Anyway, you should check out the powerpack repo.

MazeChaZer commented 9 years ago

Oh cool this makes it a lot easier ;) I was creating the package just for myself to keep my system tidy, I don't like to install into system directories directly from source without a package manager. I'm pretty sure I'll be able to create a package this way, @boghison thanks again for your help and patience :)

bgdncz commented 9 years ago

@MazeChaZer Oh, no problem, but you really should go celebrate New Year's Eve and leave the package building for later ;)

MazeChaZer commented 9 years ago

@boghison Yep, that's what I did ;) Happy New Year!