Page MenuHomeFreeBSD

new port devel/py-pymtbl
ClosedPublic

Authored by truckman on Apr 3 2015, 11:36 PM.
Tags
None
Referenced Files
F106366548: D2220.diff
Sun, Dec 29, 11:16 AM
Unknown Object (File)
Nov 5 2024, 6:26 AM
Unknown Object (File)
Oct 2 2024, 6:04 AM
Unknown Object (File)
Sep 29 2024, 9:16 PM
Unknown Object (File)
Sep 29 2024, 1:03 PM
Unknown Object (File)
Sep 28 2024, 2:09 AM
Unknown Object (File)
Sep 28 2024, 2:05 AM
Unknown Object (File)
Sep 27 2024, 2:14 PM
Subscribers
None

Details

Reviewers
mat
Summary

pymtbl: Python bindings for the mtbl sorted string table library

pymtbl provides a simple Pythonic wrapper for mtbl's reader, writer,
sorter, and merger interfaces. The examples/ directory contains
scripts demonstrating each of these interfaces. The following
transcript shows the basic reader and writer interfaces:

Test Plan

Fetch distfile from both MASTER_SITES.

Build on FreeBSD 8.4, 9.3, 10.1, and 11.0-CURRENT, i386 and amd64.

Build with EXAMPLES option on and off.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

truckman retitled this revision from to new port devel/py-pymtbl.
truckman updated this object.
truckman edited the test plan for this revision. (Show Details)
truckman added a reviewer: mat.
mat requested changes to this revision.Apr 4 2015, 8:42 AM
mat edited edge metadata.
mat added inline comments.
devel/py-pymtbl/Makefile
28–35

As there are not a lot of examples, and installing them, or not, won't slow things down, our policy is to always install them, it saves including port.options and having to parse bsd.port.mk a second time:

post-install:
 ${STRIP_CMD} ${STAGEDIR}/${PREFIX}/lib/python2.7/site-packages/mtbl.so
 ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
 (cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})

The files will be added, or not, to the package depending on wether the EXAMPLES option is enabled, or not.

Also, you could add:

PORTEXAMPLES=   *

to the Makefile and not add a plist at all.

This revision now requires changes to proceed.Apr 4 2015, 8:42 AM

Once this port is settled, I need to go back and add examples to net/py-pynmsg. I didnt' notice that it included examples because they were not mentioned in the README for the port.

devel/py-pymtbl/Makefile
26

lang/python is only needed if someone wants to run the examples out of the box. Should I turn this into an unconditional RUN_DEPENDS, or should I add a pkg-message, or ...?

28–35

I thought of a contrived case where it would be nice to have the option of not installing examples. We now support having multiple versions of python installed concurrently. In theory someone might want to install python2 and python3 versions of this port, though I don't know how pkg would feel about having two packages with the same origin. Other than examples, the two installations would not collide because, the package names have different prefixes, the main part of the port is installed under ${PREFIX}/lib/pythonX.Y/site-packages, and the license info is installed under ${PREFIX}/share/licenses/packagename. Only ${EXAMPLESDIR} would collide, which pkg would detect.

I was on the fence about PORTEXAMPLES=*

devel/py-pymtbl/Makefile
26

Mmmm, I missed this, in any case, the correct way to depend on python is:

EXAMPLES_USES=python:run

But I don't think it is necessary, it's python's only needed for examples, you should not add it to the dependency. You could add a pkg-message saying one will need python to use them.

28–35

Pkg doesn't care about origins any more, only PKGBASE, so, you could install both at the same time, but I'm not sure we support it.

Mmmm, there have been talks about adding PKGNAMEPREFIX/PKGNAMESUFFIX to EXAMPLESDIR/DOCSDIR, though it has not been through.

You could set:

EXAMPLESDIR=       ${PREFIX}/share/examples/${PKGNAMEPREFIX}${PORTNAME}
devel/py-pymtbl/Makefile
28–35

Belay that, you want to use:

USES=uniquefiles:dirs
truckman edited edge metadata.

Install examples unconditionally.

Replace conditional RUN_DEPENDS=lang/python with pkg-message.

Make examples installation directory unique to accomodate multiple
python versions.

Use PORTEXAMPLES=* instead of pkg-plist.

truckman edited edge metadata.

pkgconfig is not needed.

Use ${PYTHON_SITELIBDIR} instead of hardwiring a specific python
version.

devel/py-pymtbl/pkg-message
1

Now that I think about it, one more time, this port already USES=python, so, while not depending on lang/python itself, it brings lang/python2 or lang/python3 depending on the default.

You should add something like this:

USES=shebangfix
python_CMD=${PYTHON_CMD}
SHEBANG_FILES= examples/*.py # or whatever works to get all the examples python files to be matched, note that it works in WRKSRC, not STAGEDIR

And maybe tweak python_OLD_CMD (default to /usr/bin/python) to match whatever shebang is present.

Because now that you support having both py27- and py34- versions of the port, with examples, installed, you need the examples to run the right python.

Process examples with SHEBANGFIX instead of suggesting the
installation of lang/python.

mat edited edge metadata.

It seems I can't find anything new for you to fix :-)

This revision is now accepted and ready to land.Apr 5 2015, 8:06 PM

Closed by commit rP383360 (authored by @truckman).

devel/py-pymtbl/pkg-message
1

I tried that initially and found that it wasn't doing anything. After digging into Uses/shebangfix, I figured out that I needed to set python_OLD_CMD because the example scripts start with:

#!/usr/bin/env python

At that point, I decided it was easier to use to add the RUN_DEPENDS.