%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib64/python3.7/site-packages/cffi/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/cffi/__pycache__/pkgconfig.cpython-37.pyc

B

ل=^�@sHddlZddlZddlZddlmZdd�Ze��fdd�Zdd	�ZdS)
�N�)�PkgConfigErrorcCsnxh|��D]\\}}||kr$|||<q
t||t�s@td|f��t|t�sXtd|f��||�|�q
W|S)z�Merge values from cffi config flags cfg2 to cf1

    Example:
        merge_flags({"libraries": ["one"]}, {"libraries": ["two"]})
        {"libraries": ["one", "two"]}
    z$cfg1[%r] should be a list of stringsz$cfg2[%r] should be a list of strings)�items�
isinstance�list�	TypeError�extend)Zcfg1Zcfg2�key�value�r�A/opt/alt/python37/lib64/python3.7/site-packages/cffi/pkgconfig.py�merge_flagss

r
c
Cs2ddg}|�|�|�|�ytj|tjtjd�}Wn8tk
rl}ztdt|���f��Wdd}~XYnX|��\}}|j	dkr�y|�
|�}Wntk
r�YnXt|����tj
dk�rt|t��sy|�
|�}Wn*tk
�rtd||||f��YnXtjd	k�r.d	|k�r.td
|||f��|S)z5Calls pkg-config and returns the output if found
    z
pkg-configz--print-errors)�stdout�stderrzcannot run pkg-config: %sNr)�zKpkg-config %s %s returned bytes that cannot be decoded with encoding %r:
%r�\zEpkg-config %s %s returned an unsupported backslash-escaped output:
%r)�append�
subprocess�Popen�PIPE�EnvironmentErrorr�str�stripZcommunicate�
returncode�decode�	Exception�sys�version_infor�UnicodeDecodeError�os�altsep)�libname�flag�encoding�aZpc�eZboutZberrrrr�calls0

(
r&csndd��dd��dd��dd��d	d
��dd��������fd
d�}i}x|D]}||�}t||�qPW|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.
    cSsdd�|��D�S)NcSs"g|]}|�d�r|dd��qS)z-I�N)�
startswith)�.0�xrrr�
<listcomp>LszBflags_from_pkgconfig.<locals>.get_include_dirs.<locals>.<listcomp>)�split)�stringrrr�get_include_dirsKsz.flags_from_pkgconfig.<locals>.get_include_dirscSsdd�|��D�S)NcSs"g|]}|�d�r|dd��qS)z-Lr'N)r()r)r*rrrr+OszBflags_from_pkgconfig.<locals>.get_library_dirs.<locals>.<listcomp>)r,)r-rrr�get_library_dirsNsz.flags_from_pkgconfig.<locals>.get_library_dirscSsdd�|��D�S)NcSs"g|]}|�d�r|dd��qS)z-lr'N)r()r)r*rrrr+Rsz?flags_from_pkgconfig.<locals>.get_libraries.<locals>.<listcomp>)r,)r-rrr�
get_librariesQsz+flags_from_pkgconfig.<locals>.get_librariescsdd���fdd�|��D�S)NcSs0|dd�}d|kr$t|�dd��S|dfSdS)Nr'�=r)�tupler,)r*rrr�_macroVsz8flags_from_pkgconfig.<locals>.get_macros.<locals>._macrocsg|]}|�d�r�|��qS)z-D)r()r)r*)r3rrr+\sz<flags_from_pkgconfig.<locals>.get_macros.<locals>.<listcomp>)r,)r-r)r3r�
get_macrosUsz(flags_from_pkgconfig.<locals>.get_macroscSsdd�|��D�S)NcSs$g|]}|�d�s|�d�s|�qS)z-Iz-D)r()r)r*rrrr+_szBflags_from_pkgconfig.<locals>.get_other_cflags.<locals>.<listcomp>)r,)r-rrr�get_other_cflags^sz.flags_from_pkgconfig.<locals>.get_other_cflagscSsdd�|��D�S)NcSs$g|]}|�d�s|�d�s|�qS)z-Lz-l)r()r)r*rrrr+csz@flags_from_pkgconfig.<locals>.get_other_libs.<locals>.<listcomp>)r,)r-rrr�get_other_libsbsz,flags_from_pkgconfig.<locals>.get_other_libscsFt��}t|d�}t|d�}�|��|��|��|��|��|�d�S)Nz--cflagsz--libs)Zinclude_dirsZlibrary_dirsZ	librariesZ
define_macrosZextra_compile_argsZextra_link_args)r�getfilesystemencodingr&)r!ZfseZ
all_cflagsZall_libs)r.r0r/r4r5r6rr�kwargsgs

z$flags_from_pkgconfig.<locals>.kwargs)r
)Zlibsr8Zretr!Z	lib_flagsr)r.r0r/r4r5r6r�flags_from_pkgconfig<s	
r9)	rrr�errorrr
r7r&r9rrrr�<module>s"

Zerion Mini Shell 1.0