Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 92484 - qt-4.0.0 puts binaries in /usr/bin
Summary: qt-4.0.0 puts binaries in /usr/bin
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
: 93406 100463 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-13 04:38 UTC by Joël
Modified: 2005-07-27 06:03 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joël 2005-05-13 04:38:17 UTC
I've emerged the QT4 beta2 to experiment with it, and I use QT3 for the Gentoo system and everything else.

QT4's qmake is installed in /usr/bin, so I had to ensure that:
- QTDIR=/usr/qt/3
- /usr/qt/3/bin appears before /usr/bin in $PATH

So when I invoke qmake, the QT3 version is called, and gets the right QTDIR value.

To use QT4, I call kdevelop with:
bash -c "PATH=/usr/bin:$PATH QTDIR=/usr/lib/qt4 kdevelop"

It works well.. but it fails on some ebuilds. For example, libfwbuilder (2.0.6 and 2.0.7):

Running qmake...
Unable to find a Qt configuration.
Unable to find a Qt configuration.
Unable to find a Qt configuration.
Unable to find a Qt configuration.
Unable to find a Qt configuration.
Unable to find a Qt configuration.
Unable to find a Qt configuration.
Unable to find a Qt configuration.
Unable to find a Qt configuration.

!!! Please attach the config.log to your bug report:
!!! /var/tmp/portage/libfwbuilder-2.0.7/work/libfwbuilder-2.0.7/config.log

!!! ERROR: net-libs/libfwbuilder-2.0.7 failed.
!!! Function econf, Line 485, Exitcode 0
!!! econf failed
!!! If you need support, post the topmost build error, NOT this status message.


So, is there a better way to have QT4 installed aside, and let QT3 be used by default when emerging everything ?

Thanks
Comment 1 Carsten Lohrke (RETIRED) gentoo-dev 2005-05-13 07:02:27 UTC
>qt-4.0.0_beta2 qmake in /usr/bin why ?

/usr/qt/ is not a FHS
Comment 2 Carsten Lohrke (RETIRED) gentoo-dev 2005-05-13 07:02:27 UTC
>qt-4.0.0_beta2 qmake in /usr/bin why ?

/usr/qt/ is not a FHS¹ compliant path. 


>So, is there a better way to have QT4 installed aside, and let QT3 be used by default when emerging everything ?

Qt 4 is still hard masked, so fixing this is not urgent. I'm sure Caleb will have a look at it, when he's back from vacation.



[1] http://www.pathname.com/fhs/
Comment 3 Joël 2005-05-16 11:24:00 UTC
Thanks for your response ! The FHS is an interesting read.

Just a temporary solution for those hitting the problem before Caleb comes back:  to emerge fwbuilder, just temporarily rename /usr/bin/qmake to something else.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2005-05-21 01:54:14 UTC
*** Bug 93406 has been marked as a duplicate of this bug. ***
Comment 5 Caleb Tennis (RETIRED) gentoo-dev 2005-05-23 13:17:27 UTC
It's proper to put the binaries into /usr/bin, however, they will indeed 
conflict with Qt3 binaries (in /usr/qt/3/bin) in some instances (like qmake).  
Suggestions are welcome. 
Comment 6 Caleb Tennis (RETIRED) gentoo-dev 2005-05-24 05:56:00 UTC
I might recommend you try out the latest beta2-r2 and see if that doesn't help 
with these problems. 
Comment 7 Joël 2005-05-24 23:40:30 UTC
I tried, but I get this strange result:

