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

Building 21.1.0 fails with unsupported function return type #43

Closed
heirecka opened this issue Jan 7, 2021 · 15 comments · Fixed by #45
Closed

Building 21.1.0 fails with unsupported function return type #43

heirecka opened this issue Jan 7, 2021 · 15 comments · Fixed by #45

Comments

@heirecka
Copy link

heirecka commented Jan 7, 2021

When I try building python-poppler-qt5-21.1.0 with the following

python3.9 /usr/x86_64-pc-linux-gnu/bin/sip-build --build-dir /var/tmp/paludis/build/dev-python-python-poppler-qt5-21.1.0/work/PYTHON_ABIS/3.9 --no-make --qmake /usr/x86_64-pc-linux-gnu/lib/qt5/bin/qmake --target-dir /usr/x86_64-pc-linux-gnu/lib/python3.9/site-packages --verbose

it fails with

Querying qmake about your Qt installation...
/usr/x86_64-pc-linux-gnu/lib/qt5/bin/qmake -query
These bindings will be built: Poppler-Qt5.
Generating the Poppler-Qt5 bindings...

sip-build: poppler-form.sip:152: ::Poppler::FormFieldChoice::choicesWithExportValues() unsupported function return type - provide %MethodCode and a C++ signature

This is with sip-5.5.0, PyQt5-5.15.2 and poppler-21.01.0.

@marlemion
Copy link

Same here (on Cygwin, python 3.8). V 0.75.0 compiles.

@heirecka
Copy link
Author

I think the culprit is

%If(POPPLER_V0_87_0 -)
   QVector< QPair< QString, QString > > choicesWithExportValues () const;
%End

introduced in 5cc4e52.

I tried something along the lines of

-    QVector< QPair< QString, QString > > choicesWithExportValues () const;
+    typedef QPair<QString, QString> StringPair;
+    QVector<StringPair> choicesWithExportValues () const;

which passes through sip, but gives me an compilation error later on.

@wbsoft
Copy link
Collaborator

wbsoft commented Jan 13, 2021

Probably a definition needs to be added to types.sip, but I'm not sure how exactly.

demmm added a commit to KaOSx/main that referenced this issue Jan 15, 2021
libfprint 1.90.7
live-media 2021.01.14
python3-timezonefinder 5.1.0
xapian-core 1.4.18
python3-poppler-qt 21.1.0, fails to build, known upstream frescobaldi/python-poppler-qt5#43
@andrewbernard
Copy link

Same identical problem here using Arch Linux. Any possibility of a fix? Totally unable to build and use Frescobaldi.

@bnavigator
Copy link
Contributor

I made a fix in #45

@limburgher
Copy link

Applied, new error...
building 'popplerqt5' extension
sip5 -I /usr/share/sip -t POPPLER_V0_87_0 -c build/temp.linux-x86_64-3.9 -b build/temp.linux-x86_64-3.9/poppler-qt5.sbf -I /usr/share/sip/PyQt5 -n PyQt5.sip -t WS_X11 -t Qt_5_15_0 poppler-qt5.sip
usage: sip5 [-h] [-V] [-a FILE] [--abi-version VERSION] [-B TAG] [-c DIR] [-D]
[-e] [-f] [-g] [-I DIR] [-j FILES] [-n NAME] [-o] [-P] [-r]
[-s SUFFIX] [-t TAG] [-w] [-x FEATURE] [-X ID:FILE] [-y FILE]
[FILE]
sip5: error: unrecognized arguments: -b poppler-qt5.sip

@bnavigator
Copy link
Contributor

What is your build call and SIP version? Don't use the deprecated sip5 command but pip or one of the sip- commands directly.

https://www.riverbankcomputing.com/static/Docs/sip/introduction.html#overview

@limburgher
Copy link

I had patched in sip5 specifically; when I took that out, it was fine. Sorry for the noise. :)

@andrewbernard
Copy link

andrewbernard commented Feb 23, 2021 via email

@bnavigator
Copy link
Contributor

bnavigator commented Feb 23, 2021

Several options:

You still have to build it, of course.

@andrewbernard
Copy link

andrewbernard commented Feb 25, 2021 via email

@andrewbernard
Copy link

andrewbernard commented Feb 25, 2021 via email

@heirecka
Copy link
Author

Just to confirm, the patch from #45 makes it build fine again for me.

@bnavigator
Copy link
Contributor

@andrewbernard:

  1. This is not a git support forum
  2. The options I listed are independent. You just need one.

Mind you again. This is all for building python-poppler-qt5 from source. There are no pre-built wheels for you yet.

error: command '/usr/bin/sip' failed with exit code 1

The sip command is old and deprecated. Your distribution ships an old version of SIP v4. Maybe the new data type can not be converted by SIP v4. Get a newer SIP (e.g. pip install sip and use sip-install or pip instead of setup.py)

For this, I know how to clone a repository, but I don't know how to find a pull request and apply it. Can you please give more detailed commands?

Just follow the links. Visit the Github page instead of reading this thread in the mail reader.

Similarly, I don't know how to do this:
Apply https://github.com/frescobaldi/python-poppler-qt5/pull/45.patch to existing sourcecode

This completely independent of git. Also note that the link was wrong initially. I edited the post. Another reason to read the thread on the website.

To build, you need to have all build dependencies, including qmake and the poppler-qt5 headers. (search for -devel or -dev packages in your distribution, eg. libqt5-qtbase-devel andpoppler-qt5-devel)

wget https://files.pythonhosted.org/packages/70/13/264e20336f7951044a8dd49cb1460bd318e2ebacff1753f908e6544ec933/python-poppler-qt5-21.1.0.tar.gz
wget https://github.com/frescobaldi/python-poppler-qt5/pull/45.patch
python3 -m venv popplerbuild
source popplerbuild/bin/activate
tar xf python-poppler-qt5-21.1.0.tar.gz
cd python-poppler-qt5-21.1.0
patch -p1 < ../45.patch
pip install --upgrade pip
# you need qmake in PATH
export PATH=$PATH:/usr/lib64/qt5/bin/
# This builds the wheel, which you can install into any venv or user-site
pip wheel -v .

@wbsoft wbsoft closed this as completed in #45 Mar 4, 2021
@wbsoft
Copy link
Collaborator

wbsoft commented Mar 7, 2021

Thanks for the help! I may need some help with improving the build process and install instructions. Currently I maintain version etc in both setup.py and pyproject.toml, which is a bit cumbersome...

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

Successfully merging a pull request may close this issue.

6 participants