Annotation of pkgsrc/lang/python/wheel.mk, revision 1.14

1.14    ! adam        1: # $NetBSD: wheel.mk,v 1.13 2024/01/09 22:48:13 gutteridge Exp $
1.1       nros        2: #
1.10      wiz         3: # Build and install Python wheels
1.1       nros        4: #
1.13      gutterid    5: # Note per PEP-518, the minimum and default requirements to create .whl files
                      6: # are py-setuptools plus py-wheel; however, there are various other possible
                      7: # tools that projects can use. Thus inclusion of this file does not imply these
                      8: # defaults are defined as TOOL_DEPENDS. This must be done in the package Makefile.
                      9: #
1.1       nros       10: # Variables:
1.10      wiz        11: #
1.1       nros       12: # WHEELFILE:           path to the wheelfile to be installed
                     13: #                      only needs to be set if do-build is redefined
                     14: #
1.11      wiz        15: # USE_PYTEST:          If set to yes, depend on py-test and use it for testing.
                     16: #                      Default: yes
                     17: #
1.12      thor       18: # WHEEL_ARGS:          additional arguments to pass during build of the wheel
1.1       nros       19: 
1.10      wiz        20: PY_PATCHPLIST?=        yes
1.14    ! adam       21: PYSETUPSUBDIR?=        # empty
1.1       nros       22: 
1.14    ! adam       23: WHEELFILE?=    ${WRKSRC}/${PYSETUPSUBDIR}/dist/*.whl
1.10      wiz        24: WHEEL_NAME?=   ${DISTNAME:C/-([^0-9])/_\1/g}
                     25: _WHEEL_INFODIR=        ${WHEEL_NAME}.dist-info
                     26: PLIST_SUBST+=  WHEEL_INFODIR=${_WHEEL_INFODIR}
1.12      thor       27: WHEEL_ARGS?=   # empty
1.1       nros       28: 
1.10      wiz        29: PRINT_PLIST_AWK+=      { gsub(/${_WHEEL_INFODIR:S,.,\.,g}/, "$${WHEEL_INFODIR}") }
1.1       nros       30: 
1.10      wiz        31: .if !target(do-build)
1.1       nros       32: TOOL_DEPENDS+= ${PYPKGPREFIX}-build>=0:../../devel/py-build
                     33: do-build:
1.14    ! adam       34:        ${RUN} cd ${WRKSRC}/${PYSETUPSUBDIR} && \
        !            35:        ${SETENV} ${MAKE_ENV} ${TOOL_PYTHONBIN} \
        !            36:                -m build --wheel --skip-dependency-check --no-isolation ${WHEEL_ARGS}
1.1       nros       37: .endif
                     38: 
1.10      wiz        39: .if !target(do-install)
                     40: TOOL_DEPENDS+= ${PYPKGPREFIX}-installer>=0.7.0nb1:../../misc/py-installer
                     41: do-install:
1.14    ! adam       42:        ${RUN} cd ${WRKSRC}/${PYSETUPSUBDIR} && \
        !            43:        ${SETENV} ${INSTALL_ENV} ${TOOL_PYTHONBIN} \
        !            44:                -m installer --destdir ${DESTDIR:Q} --prefix ${PREFIX:Q} ${WHEELFILE}
1.1       nros       45: .endif
                     46: 
1.11      wiz        47: USE_PYTEST?=   yes
                     48: .if !target(do-test) && ${USE_PYTEST:Myes}
                     49: TEST_DEPENDS+= ${PYPKGPREFIX}-test-[0-9]*:../../devel/py-test
                     50: do-test:
1.14    ! adam       51:        ${RUN} cd ${WRKSRC}/${PYSETUPSUBDIR} && \
        !            52:        ${SETENV} ${TEST_ENV} pytest-${PYVERSSUFFIX}
1.11      wiz        53: .endif
                     54: 
1.10      wiz        55: .include "../../lang/python/extension.mk"

CVSweb <webmaster@jp.NetBSD.org>