AlkantarClanX12

Your IP : 3.15.14.245


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/cffi/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/cffi/__pycache__/pkgconfig.cpython-311.pyc

�

�܋f��Z�ddlZddlZddlZddlmZd�Zej��fd�Zd�ZdS)�N�)�PkgConfigErrorc�0�|���D]�\}}||vr|||<�t||t��std|�d����t|t��std|�d����||�|����|S)z�Merge values from cffi config flags cfg2 to cf1

    Example:
        merge_flags({"libraries": ["one"]}, {"libraries": ["two"]})
        {"libraries": ["one", "two"]}
    zcfg1[z] should be a list of stringszcfg2[)�items�
isinstance�list�	TypeError�extend)�cfg1�cfg2�key�values    �a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/cffi/pkgconfig.py�merge_flagsrs����j�j�l�l�$�$�
��U��d�?�?��D��I�I��d�3�i��.�.�
Q��i�#�#�#� O�P�P�P��e�T�*�*�
Q��i�#�#�#� O�P�P�P���I���U�#�#�#�#��K�c�8�ddg}|�|��|�|��	tj|tjtj���}nC#t$r6}tdt
|����������d}~wwxYw|���\}}|j	dkrH	|�
|��}n#t$rYnwxYwt|������tj
dkrUt|t��s@	|�
|��}n)#t$rtd|�d	|�d
|�d|�����wxYwt jdkrd|vrtd|�d	|�d
|�����|S)z5Calls pkg-config and returns the output if found
    z
pkg-configz--print-errors)�stdout�stderrzcannot run pkg-config: Nr)�zpkg-config � z5 returned bytes that cannot be decoded with encoding z:
�\z3 returned an unsupported backslash-escaped output:
)�append�
subprocess�Popen�PIPE�EnvironmentErrorr�str�strip�communicate�
returncode�decode�	Exception�sys�version_infor�UnicodeDecodeError�os�altsep)�libname�flag�encoding�a�pc�e�bout�berrs        r�callr0s���
�'�(�A��H�H�T�N�N�N��H�H�W����N�
�
�a�
��
��
P�
P�
P�����N�N�N��n�C��F�F�L�L�N�N�N�L�M�M�M�����N�������!�!�J�D�$�	�}����	��;�;�x�(�(�D�D���	�	�	��D�	�����T�Z�Z�\�\�*�*�*�
��4���
�4��(=�(=��	B��;�;�x�(�(�D�D��!�	B�	B�	B� �.�"&�$�$�������4�4�"A�B�B�
B�	B����

�y�D���T�T�\�\��n�"�d�d�G�G�G�T�T�3�4�4�	4��Ks5�+A�
B�&1B�B�C�
C%�$C%�/E�&E+c������	�
�d��d��d��d��d��	d��
�����	�
fd�}i}|D]}||��}t||���|S)a�Return compiler line flags for FFI.set_source based on pkg-config output

    Usage
        ...
        ffibuilder.set_source("_foo", pkgconfig = ["libfoo", "libbar >= 1.8.3"])

    If pkg-config is installed on build machine, then arguments include_dirs,
    library_dirs, libraries, define_macros, extra_compile_args and
    extra_link_args are extended with an output of pkg-config for libfoo and
    libbar.

    Raises PkgConfigError in case the pkg-config call fails.
    c�>�d�|���D��S)Nc�L�g|]!}|�d���|dd���"S)�-I�N��
startswith��.0�xs  r�
<listcomp>zBflags_from_pkgconfig.<locals>.get_include_dirs.<locals>.<listcomp>L�1��D�D�D�!����d�1C�1C�D��!�"�"��D�D�Dr��split��strings r�get_include_dirsz.flags_from_pkgconfig.<locals>.get_include_dirsK���D�D�v�|�|�~�~�D�D�D�Drc�>�d�|���D��S)Nc�L�g|]!}|�d���|dd���"S)�-Lr5Nr6r8s  rr;zBflags_from_pkgconfig.<locals>.get_library_dirs.<locals>.<listcomp>Or<rr=r?s r�get_library_dirsz.flags_from_pkgconfig.<locals>.get_library_dirsNrBrc�>�d�|���D��S)Nc�L�g|]!}|�d���|dd���"S)�-lr5Nr6r8s  rr;z?flags_from_pkgconfig.<locals>.get_libraries.<locals>.<listcomp>Rr<rr=r?s r�
get_librariesz+flags_from_pkgconfig.<locals>.get_librariesQrBrc�J��d���fd�|���D��S)Nc�l�|dd�}d|vr#t|�dd����S|dfS)Nr5�=r)�tupler>)r:s r�_macroz8flags_from_pkgconfig.<locals>.get_macros.<locals>._macroVs<���!�"�"��A��a�x�x��Q�W�W�S�!�_�_�-�-�-��4�y� rc�P��g|]"}|�d����|����#S)�-Dr6)r9r:rOs  �rr;z<flags_from_pkgconfig.<locals>.get_macros.<locals>.<listcomp>\s2���H�H�H�a�Q�\�\�$�5G�5G�H���q�	�	�H�H�Hrr=)r@rOs @r�
get_macrosz(flags_from_pkgconfig.<locals>.get_macrosUs7���	!�	!�	!�I�H�H�H�6�<�<�>�>�H�H�H�Hrc�>�d�|���D��S)Nc�f�g|].}|�d���|�d���,|��/S)r4rQr6r8s  rr;zBflags_from_pkgconfig.<locals>.get_other_cflags.<locals>.<listcomp>_�S��E�E�E�a����d�1C�1C�E�12���d�1C�1C�E��E�E�Err=r?s r�get_other_cflagsz.flags_from_pkgconfig.<locals>.get_other_cflags^�0��E�E�6�<�<�>�>�E�E�E�	Erc�>�d�|���D��S)Nc�f�g|].}|�d���|�d���,|��/S)rErIr6r8s  rr;z@flags_from_pkgconfig.<locals>.get_other_libs.<locals>.<listcomp>crUrr=r?s r�get_other_libsz,flags_from_pkgconfig.<locals>.get_other_libsbrWrc����tj��}t|d��}t|d��}�|���|���|���|���|���	|��d�S)Nz--cflagsz--libs)�include_dirs�library_dirs�	libraries�
define_macros�extra_compile_args�extra_link_args)r#�getfilesystemencodingr0)
r(�fse�
all_cflags�all_libsrArJrFrRrVrZs
    ������r�kwargsz$flags_from_pkgconfig.<locals>.kwargsgs�����'�)�)���'�:�.�.�
����*�*��,�,�Z�8�8�,�,�X�6�6�&��x�0�0�'�Z�
�3�3�"2�"2�:�">�">�-�~�h�7�7�
��	r)r)�libsrf�retr(�	lib_flagsrArJrFrRrVrZs     @@@@@@r�flags_from_pkgconfigrj<s���������E�E�E�E�E�E�E�E�E�I�I�I�E�E�E�E�E�E�
����������
�C��$�$���F�7�O�O�	��C��#�#�#�#��Jr)	r#r&r�errorrrrbr0rj�rr�<module>rms���������������!�!�!�!�!�!����&";��!:�!<�!<�����D=�=�=�=�=r