Bug 223409 - devel/py-sip: doesn't honor sip_dir
Summary: devel/py-sip: doesn't honor sip_dir
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-kde (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-03 22:06 UTC by Loïc Bartoletti
Modified: 2019-11-24 08:51 UTC (History)
5 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments
py-sip fix with PyQt5 as default (2.32 KB, patch)
2019-01-10 21:15 UTC, Loïc Bartoletti
no flags Details | Diff
fix sipconfig. Simplest version. (835 bytes, patch)
2019-11-05 19:44 UTC, Loïc Bartoletti
no flags Details | Diff
fix sipconfig. Simplest version. (792 bytes, patch)
2019-11-05 19:56 UTC, Loïc Bartoletti
no flags Details | Diff
fix sipconfig. Simplest version with --sipdir and an explicit variable (1.47 KB, patch)
2019-11-05 20:32 UTC, Loïc Bartoletti
no flags Details | Diff
pass sipdir explicitly (723 bytes, patch)
2019-11-05 22:18 UTC, Max Brazhnikov
no flags Details | Diff
fix sipconfig. Simplest version with --sipdir and an explicit variable (1.48 KB, patch)
2019-11-06 05:16 UTC, Loïc Bartoletti
no flags Details | Diff
final patch PYQT_SIPDIR and ?= in pyqt.mk (913 bytes, patch)
2019-11-21 21:03 UTC, Loïc Bartoletti
lbartoletti: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Loïc Bartoletti freebsd_committer 2017-11-03 22:06:58 UTC
If you install some libs with sip with python 3.6 - PyQt5 for example - sip doesn't honor the default sip dir.

in python3:
import sipconfig
sipconfig.Configuration().default_sip_dir
#/usr/local/share/py36-sip

But files (for example QtXmlmod.sip) are installed in:
/usr/local/share/py-sip
for example /usr/local/share/py-sip/PyQt5/QtXml/QtXmlmod.sip

Thanks.
Comment 1 Tobias C. Berner freebsd_committer 2017-11-04 00:21:33 UTC
https://reviews.freebsd.org/D8714 i prepared a versioned sip directory in that review a while ago. Maybe you can pick the proper parts from it if you have time :) 

Mfg Tobias
Comment 2 Tobias C. Berner freebsd_committer 2018-10-27 18:28:20 UTC

*** This bug has been marked as a duplicate of bug 219641 ***
Comment 3 Loïc Bartoletti freebsd_committer 2019-01-02 04:15:12 UTC
With the new versions of Qt, there is always an error (see qgis bug 233726#c9)


in python3:
import sipconfig
sipconfig.Configuration().default_sip_dir
#/usr/local/share/PyQtsip/3.6/sip
instead of
/usr/local/share/PyQt5/3.6/sip
Comment 4 Tobias C. Berner freebsd_committer 2019-01-02 12:28:24 UTC
(In reply to lbartoletti from comment #3)
The issue here is an error in pyqt.mk: in sip there is no _PYQT_VERSION defined, and therefore the sip-file locations line _SIPDIR_REL are broken.
Comment 5 Loïc Bartoletti freebsd_committer 2019-01-10 21:15:18 UTC
Created attachment 201000 [details]
py-sip fix with PyQt5 as default

Tobias,

This is your patch. I only add a line for reinplace PyQt5 as default (post-install section)

Thanks
Comment 6 Tobias C. Berner freebsd_committer 2019-01-15 21:01:23 UTC
(In reply to lbartoletti from comment #5)
I think something like this should work -- but it will require an exp-run, and some more thinking :)
Comment 7 Loïc Bartoletti freebsd_committer 2019-03-21 19:55:36 UTC
I just tried on a system without Qt4 and unfortunately SIP continues to propose /usr/local/share/PyQt4/3.6/sip as a path if we don't apply the patch
Comment 8 Tobias C. Berner freebsd_committer 2019-03-22 11:17:02 UTC
Yes cleaning up PyQt is the next step.


Mfg Tobias
Comment 9 Loïc Bartoletti freebsd_committer 2019-11-05 19:44:07 UTC
Created attachment 208888 [details]
fix sipconfig. Simplest version.
Comment 10 Loïc Bartoletti freebsd_committer 2019-11-05 19:56:19 UTC
Created attachment 208889 [details]
fix sipconfig. Simplest version.
Comment 11 Loïc Bartoletti freebsd_committer 2019-11-05 20:32:29 UTC
Created attachment 208891 [details]
fix sipconfig. Simplest version with --sipdir and an explicit variable

Tobias, the patch following up our discussion. Thanks
Comment 12 Max Brazhnikov freebsd_committer 2019-11-05 22:18:24 UTC
Created attachment 208894 [details]
pass sipdir explicitly

Considering than sip port has already tied to Qt5, hardcoder sipdir to PyQt5.
With this patch other ports, which rely on getting info from sipconfig may remove their workarounds (I know at least one)
Comment 13 Loïc Bartoletti freebsd_committer 2019-11-06 05:16:56 UTC
Created attachment 208905 [details]
fix sipconfig. Simplest version with --sipdir and an explicit variable

I forgot ${PYTHON_VER} in my previous patch...
Comment 14 Loïc Bartoletti freebsd_committer 2019-11-21 21:03:42 UTC
Created attachment 209329 [details]
final patch PYQT_SIPDIR and ?= in pyqt.mk
Comment 15 commit-hook freebsd_committer 2019-11-24 08:39:39 UTC
A commit references this bug:

Author: tcberner
Date: Sun Nov 24 08:39:31 UTC 2019
New revision: 518302
URL: https://svnweb.freebsd.org/changeset/ports/518302

Log:
  devel/py-sip: doesn't honor sip_dir

  pyqt.mk had a long standing bug, where the sip-dir was not properly set
  for the port devel/py-sip. The underlying issue was the following:

  When using pyqt.mk consumers would specify

  USES=pyqt:<version>

  To also have easy access for the data from pyqt.mk in the py-sip port, we allowed
  version=sip, which only unhides a very limited scope of pyqt.mk. However, we also
  set

  _VERSION_SUBDIR_REL=    PyQt${_PYQT_VERSION}/${PYTHON_VER}

  and used that in

  _SIPDIR_REL=            share/${_VERSION_SUBDIR_REL}/sip
  PYQT_SIPDIR=            ${PREFIX}/${_SIPDIR_REL}

  Therefore, py-sip got a very mangled PYQT_SIPDIR value passed to its configure
  script.

  Big thanks to Lo?c for figuring out the issue :)

  PR:		223409
  Submitted by:	Lo?c Bartoletti <lbartoletti@tuxfamily.org>

Changes:
  head/Mk/Uses/pyqt.mk
  head/devel/py-sip/Makefile
Comment 16 Tobias C. Berner freebsd_committer 2019-11-24 08:51:28 UTC
Committed -- thanks :)