Bug 205859 - x11/xcb-proto: Fix build failure with Python 3
Summary: x11/xcb-proto: Fix build failure with Python 3
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ruslan Makhmatkhanov
Keywords: patch, patch-ready
: 206004 (view as bug list)
Depends on:
Reported: 2016-01-04 03:33 UTC by VK
Modified: 2016-03-07 12:59 UTC (History)
7 users (show)

See Also:
bugzilla: maintainer-feedback? (x11)
koobs: merge-quarterly-

Make xcb-proto build against python 3.5, 3.4 and 2.7 (3.92 KB, patch)
2016-01-04 03:33 UTC, VK
no flags Details | Diff
xcb-proto.patch (3.12 KB, patch)
2016-01-04 06:05 UTC, Shane
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description VK freebsd_triage 2016-01-04 03:33:32 UTC
Created attachment 165028 [details]
Make xcb-proto build against python 3.5, 3.4 and 2.7

In an attempt to build ALL packages that use Python (anything with "python*" in USES, except "py3-*" ports and those marked for python2(.7)) against Python 3.5 exclusively (via DEFAULT_VERSIONS), so we can see what's broken and how, one big blocker was x11/xcb-proto holding down 1000+ packages that were skipped by Poudriere because it wouldn't build (plist issues with __pycache__ files).

This patch makes sure it builds and installs against 3.5 and 3.4, and also tested against default (no DEFAULT_VERSIONS forced) 2.7. While at it, I added the license (which I believe is MIT, looking at the distfile's COPYING file) to keep portlint quiet.

However, since I'm still a total noob in porting, this needs testing and feedback!

Portlint: OK (except warning about Comment)
  - 10.2 (amd64) OK w/ Python 3.5
  - 10.2 (amd64) OK w/ Python 3.4
  - 10.2 (amd64) OK w/ Python 2.7
Comment 1 VK freebsd_triage 2016-01-04 03:37:04 UTC
BTW, I _am_ aware that the general idea is to drop .pyc and .pyo from plists in favor of autoplist and/or whatever other post-install mechanism. But until then, my proposed solution is this.
Comment 2 Brendan Molloy 2016-01-04 03:44:41 UTC
(In reply to Vladimir Krstulja from comment #0)

The license is the MIT X11 license to be specific.
Comment 3 Shane 2016-01-04 06:05:35 UTC
Created attachment 165033 [details]

While I made the same changes to first get xcb-proto building, the ports system appears to have been updated to handle py3.5. That leads to a cleaner way being to remove the python version tests and PLIST_SUB commenting and replace them with USE_PYTHON= py3kplist

Don't expect autoplist to work as xcb-proto uses it's own makefile not pythons distutils.

The other change we should be making is to add PKGNAMEPREFIX to allow the xcb-proto pymodule to be installed in multiple versions. This leaves the xml files in share/xcb and the pkgconfig file. I expect moving these will break any dependencies using these files though. I wonder if this should become two ports, one for the xml files and one for the python module.

Brendan - X11/Xorg is covered by the MIT license - using LICENSE=MIT gives the description "MIT license / X11 license" from Mk/bsd.licenses.db.mk
Comment 4 Brendan Molloy 2016-01-04 06:55:35 UTC
(In reply to FreeBSD from comment #3)

I didn't realise this was the use case for `USE_PYTHON= py3kplist`. Awesome!

Also yes, I was aware that MIT is the X11 license as per the database as well; was just making it clear to anyone who might ask "but Expat?!" :)
Comment 5 VK freebsd_triage 2016-01-04 10:29:51 UTC
Comment on attachment 165028 [details]
Make xcb-proto build against python 3.5, 3.4 and 2.7

Great, exactly the feedback I wanted!

The latest patch, from comment #3, works, xcb-proto builds across the board with Poudriere: 10.2 and 9.3, with Python 3.5, 3.4 and 2.7. Tested amd64 only.
Comment 6 Antoine Brodin freebsd_committer 2016-01-04 10:46:37 UTC
There's already an exp-run and a review by sunpoet in phabric for fixing this, please coordinate with him.

review D4758

bug #205807
Comment 7 VK freebsd_triage 2016-01-07 12:49:54 UTC
*** Bug 206004 has been marked as a duplicate of this bug. ***
Comment 8 VK freebsd_triage 2016-01-07 14:39:32 UTC
(In reply to Antoine Brodin from comment #6)

Question, is this strictly related to bug #205807 and its solution? My patch is using py3kplist as suggested in comment #3, meaning it works with the current state of ports head.
Comment 9 clutton 2016-01-07 22:20:52 UTC
(In reply to Vladimir Krstulja from comment #8)

Short - no. You are good to go with or without this patch.

py3kplist makes pkg-plist transparent conversion to python3 style and patch just adds some variables which needs for those who create ports starting with python3 version instead of using py3kplist.
Comment 10 commit-hook freebsd_committer 2016-03-06 21:58:05 UTC
A commit references this bug:

Author: rm
Date: Sun Mar  6 21:57:11 UTC 2016
New revision: 410487
URL: https://svnweb.freebsd.org/changeset/ports/410487

  x11/xcb-proto: fix packaging with python3.5

  Utilize py3kplist to fix packaging with python 3.5 and to simplify Makefile.
  Add LICENSE (MIT) and bump PORTREVISION for package changes.
  Add NO_ARCH, while here.

  PR:		205859
  Submitted by:	Vladimir Krstulja <vlad-fbsd@acheronmedia.com>
  Submitted by:   FreeBSD@ShaneWare.Biz (py3kplist suggestion)
  Approved by:	maintainer timeout

Comment 11 Ruslan Makhmatkhanov freebsd_committer 2016-03-06 21:58:30 UTC
Committed, thank you!
Comment 12 Kubilay Kocak freebsd_committer freebsd_triage 2016-03-07 05:44:42 UTC
Assign to committer that resolved.

@Ruslan, if this is reproducible in quarterly it should be MFH'd
Comment 13 Ruslan Makhmatkhanov freebsd_committer 2016-03-07 07:32:39 UTC
It wasn't requested by submitter and it can't be reproduced in default environment, so I'd leave it as is in 2016Q1.