Bug 245799

Summary: math/gnumeric: Allow build with python3
Product: Ports & Packages Reporter: rkoberman
Component: Individual Port(s)Assignee: freebsd-gnome (Nobody) <gnome>
Status: Closed FIXED    
Severity: Affects Some People CC: koobs, thierry
Priority: --- Keywords: needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (gnome)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to allow math/gnumeric to build with python3 as default
none
Updated patch to remove depenency on Python2
rkoberman: maintainer-approval?
Add Python 3 flavor
none
Optionalize Python support none

Description rkoberman 2020-04-21 19:56:43 UTC
Created attachment 213649 [details]
Patch to allow math/gnumeric to build with python3 as default

math/gnumeric has been scheduled for deletion due to the port's requirement for python2, but gnumeric no longer requires python2. The only issue was that the port tried to compile the python plugins that are no longer built when python2 is not found.

The attached patch simply removes the post-install compilation of the non-existent files and updates pkg-plist accordingly. No actual changes to the build are needed or made. If, at some point in the future, the plugins are updated to python3, the post-install compile could be re-implemented.

The patch should be updated to conditionally run post-install on systems where python2 is default. The pkg-plist would need to be fixed and I don't know how to do that.
Comment 1 Thierry Thomas freebsd_committer freebsd_triage 2020-04-28 14:38:43 UTC
Adding koobs: is there a policy about "compile all" with Pyton-3?
Comment 2 rkoberman 2020-04-29 05:26:28 UTC
(In reply to Thierry Thomas from comment #1)
I have looked more closely and there is no benefit to running compileall in gnumeric. Since the only files compiled are the plugins that are not built with python3, it simply should be removed when PYTHON_DEFAULT < 3.

Trivial to do this. I have not figured out the magic to get the pkg-plist right, but I have spent little time on it as we moved today and have been busy getting ready (and now, getting back to "normal"). I will try a couple of htings as soon as I have a bit of time, but it is probably trivial for a lot of porters.
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2020-04-30 02:14:17 UTC
(In reply to Thierry Thomas from comment #1)

Just that it should be:

- A standard and deterministic invocation (see other ports uses)
- The all files (pyo, pyc*, etc) are created (invocation args affect this)
- That all files from that invocation are added to the pkg-plist
Comment 4 rkoberman 2020-05-02 03:00:31 UTC
Just to be clear, when PYTHON_DEFAULT is 3.x, there are no python plugins installed. If you attempt to run compileall-py, it will fail and the the port will not be installed. If PYTHON_DEFAULT is 2.7, compileall.py will compile the three plugins and they will be installed.

So running the post-install section should only be run for and the compiled files should only be added to the packing list for python-2.7.
Comment 5 rkoberman 2020-06-16 17:04:33 UTC
Created attachment 215625 [details]
Updated patch to remove depenency on Python2

This one seems to be going nowhere. Let's just stop supporting Python2 and move on. This patch updated gnumeric to Python3 only. It builds are upstream recommends, without the plugins that require Python2. Upstream says that the plugins may be re-introduced when/if they are fixed, but it does not sound likely any time soon.

Python2 is dead. Lat's move on.
Comment 6 Jan Beich freebsd_committer freebsd_triage 2020-06-16 20:31:46 UTC
Created attachment 215635 [details]
Add Python 3 flavor

Why not expose Python 3 support as a separate non-default flavor (a la ports r538844)?

Disclaimer: I've never used this port.
Comment 7 Jan Beich freebsd_committer freebsd_triage 2020-06-16 20:33:05 UTC
Created attachment 215636 [details]
Optionalize Python support

Or make Python loader/plugins optional, disabled by default unless DEFAULT_VERSIONS += python=2.7
Comment 8 rkoberman 2020-06-17 00:49:40 UTC
(In reply to Jan Beich from comment #6)
Python is NOT optional for this port. While the plugins are not Python3 compatible, the port itself also uses Python and all of those files already support Python3. 

I really think that it is silly to maintain the ability to use Python2. Very few ports require it and some simply don't support it any longer. It seems unlikely that anyone using Gnumeric, an Excel like spreadsheet, will not already have Python3 installed.
Comment 9 rkoberman 2020-09-16 03:35:27 UTC
Thanks, Tobias!