Bug 180467

Summary: [partial patch] Make devel/py-qt4-core work with python 3
Product: Ports & Packages Reporter: Nathan Whitehorn <nwhitehorn>
Component: Individual Port(s)Assignee: freebsd-kde (Team) <kde>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 190847    
Bug Blocks: 185884    
Attachments:
Description Flags
file.diff
none
Updated Patch none

Description Nathan Whitehorn freebsd_committer 2013-07-11 15:00:00 UTC
To avoid errors compiling .pyc files, the py-qt4-core Makefile unconditionally deletes the uic/port_v3 directory. This unsurprisingly breaks the Python 3 build.

Fix: The attached patch instead picks the appropriate uic port directory instead of always picking the v2 one. Note that the package plist needs updating as well -- my minimal port skills are not good enough for handling plist updates.

Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer 2013-07-11 15:00:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->kde

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Raphael Kubo da Costa freebsd_committer 2014-06-08 13:18:03 UTC
I've started taking a look at it; I've managed to get the plist to work with by passing PYTHON_MAJOR_VER to PLIST_SUB, but I'm currently blocked by PYTHON_PY3K_PLIST_HACK (to take __pycache__/ directories into account if Python>=3.2 is used) not considering @dirrmtry: https://phabric.freebsd.org/D191
Comment 3 Nathan Whitehorn freebsd_committer 2014-06-08 14:52:18 UTC
Created attachment 143530 [details]
Updated Patch

This isn't a solution for the dirrmentry issue, but is in any case an updated version of the patch.
Comment 4 commit-hook freebsd_committer 2014-06-21 14:06:27 UTC
A commit references this bug:

Author: rakuco
Date: Sat Jun 21 14:06:18 UTC 2014
New revision: 358702
URL: http://svnweb.freebsd.org/changeset/ports/358702

Log:
  Build with Python 3 as well.

  Instead of forcefully removing the pyuic/uic/port_v3/ directory, which in
  effect prevents the port from building with Python 3, check for the major
  Python version being used and selectively remove either port_v2/ or
  port_v3/.

  Additionally, set PYTHON_PY3K_PLIST_HACK, since PyQt does not use either
  distutils or setuptools, and Python >= 3.2 store .pyc/.pyo files in a
  different directory.

  PR:		180467
  Submitted by:	nwhitehorn@ (original version)
  MFH:		2014Q2

Changes:
  head/devel/py-qt4-core/Makefile
  head/devel/py-qt4-core/pkg-plist
Comment 5 Raphael Kubo da Costa freebsd_committer 2014-06-21 14:07:07 UTC
This is finally fixed; sorry that it took so long!
Comment 6 commit-hook freebsd_committer 2014-06-21 16:50:39 UTC
A commit references this bug:

Author: rakuco
Date: Sat Jun 21 16:49:55 UTC 2014
New revision: 358718
URL: http://svnweb.freebsd.org/changeset/ports/358718

Log:
  MFH: r358702

  Build with Python 3 as well.

  Instead of forcefully removing the pyuic/uic/port_v3/ directory, which in
  effect prevents the port from building with Python 3, check for the major
  Python version being used and selectively remove either port_v2/ or
  port_v3/.

  Additionally, set PYTHON_PY3K_PLIST_HACK, since PyQt does not use either
  distutils or setuptools, and Python >= 3.2 store .pyc/.pyo files in a
  different directory.

  PR:		180467
  Submitted by:	nwhitehorn@ (original version)

  Approved by:	portmgr (erwin)

Changes:
_U  branches/2014Q2/
  branches/2014Q2/devel/py-qt4-core/Makefile
  branches/2014Q2/devel/py-qt4-core/pkg-plist