Daniel Jakots <[email protected]> writes:
> On Mon, 09 May 2016 22:29:36 +0200, Jeremie Courreges-Anglas
> <[email protected]> wrote:
>
>> Daniel Jakots <[email protected]> writes:
>>
>> > Hi,
>> >
>> > Here's a diff to add a py3 flavour to py-jsonschema. Tests are
>> > slightly better than with py2 :)
>> >
>> > Comments ? OK ?
>>
>> nope, you should amend the depends with ${MODPY_FLAVOR}.
>
> Wow, I totally forgot that... thanks
>
>> functools32 is only needed for python2.7.
>
> Yeah, I saw that when I first thought about add the flavor :)
>
> Updated diff
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/py-jsonschema/Makefile,v
> retrieving revision 1.3
> diff -u -p -r1.3 Makefile
> --- Makefile 29 Sep 2015 10:51:54 -0000 1.3
> +++ Makefile 9 May 2016 20:43:29 -0000
> @@ -5,17 +5,19 @@ COMMENT = implementation of JSON Schema
> MODPY_EGG_VERSION = 2.5.1
> DISTNAME = jsonschema-${MODPY_EGG_VERSION}
> PKGNAME = py-${DISTNAME}
> -REVISION = 0
> +REVISION = 1
>
> CATEGORIES = devel
>
> HOMEPAGE = http://github.com/Julian/jsonschema
>
> -BUILD_DEPENDS = devel/py-vcversioner
> -RUN_DEPENDS = devel/py-functools32
> +BUILD_DEPENDS = devel/py-vcversioner${MODPY_FLAVOR}
> +.if !${FLAVOR:Mpython3}
> +RUN_DEPENDS += devel/py-functools32
> +.endif
That doesn't work, you need the conditional after having defined FLAVOR.
> TEST_DEPENDS = ${RUN_DEPENDS} \
> - devel/py-test \
> - devel/py-mock
> + devel/py-test${MODPY_FLAVOR} \
> + devel/py-mock${MODPY_FLAVOR}
Weird indentation.
With that fixed, ok jca@
> # MIT
> PERMIT_PACKAGE_CDROM = Yes
> @@ -24,8 +26,14 @@ MODULES = lang/python
> MODPY_PI = Yes
> MODPY_SETUPTOOLS = Yes
>
> +FLAVORS = python3
> +FLAVOR ?=
> +
> +post-install:
> + mv ${PREFIX}/bin/jsonschema ${PREFIX}/bin/jsonschema${MODPY_BIN_SUFFIX}
> +
> do-test:
> cd ${WRKSRC}/jsonschema && \
> - ${LOCALBASE}/bin/py.test
> + ${LOCALBASE}/bin/py.test${MODPY_BIN_SUFFIX}
>
> .include <bsd.port.mk>
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE