Skip to content

Commit 3382c4b

Browse files
committed
docs: add Pixi setup instructions for macOS
1 parent ff9af79 commit 3382c4b

1 file changed

Lines changed: 48 additions & 1 deletion

File tree

‎getting-started/setup-building.rst‎

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,54 @@ some of CPython's modules (for example, ``zlib``).
903903
./configure --config-cache \
904904
--with-pydebug
905905

906-
And finally, run ``make``::
906+
.. tab:: Pixi
907+
908+
For **Pixi**, install Pixi by following the
909+
`installation instructions <https://pixi.sh/latest/installation/>`__.
910+
Create a :file:`pixi.toml` file in the CPython source directory
911+
with the following contents:
912+
913+
.. code-block:: toml
914+
915+
[workspace]
916+
name = "cpython-dev"
917+
channels = ["conda-forge"]
918+
platforms = ["osx-arm64", "osx-64"]
919+
920+
[dependencies]
921+
gdbm = "*"
922+
libmpdec-devel = "*"
923+
openssl = "3.*"
924+
pkg-config = "*"
925+
tk = "*"
926+
xz = "*"
927+
zstd = "*"
928+
zlib = "*"
929+
930+
[tasks.configure]
931+
cmd = "./configure --config-cache --with-pydebug --with-openssl=$CONDA_PREFIX"
932+
933+
[tasks.configure.env]
934+
PKG_CONFIG_PATH = "$CONDA_PREFIX/lib/pkgconfig"
935+
GDBM_CFLAGS = "-I$CONDA_PREFIX/include"
936+
GDBM_LIBS = "-L$CONDA_PREFIX/lib -lgdbm"
937+
TCLTK_CFLAGS = "$(pkg-config --cflags tcl tk)"
938+
TCLTK_LIBS = "$(pkg-config --libs tcl tk | sed 's/-l[^ ]*stub[^ ]*//g')"
939+
LDFLAGS = "-Wl,-rpath,$CONDA_PREFIX/lib"
940+
941+
[tasks.build]
942+
cmd = "make -s -j8"
943+
944+
Then install the dependencies and configure CPython::
945+
946+
$ pixi install
947+
$ pixi run configure
948+
949+
Build CPython using the configured environment::
950+
951+
$ pixi run build
952+
953+
For **Homebrew** and **MacPorts**, build CPython by running::
907954

908955
$ make -s -j8
909956

0 commit comments

Comments
 (0)