+
    i                     `    ^ RI t ^ RIt^ RIt^RIHt R t] P                  ! 4       3R ltR tR# )    N)PkgConfigErrorc                "   VP                  4        Fz  w  r#W 9  d   W0V&   K  \        W,          \        4      '       g   \        RV: R24      h\        V\        4      '       g   \        RV: R24      hW,          P	                  V4       K|  	  V # )zMerge values from cffi config flags cfg2 to cf1

Example:
    merge_flags({"libraries": ["one"]}, {"libraries": ["two"]})
    {"libraries": ["one", "two"]}
zcfg1[z] should be a list of stringszcfg2[)items
isinstancelist	TypeErrorextend)cfg1cfg2keyvalues   &&  U/home/wkmabra/.openclaw/workspace/venv/lib/python3.14/site-packages/cffi/pkgconfig.pymerge_flagsr      sq     jjl
?Idi..# OPPeT**# OPPIU# # K    c                "   RR.pVP                  V4       VP                  V 4        \        P                  ! V\        P                  \        P                  R7      pTP                  4       w  rgTP                  ^ 8w  d,    TP                  T4      p\        TP                  4       4      h\        P                  R8  d)   \        T\        4      '       g    TP                  T4      p\         P"                  R
8w  d   R
T9   d   \        RT: RT : RT: 24      hT#   \         d,   p\        R\        T4      P                  4       : 24      hRp?ii ; i  \         d     Li ; i  \         d    \        RT: RT : RT: R	T: 24      hi ; i)z5Calls pkg-config and returns the output if found
    z
pkg-configz--print-errors)stdoutstderrzcannot run pkg-config: Nzpkg-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   callr/      s[    
'(AHHTNHHWNa

P !JD	}}	;;x(D TZZ\**
4
4(=(=	B;;x(D 
yyDTT\"GT3 4 	4 K/  NCFLLNLMMN  		 " 	B "&4"A B B	Bs5   5D E E' E(&EEE$#E$''Fc                   aaaaa	a
 R oR oR oR oR o	R o
VVVVV	V
3R lp/ pV  F  pV! V4      p\        W$4       K  	  V# )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                     V P                  4        Uu. uF$  qP                  R 4      '       g   K  VR,          NK&  	  up# u upi )-I   NNsplit
startswithstringxs   & r   get_include_dirs.flags_from_pkgconfig.<locals>.get_include_dirsK   1    %||~D~!d1C"~DDD
   A A c                     V P                  4        Uu. uF$  qP                  R 4      '       g   K  VR,          NK&  	  up# u upi )-Lr3   r5   r8   s   & r   get_library_dirs.flags_from_pkgconfig.<locals>.get_library_dirsN   r=   r>   c                     V P                  4        Uu. uF$  qP                  R 4      '       g   K  VR,          NK&  	  up# u upi )-lr3   r5   r8   s   & r   get_libraries+flags_from_pkgconfig.<locals>.get_librariesQ   r=   r>   c                     R  pV P                  4        Uu. uF#  q"P                  R4      '       g   K  V! V4      NK%  	  up# u upi )c                 `    V R ,          p RV 9   d   \        V P                  R^4      4      # V R3# )r3   =N)tupler6   )r:   s   &r   _macro8flags_from_pkgconfig.<locals>.get_macros.<locals>._macroV   s1    "AaxQWWS!_--4y r   -Dr5   )r9   rK   r:   s   &  r   
get_macros(flags_from_pkgconfig.<locals>.get_macrosU   s6    	! $*<<>H>a\\$5G	q	>HHHs
   AAc                     V P                  4        Uu. uF6  qP                  R 4      '       d   K  VP                  R4      '       d   K4  VNK8  	  up# u upi )r2   rM   r5   r8   s   & r   get_other_cflags.flags_from_pkgconfig.<locals>.get_other_cflags^   H    !<<> E>ad1C12d1C > E 	E E   AA	Ac                     V P                  4        Uu. uF6  qP                  R 4      '       d   K  VP                  R4      '       d   K4  VNK8  	  up# u upi )r@   rD   r5   r8   s   & r   get_other_libs,flags_from_pkgconfig.<locals>.get_other_libsb   rS   rT   c                    < \         P                  ! 4       p\        V R 4      p\        V R4      pRS! V4      RS! V4      RS! V4      RS! V4      RS! V4      RS	! V4      /# )z--cflagsz--libsinclude_dirslibrary_dirs	librariesdefine_macrosextra_compile_argsextra_link_args)r"   getfilesystemencodingr/   )
r'   fse
all_cflagsall_libsr;   rE   rA   rN   rQ   rV   s
   &   r   kwargs$flags_from_pkgconfig.<locals>.kwargsg   sr    '')':.
*,Z8,X6x0Z
3 "2:">~h7 	r   )r   )libsrc   retr'   	lib_flagsr;   rE   rA   rN   rQ   rV   s   &    @@@@@@r   flags_from_pkgconfigrh   <   sZ    EEEIEE
  C7O	C#  Jr   )	r"   r%   r   errorr   r   r_   r/   rh    r   r   <module>rk      s,      !& "%!:!:!< D=r   