• alpine-mips-patches's avatar
    main/libcap-ng: fix cross-compiling without python pre-installed · 8019ca96
    alpine-mips-patches authored
    This aport have no intention to package python bindings so:
     - tell ./configure explicitly there is no 'swig';
     - tell ./configure explicitly neither python nor python3 is needed
       (this effectively avoids fatal AM_PATH_PYTHON invocation);
     - replace makedepends= with empty makedepends_build= for symmetry
       with makedepends_host=.
    
    Rationale follows.
    
    If neither python nor python3 is pre-installed in the build system,
    cross-compilation fails:
    
    checking for swig... no
    configure: WARNING: "Swig not found - python bindings will not be made"
    checking whether to create python bindings... testing
    checking for python... no
    checking for python2... no
    checking for python3... no
    checking for python3.5... no
    checking for python3.4... no
    checking for python3.3... no
    checking for python3.2... no
    checking for python3.1... no
    checking for python3.0... no
    checking for python2.7... no
    checking for python2.6... no
    checking for python2.5... no
    checking for python2.4... no
    checking for python2.3... no
    checking for python2.2... no
    checking for python2.1... no
    checking for python2.0... no
    configure: error: no suitable Python interpreter found
    >>> ERROR: libcap-ng: build failed
    
    This error is printed by AM_PATH_PYTHON at ./configure.ac:125 which
    assumes lack of python is fatal when invoked without the third arg.
    
    Also note the swig warning.
    
    After replacing 'makedepends="python3 $depends_dev"' at APKBUILD:10
    with 'makedepends_build="python3"', cross-configure succeeds saying
    python is of no use anyway:
    
    checking whether to create python bindings... testing
    checking for python... no
    checking for python2... no
    checking for python3... /usr/bin/python3
    checking for python version... 3.6
    checking for python platform... linux
    checking for python script directory... ${prefix}/lib/python3.6/site-packages
    checking for python extension module directory... ${exec_prefix}/lib/python3.6/site-packages
    configure: WARNING: "Python headers not found - python bindings will not be made"
    checking whether to create python3 bindings... investigating
    checking for python3-config... no
    sh: yes: unknown operand
    Python3 bindings will NOT be built
    8019ca96
APKBUILD 1.29 KB