/var/tmp/portage/qt-4.0.0_beta2-r2/work/qt-x11-opensource-4.0.0-rc1-snapshot-20050523/bin/moc
-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_CORE_LIB
-DQT_GUI_LIB -DQT_SHARED
-I/var/tmp/portage/qt-4.0.0_beta2-r2/work/qt-x11-opensource-4.0.0-rc1-snapshot-20050523/mkspecs/linux-g++
-I. -I../../../include/QtGui -I../../../include/QtCore -I../../../include
-I.moc/release-shared -I. previewwindow.h -o
.moc/release-shared/moc_previewwindow.cpp
g++ -c -pipe -I/usr/include/mysql -pipe -march=pentium-m -O2 -Wall -W
-D_REENTRANT -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG
-DQT_CORE_LIB -DQT_GUI_LIB -DQT_SHARED
-I/var/tmp/portage/qt-4.0.0_beta2-r2/work/qt-x11-opensource-4.0.0-rc1-snapshot-20050523/mkspecs/linux-g++
-I. -I../../../include/QtGui -I../../../include/QtCore -I../../../include
-I.moc/release-shared -I. -o .obj/release-shared/moc_controllerwindow.o
.moc/release-shared/moc_controllerwindow.cpp
g++ -c -pipe -I/usr/include/mysql -pipe -march=pentium-m -O2 -Wall -W
-D_REENTRANT -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG
-DQT_CORE_LIB -DQT_GUI_LIB -DQT_SHARED
-I/var/tmp/portage/qt-4.0.0_beta2-r2/work/qt-x11-opensource-4.0.0-rc1-snapshot-20050523/mkspecs/linux-g++
-I. -I../../../include/QtGui -I../../../include/QtCore -I../../../include
-I.moc/release-shared -I. -o .obj/release-shared/moc_previewwindow.o
.moc/release-shared/moc_previewwindow.cpp
g++ -Wl,-O1 -Wl,--sort-common -o windowflags
.obj/release-shared/controllerwindow.o .obj/release-shared/previewwindow.o
.obj/release-shared/main.o .obj/release-shared/moc_controllerwindow.o
.obj/release-shared/moc_previewwindow.o   -L/usr/lib/mysql
-L/var/tmp/portage/qt-4.0.0_beta2-r2/work/qt-x11-opensource-4.0.0-rc1-snapshot-20050523/lib
-L/usr/lib/mysql
-L/var/tmp/portage/qt-4.0.0_beta2-r2/work/qt-x11-opensource-4.0.0-rc1-snapshot-20050523/lib
-lQtGui -L/usr/X11R6/lib -lpng -lSM -lICE -lXi -lXrender -lXrandr -lXcursor
-lfreetype -lfontconfig -lXext -lX11 -lm -lQtCore -lz -ldl -lpthread
make[3]: Leaving directory
`/var/tmp/portage/qt-4.0.0_beta2-r2/work/qt-x11-opensource-4.0.0-rc1-snapshot-20050523/examples/widgets/windowflags'
make[2]: Leaving directory
`/var/tmp/portage/qt-4.0.0_beta2-r2/work/qt-x11-opensource-4.0.0-rc1-snapshot-20050523/examples/widgets'
make[1]: Leaving directory
`/var/tmp/portage/qt-4.0.0_beta2-r2/work/qt-x11-opensource-4.0.0-rc1-snapshot-20050523/examples'

!!! ERROR: x11-libs/qt-4.0.0_beta2-r2 failed.
!!! Function src_compile, Line 122, Exitcode 2
!!! (no error message)
!!! If you need support, post the topmost build error, NOT this status message.
Comment 8 Caleb Tennis (RETIRED) gentoo-dev 2005-05-25 05:34:27 UTC
Are you using the examples use flag?  I haven't tested that one in a while. 
Comment 9 Joël 2005-05-25 07:13:46 UTC
Yes, indeed (funny I didn't even think of it)

Trying to re-emerge now :-)
Comment 10 Malte S. Stretz 2005-06-12 17:31:11 UTC
The _rc1 ebuild still puts stuff into /usr/bin:   
(0) otherland image # ls usr/bin/   
assistant  linguist  lupdate  qm2ts  qt3to4    rcc  uic3   
designer   lrelease  moc      qmake  qtconfig  uic   
   
I'm glad I didn't merge it yet, dunno how the rest of the system might react :) 
   
The /usr/qt path is not FHS compliant (and I don't really like it) but I think 
it's currently the only safe way to have both versions on one system.  An 
alternative could be a qt-config script to switch between the versions.  The 
binaries could go to /usr/lib/qt4/bin which might be FHS compliant. 
Comment 11 Caleb Tennis (RETIRED) gentoo-dev 2005-06-12 17:58:06 UTC
I've been running it on a production system lately with no bad side effects.  It
seems that KDE scripts, et al., that rely on qt3 tools find the proper ones as
long as you have QTDIR set correctly.  qmake seems to find the proper files as well.

If the ebuild was changed to install into /usr/qt/4/bin, however, I'm not sure
how would that be different than /usr/bin, assuming that the problematic issues
stem from when the tools are found in the PATH and not via some other means.
Comment 12 Caleb Tennis (RETIRED) gentoo-dev 2005-06-12 18:01:40 UTC
Note: In an early incarnation of the qt4 ebuild I put the binaries into
/usr/lib/qt4/bin, but was told that this isn't a very proper way to do it (not
sure if that was 'Gentoo proper' or 'FHS proper') and to instead put library
realted binaries into /usr/libexec.

Also, the qmake 'Unable to find a Qt configuration.' seems to have disappeared
since _rc1.
Comment 13 Malte S. Stretz 2005-06-13 02:19:16 UTC
Ok, I'll merge the _rc1 and see what breaks :) 
 
About /usr/libexec:  That's a GNU extension damned by the FHS maintainers (the 
one I talked with last preferred /usr/lib/bin).  But I think it's more like a 
question of fancy, like /svc and the GPL itself :) 
Comment 14 Caleb Tennis (RETIRED) gentoo-dev 2005-06-13 05:45:53 UTC
These are the programs that would be affected: 
 
moc 
qmake 
uic 
 
Because all of the others (assistant, designer, etc.) are run manually. 
 
So, I suppose it'll be good to make sure that various build scripts call the 
correct versions of the above programs. 
Comment 15 Caleb Tennis (RETIRED) gentoo-dev 2005-06-13 05:55:06 UTC
qmake for Qt3 defines: 
 
MOC=$QTDIR/bin/moc 
UIC=$QTDIR/bin/uic 
 
Whereas it is defined via .prf files for qmake from Qt4, so it looks like that 
for .pro based projects as long as we call the correct qmake all should be 
okay. 
 
The KDE build scripts seem to find the correct moc and uic programs as well, so 
I think we're safe there. 
 
Now, to make sure that the correct qmake is used... 
Comment 16 Malte S. Stretz 2005-06-13 06:05:21 UTC
I don't have any qmake-based projects to test with, but I think the (qt3) 
examples should be a good testcase. 
 
Actually, the only tools I have issues with are designer et al: 
mss@otherland ~ $ designer 
designer: error while loading shared libraries: libQtDesigner.so.4: cannot open 
shared object file: No such file or directory 
mss@otherland ~ $ LD_LIBRARY_PATH=/usr/lib/qt4 designer 
mss@otherland ~ $ 
 
<http://doc.trolltech.com/4.0/install-x11.html> says: 
For compilers that do not support rpath you must also extended the 
LD_LIBRARY_PATH environment variable to 
include /usr/local/Trolltech/Qt-4.0.0-rc1/lib. On Linux with GCC this step is 
not needed. 
 
Should I open a separate bug for this? 
Comment 17 Caleb Tennis (RETIRED) gentoo-dev 2005-06-13 06:06:46 UTC
Shouldn't have to, you can just do a: 
 
su (enter root password) 
ld-config 
exit 
 
and it should work fine. 
Comment 18 Caleb Tennis (RETIRED) gentoo-dev 2005-06-13 06:07:06 UTC
Make that 'ldconfig' not 'ld-config' 
Comment 19 Malte S. Stretz 2005-06-13 06:16:06 UTC
Already did so, but as /usr/lib/qt4 isn't in /etc/ld.so.conf, it didn't change  
anything.  I could add the dir there but the Qt page suggests that it should 
work automagically without such an entry. 
Comment 20 Caleb Tennis (RETIRED) gentoo-dev 2005-06-13 06:17:46 UTC
Hmm, did you get a /etc/env.d/44qt4 file after emerging? 
 
Now that I think about it, I think I manually created it on my system.   
Comment 21 Malte S. Stretz 2005-06-13 06:35:47 UTC
Nope, the image only contained a /usr.  I had a look at the ebuild, seems like 
the file should be created in the end.  But as there is no directory etc/env.d 
in the image, the cat probably fails. 
 
Maybe the QTSYSCONFDIR should be created, too. 
 
About the trolltech page: I guess the rpath magic is disabled by the 
qt4-rpath.patch?  Just out of interest (and pretty OT), do you have a link to a 
description why this is done and what the rpath does in the first place? 
Comment 22 Caleb Tennis (RETIRED) gentoo-dev 2005-06-13 07:08:29 UTC
It may need to be re-evaluated (perhaps things have been changed since the 
first qt4 preview release). 
 
rpath basically locks in a library location within a binary, so you can tell 
'uic', for example, where the Qt4 libraries are located without it having to 
resort to using the dynamic linker to find them. 
 
The problem is that, with the Gentoo system, it uses the portage temporary 
stuff to lock in.  That is, uic links against /var/tmp/portage/.../libQt.so.  
So, even after installing Qt it is still going to look in /var/tmp/portage for 
that library.  When it doesn't find it there, then it will resort to the 
dynamic linker to find it.  The problem is, this is a security breach, since 
someone could put a malicious libQt.so in /var/tmp/portage and come up with 
crafty ways to exploit the system. 
 
So we just disable rpath all-together since it doesn't work in the intended way 
in the first place. 
Comment 23 Caleb Tennis (RETIRED) gentoo-dev 2005-07-13 20:15:54 UTC
I think that we'll leave it putting the programs in /usr/bin
Comment 24 Jakub Moc (RETIRED) gentoo-dev 2005-07-27 06:03:19 UTC
*** Bug 100463 has been marked as a duplicate of this bug. ***