o
    5‘ði#  ã                   @  s„   d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	 ddl
mZ ddlmZ dd	lmZ dd
lmZ G dd„ deƒZdS )zBdistutils.command.build

Implements the Distutils 'build' command.é    )ÚannotationsN)ÚCallable)ÚClassVaré   )Úshow_compilers)ÚCommand)ÚDistutilsOptionError)Úget_platformc                   @  s¼   e Zd ZU dZdddddddd	d
eƒ › d�fdddddgZddgZded< dddefgZ	ded< dd„ Z
d.dd„Zd.d d!„Zd"d#„ Zd$d%„ Zd&d'„ Zd(d)„ Zd*efd+efd,efd-efgZdS )/Úbuildz"build everything needed to install)zbuild-base=Úbz base directory for build library)zbuild-purelib=Nz2build directory for platform-neutral distributions)zbuild-platlib=Nz3build directory for platform-specific distributions)z
build-lib=NzWbuild directory for all distribution (defaults to either build-purelib or build-platlib)zbuild-scripts=Nzbuild directory for scripts)zbuild-temp=Útztemporary build directoryz
plat-name=Úpz3platform name to build for, if supported [default: ú])z	compiler=Úczspecify the compiler type)z	parallel=Újznumber of parallel build jobs)ÚdebugÚgz;compile extensions and libraries with debugging information)ÚforceÚfz2forcibly build everything (ignore file timestamps))zexecutable=Úez5specify final destination interpreter path (build.py)r   r   zClassVar[list[str]]Úboolean_optionszhelp-compilerNzlist available compilerszAClassVar[list[tuple[str, str | None, str, Callable[[], object]]]]Úhelp_optionsc                 C  sL   d| _ d | _d | _d | _d | _d | _d | _d | _d | _d| _	d | _
d | _d S )Nr
   F)Ú
build_baseÚbuild_purelibÚbuild_platlibÚ	build_libÚ
build_tempÚbuild_scriptsÚcompilerÚ	plat_namer   r   Ú
executableÚparallel©Úself© r$   úb/root/parts/websockify/install/lib/python3.10/site-packages/setuptools/_distutils/command/build.pyÚinitialize_options3   s   
zbuild.initialize_optionsÚreturnÚNonec                 C  sl  | j d u r
tƒ | _ n	tjdkrtdƒ‚d| j › dtjj› �}t 	d¡r'|d7 }t
tdƒr0|d7 }| jd u r>tj | jd	¡| _| jd u rNtj | jd	| ¡| _| jd u ra| j ¡ r]| j| _n| j| _| jd u rqtj | jd
| ¡| _| jd u r‰tj | jdtjj› dtjj› �¡| _| jd u r™tjr™tj tj¡| _t| jtƒr´z	t| jƒ| _W d S  ty³   tdƒ‚w d S )NÚntzW--plat-name only supported on Windows (try using './configure --help' on your platform)Ú.ú-ÚPy_GIL_DISABLEDr   Úgettotalrefcountz-pydebugÚlibÚtempzscripts-zparallel should be an integer)r   r	   ÚosÚnamer   ÚsysÚimplementationÚ	cache_tagÚ	sysconfigÚget_config_varÚhasattrr   ÚpathÚjoinr   r   r   ÚdistributionÚhas_ext_modulesr   r   Úversion_infoÚmajorÚminorr    ÚnormpathÚ
isinstancer!   ÚstrÚintÚ
ValueError)r#   Úplat_specifierr$   r$   r%   Úfinalize_optionsC   sF   


ÿ








þÿýzbuild.finalize_optionsc                 C  s   |   ¡ D ]}|  |¡ qd S ©N)Úget_sub_commandsÚrun_command)r#   Úcmd_namer$   r$   r%   Úrun€   s   ÿz	build.runc                 C  ó
   | j  ¡ S rF   )r:   Úhas_pure_modulesr"   r$   r$   r%   rL   ‹   ó   
zbuild.has_pure_modulesc                 C  rK   rF   )r:   Úhas_c_librariesr"   r$   r$   r%   rN   Ž   rM   zbuild.has_c_librariesc                 C  rK   rF   )r:   r;   r"   r$   r$   r%   r;   ‘   rM   zbuild.has_ext_modulesc                 C  rK   rF   )r:   Úhas_scriptsr"   r$   r$   r%   rO   ”   rM   zbuild.has_scriptsÚbuild_pyÚ
build_clibÚ	build_extr   )r'   r(   )Ú__name__Ú
__module__Ú__qualname__Údescriptionr	   Úuser_optionsr   Ú__annotations__r   r   r&   rE   rJ   rL   rN   r;   rO   Úsub_commandsr$   r$   r$   r%   r
      sB   
 ýì
ÿ

=ür
   )Ú__doc__Ú
__future__r   r0   r2   r5   Úcollections.abcr   Útypingr   Ú	ccompilerr   Úcorer   Úerrorsr   Úutilr	   r
   r$   r$   r$   r%   Ú<module>   s    