HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/relenv/build/__pycache__/darwin.cpython-310.pyc
o

;j��	@sdZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Zddlm
Z
mZddlmZmZmZmZddlmZmZmZmZmZmZmZerVdd	lmZeeZd9dd�Zd:dd�Zd;dd�Z ej!ded�Z"edd�Z#e#r�e#dZ$e#dZ%e#dZ&ndZ$dZ%d Z&e"j!dee%e$e&d!�d"�ed#d�Z'e'r�e'dZ(e'dZ)e'dZ*nd$Z(d%Z)d&Z*e"j!d'e)e(e*d!�d(�ed)d�Z+e+r�e+dZ,e+dZ-e+�.d*d+�Z/nd+Z/d,Z,d-Z-e"j!d.ee,d/e/e-d0�d1�e"j!d2e gd3�d4d5e"j0dd0�d6�e"j!d7ed2gd8�dS)<z
The darwin build process.
�)�annotationsN)�IO�
TYPE_CHECKING�)�DARWIN�MACOS_DEVELOPMENT_TARGET�arches�runcmd�)�Dirs�
build_openssl�build_sqlite�builds�finalize�get_dependency_version�update_sbom_checksums)�MutableMapping�env�MutableMapping[str, str]�dirsr�return�NonecCsTd|d<ddg}d�|�j|jd�|d<t|d<d	d
g}d�|�j|jd�|d<dS)
z�
    Make sure we have the correct environment variables set.

    :param env: The environment dictionary
    :type env: dict
    :param dirs: The working directories
    :type dirs: ``relenv.build.common.Dirs``
    Zclang�CCz-Wl,-rpath,{prefix}/libz-L{prefix}/lib� )�prefix�LDFLAGSZMACOSX_DEPLOYMENT_TARGETz-I{prefix}/includez-I{prefix}/include/readline�CFLAGSN)�join�formatrr)rr�ldflagsZcflags�r �G/opt/saltstack/salt/lib/python3.10/site-packages/relenv/build/darwin.py�populate_env%s	��r"cCstdd�}|s	dS|d}|�dd�}d|�d|�d	�}t�|j�d
d}|��s,dSt�|j�}|d|�d	�}tj�	|t
|��t�|��}	|	j
t
|�d�Wd�n1s[wY|d|��d
}
g}dD]+}t�t
|
|��D]}
|t�|
�j}|��r�|��t�|
t
|��|�|�qxqmt��}|D]
}t�|||f�q�|d}|��r�tt
|�d��0}|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�Wd�n1s�wYi}|D]}d|j��}|||<q�t|j|�dS)z�
    Update the bundled expat library to the latest version.

    Python ships with an older bundled expat. This function updates it
    to the latest version for security and bug fixes.
    Zexpat�darwinN�version�.�_z9https://github.com/libexpat/libexpat/releases/download/R_z/expat-z.tar.xzZModuleszexpat-)�path�lib)z*.hz*.cz
xmlparse.c�az>
/* Relenv: include new entropy sources for expat >= 2.8.0 */
z6#if defined(_WIN32)
#include "random_rand_s.c"
#endif
zC#if defined(HAVE_GETENTROPY)
#include "random_getentropy.c"
#endif
z?#if defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM)
z%#include "random_getrandom.c"
#endif
zK#if defined(HAVE_ARC4RANDOM_BUF)
#include "random_arc4random_buf.c"
#endif
zC#if defined(HAVE_ARC4RANDOM)
#include "random_arc4random.c"
#endif
zX#if !defined(_WIN32) && defined(XML_DEV_URANDOM)
#include "random_dev_urandom.c"
#endif
zModules/expat/)r�replace�pathlib�Path�source�exists�tmpbuild�urllib�requestZurlretrieve�str�tarfile�open�
extractall�glob�name�unlink�shutil�copy2�append�time�os�utime�writer)rrZ
expat_infor$Zversion_tag�urlZ	expat_dirr/Ztarball_path�tarZexpat_source_dirZ
updated_filesZsource_fileZ	file_pathZtarget_file�nowZ
xmlparse_c�fZfiles_to_updateZ
relative_pathr r r!�update_expat<sZ
��







�
rD�logfp�IO[str]cCs�t||�dj|j|dd�|d<tddd|j��d|j��dd	g|||d
�tdd��}|�d
tj�|�d�Wd�n1sCwYtgd�|||d
�tddg|||d
�tddg|||d
�dS)a
    Run the commands to build Python.

    :param env: The environment dictionary
    :type env: dict
    :param dirs: The working directories
    :type dirs: ``relenv.build.common.Dirs``
    :param logfp: A handle for the log file
    :type logfp: file
    z!-Wl,-rpath,{prefix}/lib {ldflags}r)rrz./configurez-vz	--prefix=z--with-openssl=z--enable-optimizationsz--disable-test-modules)r�stderr�stdout�
Modules/Setupza+rz$*disabled*
_tkinter
nsl
ncurses
nis
N)Zsedzs/#zlib/zlib/grIZmakez-j8�install)	rDrrr	r4�seek�io�SEEK_ENDr?)rrrE�fpr r r!�build_python�s*


��
�rOr#)r"�opensslr$r@�sha256z3.5.4z_https://github.com/openssl/openssl/releases/download/openssl-{version}/openssl-{version}.tar.gzZ(b75daac8e10f189abe28a076ba5905d363e4801f)r@r$�checksum)�
build_func�download�xzz5.8.1z)http://tukaani.org/xz/xz-{version}.tar.gzZ(ed4d5589c4cfe84e1697bd02a9954b76af336931�XZ)rTZsqliteZ
sqliteversionZ3500400z8https://sqlite.org/2025/sqlite-autoconf-{version}.tar.gzZ(145048005c777796dd8494aa1cfed304e8c34283�SQLitezChttps://woz.io/relenv/dependencies/sqlite-autoconf-{version}.tar.gz)r@Zfallback_urlr$rR)r7rSrT�python)rPrVrWzChttps://www.python.org/ftp/python/{version}/Python-{version}.tar.xzz:https://woz.io/relenv/dependencies/Python-{version}.tar.gz)rS�wait_onrTzrelenv-finalize)rSrY)rrrrrr)rrrrrr)rrrrrErFrr)1�__doc__�
__future__rr6rLr=r+r9r3r<�urllib.requestr0�typingrr�commonrrrr	rrr
rrrr�collections.abcrZARCHESr"rDrO�add�buildZopenssl_infoZopenssl_versionZopenssl_urlZopenssl_checksumZxz_infoZ
xz_versionZxz_urlZxz_checksumZsqlite_infoZ
sqlite_urlZsqlite_checksum�getZsqlite_version_numr$r r r r!�<module>s�$



I$

��

��

�����
