Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qmake version #8

Open
andrewbernard opened this issue May 8, 2016 · 18 comments
Open

qmake version #8

andrewbernard opened this issue May 8, 2016 · 18 comments

Comments

@andrewbernard
Copy link

Shouldn't this code use qt5 qmake, not qt4 qmake?

@wbsoft
Copy link
Collaborator

wbsoft commented May 8, 2016

Indeed, but on my system I need to specify QT_SELECT=5 qmake, there is only one qmake in /usr/bin.

@fedelibre
Copy link
Member

Perhaps few lines may be added in the INSTALL file?

qtchooser helps to understand the system default:

$ qtchooser -print-env
QT_SELECT="default"
QTTOOLDIR="/usr/lib64/qt4/bin"
QTLIBDIR="/usr/lib64/qt4"

$ qtchooser -l
4-64
4
5-64
5
default

On my system (where default is 4) I use these three commands (sudo must be called separately; the -s allows to stay in the same directory while switching to root):

QT_SELECT=5 python3 setup.py build
sudo -s
QT_SELECT=5 python3 setup.py install

@fedelibre
Copy link
Member

In my system (Fedora24), qmake is not in the path so I had to add it to the bashrc of both the user and root:

PATH=/usr/lib64/qt5/bin/:"${PATH}"

The error message when running the install was:

Failed to determine Qt version ([Errno 2] No such file or directory: 'qmake').

@wbsoft
Copy link
Collaborator

wbsoft commented Jun 26, 2016

You can also use the --qmake-bin option (see python3 setup.py build_ext --help)

@dliessi
Copy link
Contributor

dliessi commented Sep 30, 2016

I'm preparing a Portfile for python-poppler-qt5 for MacPorts.
When running setup.py with the install target, I'm getting the error

Failed to determine Qt version ([Errno 2] No such file or directory: 'qmake').

Here's the full command:

/opt/local/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 setup.py --no-user-cfg install --prefix=/opt/local/Library/Frameworks/Python.framework/Versions/3.5 --root=/opt/local/var/macports/build/_ports-test_python_py-poppler-qt5/py35-poppler-qt5/work/destroot

I also get these three messages in the log:

running install
running build
running build_ext

so it seems that the install target runs also the build and build_ext targets.
I tried adding the argument --qmake-bin=/opt/local/libexec/qt5/bin/qmake as I had to do for the build_ext target, but I (obviously) get the error

error: option --qmake-bin not recognized

Any suggestions?

P.S. When are you planning to release 0.24.3? I had to manually backport #3...

@drydh
Copy link

drydh commented Sep 30, 2016

The install does indeed also do build. To get it to compile in Fink I used the "--skip-build" option in the installation phase. Here's the relevant part of my FinkInfo-file for python-poppler-qt5.

SetCPPFLAGS: -I%p/lib/qt5-mac/include
SetLDFLAGS: -L%p/lib/qt5-mac/lib

CompileScript: <<
#!/bin/sh -ev
 # libpoppler-qt5
 export PKG_CONFIG_PATH=%p/opt/kde4/mac/lib/pkgconfig:$PKG_CONFIG_PATH

 # qt5 (see https://sourceforge.net/p/fink/mailman/message/34631806/)
 export PKG_CONFIG_PATH=%p/lib/qt5-mac/lib/pkgconfig:$PKG_CONFIG_PATH

 QT_PATH=%p/lib/qt5-mac
 QT_LIBS="-F$QT_PATH/lib"
 QT_CPPFLAGS="-F$QT_PATH/lib"
 for fw in QtCore QtGui QtWidgets QtXml ; do
   QT_LIBS="$QT_LIBS -framework $fw"
   QT_CPPFLAGS="$QT_CPPFLAGS -I$QT_PATH/lib/$fw.framework/Headers"
 done
 export LDFLAGS="$LDFLAGS $QT_LIBS"
 export CPPFLAGS="$CPPFLAGS $QT_CPPFLAGS"
 # Fix error (?) in package (or poppler-qt5.pc): include's done via <qt5/poppler-qt5.h> not <poppler-qt5.h> or <poppler/qt5/poppler-qt5.h> etc
 export CPPFLAGS="$CPPFLAGS -I/sw/opt/kde4/mac/include/poppler"

 %p/bin/python%type_raw[python] setup.py build_ext --qmake-bin=$QT_PATH/bin/qmake --pyqt-sip-dir=%p/share/sip-py%type_pkg[python]/pyqt5-mac
<<
InstallScript: <<
 %p/bin/python%type_raw[python] setup.py install --skip-build --root=%d
<<

@drydh
Copy link

drydh commented Sep 30, 2016

Btw, I built against commit 30e02fd. I also vote for releasing 0.24.3.

@dliessi
Copy link
Contributor

dliessi commented Sep 30, 2016

Thanks, with --skip-build I go further, but I still get that error later.
Here's the relevant part of MacPorts' log file:

:debug:destroot Executing command line:  cd "/opt/local/var/macports/build/_ports-test_python_py-poppler-qt5/py35-poppler-qt5/work/python-poppler-qt5-0.24.2" && /opt/local/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 setup.py --no-user-cfg install --skip-build --prefix=/opt/local/Library/Frameworks/Python.framework/Versions/3.5 --root=/opt/local/var/macports/build/_ports-test_python_py-poppler-qt5/py35-poppler-qt5/work/destroot 
:info:destroot running install
:info:destroot running install_lib

[...]

:info:destroot running install_egg_info
:info:destroot running egg_info
:info:destroot creating python_poppler_qt5.egg-info
:info:destroot writing python_poppler_qt5.egg-info/PKG-INFO
:info:destroot writing dependency_links to python_poppler_qt5.egg-info/dependency_links.txt
:info:destroot writing top-level names to python_poppler_qt5.egg-info/top_level.txt
:info:destroot writing manifest file 'python_poppler_qt5.egg-info/SOURCES.txt'
:info:destroot Failed to determine Qt version ([Errno 2] No such file or directory: 'qmake').

Any ideas?

@drydh
Copy link

drydh commented Sep 30, 2016

Not really. I know very little about python packaging. I saw that my install gave:

running install
running install_lib
creating /sw/src/fink.build/root-python-poppler-qt5-py35-0.24.2-1/sw/lib
creating /sw/src/fink.build/root-python-poppler-qt5-py35-0.24.2-1/sw/lib/python3.5
creating /sw/src/fink.build/root-python-poppler-qt5-py35-0.24.2-1/sw/lib/python3.5/site-packages
copying build/lib.macosx-10.10-x86_64-3.5/popplerqt5.cpython-35m-darwin.so -> /sw/src/fink.build/root-python-poppler-qt5-py35-0.24.2-1/sw/lib/python3.5/site-packages
running install_egg_info
Writing /sw/src/fink.build/root-python-poppler-qt5-py35-0.24.2-1/sw/lib/python3.5/site-packages/python_poppler_qt5-0.24.2-py3.5.egg-info

In particular it does not run "egg_info" and my resulting egg-info is a single file (= PKG-INFO). Perhaps this is due to different versions of setuptools. But I wonder where your error message "Failed to determine Qt version" is coming from.

I found that Federico Bruno had a similar/identical problem which was fixed by

QT_SELECT=5 python3 setup.py install

@dliessi
Copy link
Contributor

dliessi commented Sep 30, 2016

Unfortunately setting QT_SELECT=5 does not solve my issue, but I expected it, given the different environments.
The real question is why install is trying to use qmake also with --skip-build.
@wbsoft any ideas?

P.S. Sorry for using this issue instead of opening a new one: @wbsoft if you think it is better I'll open a new issue for my problem.

@dliessi
Copy link
Contributor

dliessi commented Dec 23, 2016

I was finally able to make MacPorts successfully build python-poppler-qt5.
Again, sorry for hijacking this issue.

@s-m-e
Copy link

s-m-e commented Aug 17, 2017

