Results 1 to 9 of 9

Thread: Change install path of qtdesktopcomponents

  1. #1
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Change install path of qtdesktopcomponents

    Hello,

    I've tried to compile the Desktop Components for Qt 5 and when I run make I get the following error message:
    Qt Code:
    1. make[2]: Entering directory `/home/martin/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop'
    2. mkdir: cannot create directory ‘/usr/lib/qt/qml/QtDesktop/’: Permission denied
    3. make[2]: *** [/usr/lib/qt/qml/QtDesktop/libstyleplugin.so] Error 1
    4. make[2]: Leaving directory `/home/martin/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop'
    To copy to clipboard, switch view to plain text mode 

    Can anybody tell what I have to change so that Qt doesn't try to install a file in my /usr directory when I run the make command?

    The problem seems to originate from the Makefile created by the attached .pro file.

    qmake is the one from Qt5 and the system is a Linux system.


    Best regards
    Martin
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Change install path of qtdesktopcomponents

    Where would you like it to install the plugin?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Change install path of qtdesktopcomponents

    I want to build a package for my distribution (Archlinux). The INSTALL_ROOT should be ${pkgdir}. The problem I have is that the make command tries to install the file libstyleplugin.so in /usr/lib/qt/qml/QtDesktop. I don't understand why the make command tries to install the file into a privileged directory. From all the other make files I've used this is the first time this happened. In my expectation only make install should need root privileges.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Change install path of qtdesktopcomponents

    Quote Originally Posted by StMartin81 View Post
    I want to build a package for my distribution (Archlinux). The INSTALL_ROOT should be ${pkgdir}. The problem I have is that the make command tries to install the file libstyleplugin.so in /usr/lib/qt/qml/QtDesktop. I don't understand why the make command tries to install the file into a privileged directory. From all the other make files I've used this is the first time this happened. In my expectation only make install should need root privileges.
    So change the .pro file to point to somewhere else.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Change install path of qtdesktopcomponents

    Can you tell me what the .pro file should look like then?

    The generated Makefile wants to install libstyleplugin.so into /usr/lib/qt/qml/QtDesktop.
    My guess is that CXX_MODULE = qml is responsible for the /usr/lib/qt/qml and TARGETPATH = QtDesktop is responsible for QtDesktop of the path name.

    So what I would like to have is:
    1. Compile libstyleplugin.so to some place in the build directory
    2. Install the file to ${pkgdir}/usr/lib/qt/qml/QtDesktop via make INSTALL_ROOT="${pkgdir}" install
    3. Distribution package installer installs the file to /usr/lib/qt/qml/QtDesktop

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Change install path of qtdesktopcomponents

    Quote Originally Posted by StMartin81 View Post
    Can you tell me what the .pro file should look like then?

    The generated Makefile wants to install libstyleplugin.so into /usr/lib/qt/qml/QtDesktop.
    My guess is that CXX_MODULE = qml is responsible for the /usr/lib/qt/qml and TARGETPATH = QtDesktop is responsible for QtDesktop of the path name.

    So what I would like to have is:
    1. Compile libstyleplugin.so to some place in the build directory
    2. Install the file to ${pkgdir}/usr/lib/qt/qml/QtDesktop via make INSTALL_ROOT="${pkgdir}" install
    3. Distribution package installer installs the file to /usr/lib/qt/qml/QtDesktop
    Forget the makefile. It is generated from the .pro file so that is what is relevant. This file should contain an entry such as the following:
    qmake Code:
    1. unix {
    2. installPath = $$[QT_INSTALL_IMPORTS]/$$replace(uri, \\., /)
    3. qmldir.path = $$installPath
    4. target.path = $$installPath
    5. INSTALLS += target qmldir
    6. }
    To copy to clipboard, switch view to plain text mode 

    That's what you need to adjust. You can either enter a full path there of fetch the path from environment variable (see qmake docs to learn how to do that).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Change install path of qtdesktopcomponents

    Is there a way to set the DESTDIR variable on the command line?

    I've tried
    $ export DESTDIR=../pkg && qmake
    $ env DESTDIR=../pk && qmake
    $ qmake -set DESTDIR ../pkg

    but none of these three commands did change the destination directory. I really would like to avoid editing the .pro files.

    Is it correct that the files are installed to ${DESTDIR}/${TARGETPATH}. I think I read it somewhere but I can't seem to find that information again.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Change install path of qtdesktopcomponents

    qmake DESTDIR=../pkg
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Change install path of qtdesktopcomponents

    Unfortunately this also didn't work. I'm trying to compile qtdesktopcomponents (https://git.gitorious.org/qtplaygrou...components.git). When I run:
    Qt Code:
    1. qmake DESTDIR=../pkg && make
    To copy to clipboard, switch view to plain text mode 
    it still wants to install a file in /usr directory.

    I think this is the file which generates the library which should get installed into /usr: qtdesktop.pro

    I've tried to replace
    Qt Code:
    1. TARGETPATH = QtDesktop
    To copy to clipboard, switch view to plain text mode 
    with
    Qt Code:
    1. TARGETPATH = $$(PWD)/$$(DESTDIR)/QtDesktop
    To copy to clipboard, switch view to plain text mode 

    Then I run:
    Qt Code:
    1. qmake DESTDIR=../../pkg && make
    To copy to clipboard, switch view to plain text mode 
    but it still wants to install the file into /usr:
    Qt Code:
    1. cd qtdesktop/ && ( test -f Makefile || /usr/bin/qmake /home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop/qtdesktop.pro DESTDIR=../../pkg -o Makefile ) && make -f Makefile
    2. WARNING: DESTDIR: Cannot access directory '/usr/lib/qt/qml/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/pkg/QtDesktop'
    3. make[2]: Entering directory `/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop'
    4. mkdir: das Verzeichnis „/usr/lib/qt/qml/home“ kann nicht angelegt werden: Keine Berechtigung
    5. make[2]: *** [/usr/lib/qt/qml/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/pkg/QtDesktop/libstyleplugin.so] Fehler 1
    To copy to clipboard, switch view to plain text mode 

    I then added
    Qt Code:
    1. INSTALLPATH = $$(PWD)/$$(DESTDIR)
    To copy to clipboard, switch view to plain text mode 
    but this also doesn't change anything.

    Adding this:
    Qt Code:
    1. unix {
    2. installPath = $$(PWD)/$$(DESTDIR)
    3. qmldir.path = $$installPath
    4. target.path = $$installPath
    5. INSTALLS += target qmldir
    6. }
    To copy to clipboard, switch view to plain text mode 
    to the .pro file results in:
    Qt Code:
    1. make[2]: Entering directory `/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop'
    2. /usr/bin/qmake DESTDIR=../../pkg -o Makefile qtdesktop.pro
    3. WARNING: DESTDIR: Cannot access directory '/usr/lib/qt/qml/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop/usr/lib/qt/qml/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop/usr/lib/qt/qml/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop/usr/lib/qt/qml/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/pkg/QtDesktop/QtDesktop/QtDesktop/QtDesktop'
    4. make[2]: Leaving directory `/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop'
    5. make[2]: Entering directory `/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop'
    6. Makefile:8044: warning: overriding recipe for target `install_target'
    7. Makefile:7937: warning: ignoring old recipe for target `install_target'
    8. Makefile:8049: warning: overriding recipe for target `uninstall_target'
    9. Makefile:7942: warning: ignoring old recipe for target `uninstall_target'
    10. Makefile:8055: warning: overriding recipe for target `install_qmldir'
    11. Makefile:7947: warning: ignoring old recipe for target `install_qmldir'
    12. Makefile:8102: warning: overriding recipe for target `uninstall_qmldir'
    13. Makefile:7995: warning: ignoring old recipe for target `uninstall_qmldir'
    14. mkdir: das Verzeichnis „/usr/lib/qt/qml/home“ kann nicht angelegt werden: Keine Berechtigung
    To copy to clipboard, switch view to plain text mode 

    When I add these lines:
    Qt Code:
    1. TARGET.path = $$(PWD)/$$(DESTDIR)/QtDesktop
    2. INSTALLS += TARGET
    To copy to clipboard, switch view to plain text mode 
    I get the following error message:
    Qt Code:
    1. cd qtdesktop/ && ( test -f Makefile || /usr/bin/qmake /home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop/qtdesktop.pro DESTDIR=/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build../../pkg -o Makefile ) && make -f Makefile
    2. make[2]: Entering directory `/home/gumstix/abs/qtdesktopcomponents/src/qtdesktopcomponents-build/src/qtdesktop'
    3. mkdir: das Verzeichnis „/usr/lib/qt/qml/QtQml/“ kann nicht angelegt werden: Keine Berechtigung
    4. make[2]: *** [/usr/lib/qt/qml/QtQml/libstyleplugin.so] Fehler 1
    To copy to clipboard, switch view to plain text mode 

    So I'm out of luck with my guessing.

Similar Threads

  1. Replies: 5
    Last Post: 6th June 2011, 09:56
  2. Replies: 3
    Last Post: 30th March 2011, 10:30
  3. Replies: 1
    Last Post: 18th February 2011, 15:10
  4. Replies: 16
    Last Post: 4th October 2007, 22:04
  5. How to change Path
    By shyam prasad in forum Qt Programming
    Replies: 1
    Last Post: 10th January 2007, 08:29

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.