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

1.13    ! gutterid    1: # $NetBSD: wheel.mk,v 1.12 2023/12/07 17:59:17 thor 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.1       nros       21: 
1.10      wiz        22: WHEELFILE?=    ${WRKSRC}/dist/*.whl
                     23: WHEEL_NAME?=   ${DISTNAME:C/-([^0-9])/_\1/g}
                     24: _WHEEL_INFODIR=        ${WHEEL_NAME}.dist-info
                     25: PLIST_SUBST+=  WHEEL_INFODIR=${_WHEEL_INFODIR}
1.12      thor       26: WHEEL_ARGS?=   # empty
1.1       nros       27: 
1.10      wiz        28: PRINT_PLIST_AWK+=      { gsub(/${_WHEEL_INFODIR:S,.,\.,g}/, "$${WHEEL_INFODIR}") }
1.1       nros       29: 
1.10      wiz        30: .if !target(do-build)
1.1       nros       31: TOOL_DEPENDS+= ${PYPKGPREFIX}-build>=0:../../devel/py-build
                     32: do-build:
1.8       riastrad   33:        ${RUN} cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${TOOL_PYTHONBIN} \
1.12      thor       34:                -m build --wheel --skip-dependency-check --no-isolation \
                     35:                ${WHEEL_ARGS}
1.1       nros       36: .endif
                     37: 
1.10      wiz        38: .if !target(do-install)
                     39: TOOL_DEPENDS+= ${PYPKGPREFIX}-installer>=0.7.0nb1:../../misc/py-installer
                     40: do-install:
                     41:        ${RUN} cd ${WRKSRC} && \
                     42:        ${SETENV} ${INSTALL_ENV} \
                     43:        ${TOOL_PYTHONBIN} -m installer --destdir ${DESTDIR:Q} \
                     44:                --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:
                     51:        ${RUN} cd ${WRKSRC} && ${SETENV} ${TEST_ENV} pytest-${PYVERSSUFFIX}
                     52: .endif
                     53: 
1.10      wiz        54: .include "../../lang/python/extension.mk"

CVSweb <webmaster@jp.NetBSD.org>