I am running openSUSE Leap 42.2 with both qt4 and 5. Qmake is available in two versions for me: qmake for Qt4 and qmake-qt5 for Qt5. QT_SELECT=5 is not honored when running qmake. Passing --qmake-bin=/usr/bin/qmake-qt5 into the installer is not honored, too. Any suggestions?

@fedelibre
Copy link
Member

What you get from qtchooser -l?

IIRC openSUSE uses rpm, like Fedora. An rpm package exists for Fedora; it's not available yet in openSUSE? I know they are different projects, but maybe this information can help.

$ rpm -q python3-poppler-qt5
python3-poppler-qt5-0.24.2-2.fc26.x86_64

@abdulazeemomer
Copy link

i have this error below:-

[root@localhost PyQt-gpl-5.4]# python3.4 configure.py --qmake /usr/bin/qmake-qt5
Querying qmake about your Qt installation...
Determining the details of your Qt installation...
An internal error occured. Please report all the output from the program,
including the following traceback, to [email protected].
Traceback (most recent call last):
File "configure.py", line 2757, in
main(sys.argv)
File "configure.py", line 2715, in main
target_config.from_introspection(opts.verbose, opts.debug)
File "configure.py", line 697, in from_introspection
self.qt_shared = (lines[1] == 'shared')
IndexError: list index out of range

@fedelibre
Copy link
Member

IIRC openSUSE uses rpm, like Fedora. An rpm package exists for Fedora; it's not available yet in openSUSE?

As far as I can see here, python3-poppler-qt5 has been packaged for OpenSUSE as well.

It's worth saying that people willing to just run Frescobaldi should install python3-poppler-qt5 from their distro repository (best choice) or from the PyPI via pip.

@fedelibre
Copy link
Member

[root@localhost PyQt-gpl-5.4]# python3.4 configure.py --qmake /usr/bin/qmake-qt5

Are you in the wrong directory? Or in the wrong Github page? :-)
There's no configure.py in this project.

@fedelibre
Copy link
Member

It's been a while since I had this issue, but today I managed to build it very quickly by following Wilbert's suggestion above. Here's the command which works on Fedora 28:

python3 setup.py build_ext --qmake-bin /usr/bin/qmake-qt5

@fedelibre
Copy link
Member

fedelibre commented Oct 24, 2018

I am running openSUSE Leap 42.2 with both qt4 and 5. Qmake is available in two versions for me: qmake for Qt4 and qmake-qt5 for Qt5. QT_SELECT=5 is not honored when running qmake. Passing --qmake-bin=/usr/bin/qmake-qt5 into the installer is not honored, too. Any suggestions?

@s-m-e QT_SELECT=5 works for me on Fedora 28.

Premise: you should first add this directory to the PATH in .bashrc, otherwise qmake won't be found:

export PATH=/usr/lib64/qt5/bin/:"${PATH}"

Then:

$ qmake --version
QMake version 2.01a
Using Qt version 4.8.7 in /usr/lib64

$ QT_SELECT=5 qmake --version
QMake version 3.1
Using Qt version 5.11.1 in /usr/lib64

I've recently found out that you can set qt5 permanently using update-alternatives:

$ update-alternatives --list | grep ^qt
qtchooser-5	auto	/etc/xdg/qtchooser/5-64.conf
qtchooser-4	auto	/etc/xdg/qtchooser/4-64.conf
qtchooser-default	auto	/etc/xdg/qtchooser/4.conf

$ sudo update-alternatives --config qtchooser-default
[sudo] password for fede: 

There are 2 programs which provide 'qtchooser-default'.

  Selection    Command
-----------------------------------------------
   1           /etc/xdg/qtchooser/5.conf
*+ 2           /etc/xdg/qtchooser/4.conf

Enter to keep the current selection[+], or type selection number: 1

Now I don't need to use QT_SELECT anymore to let QMake use Qt5:

]$ qmake --version
QMake version 3.1
Using Qt version 5.11.1 in /usr/lib64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants