Skip to content

Commit 84b8813

Browse files
hugovkerlend-aaslandezio-melotti
authored
macOS: Add tabs for Homebrew/MacPorts and for 3.13+/3.11-3.12/3.8-3.10 (#1317)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
1 parent 0c56002 commit 84b8813

File tree

1 file changed

+43
-33
lines changed

1 file changed

+43
-33
lines changed

getting-started/setup-building.rst

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -690,54 +690,64 @@ on Linux, macOS and iOS.
690690
manager, like Homebrew_ or MacPorts_, and then add the appropriate paths
691691
for the header and library files to your ``configure`` command.
692692

693-
For example, with **Homebrew**, install the dependencies::
693+
.. tab:: Homebrew
694694

695-
$ brew install pkg-config openssl@3.0 xz gdbm tcl-tk mpdecimal
695+
For **Homebrew**, install dependencies using ``brew``::
696696

697-
Then, for Python 3.13 and newer, run ``configure``::
697+
$ brew install pkg-config openssl@3.0 xz gdbm tcl-tk mpdecimal
698698

699-
$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
700-
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
701-
./configure --with-pydebug \
702-
--with-system-libmpdec \
703-
--with-openssl="$(brew --prefix openssl@3.0)"
699+
.. tab:: Python 3.13+
704700

705-
For Python 3.11 and 3.12::
701+
For Python 3.13 and newer::
706702

707-
$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
708-
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
709-
./configure --with-pydebug \
710-
--with-openssl="$(brew --prefix openssl@3.0)"
703+
$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
704+
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
705+
./configure --with-pydebug \
706+
--with-system-libmpdec \
707+
--with-openssl="$(brew --prefix openssl@3.0)"
711708

712-
Or, for Python 3.8 through 3.10::
709+
.. tab:: Python 3.11-3.12
713710

714-
$ CPPFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
715-
LDFLAGS="-L$(brew --prefix gdbm)/lib -L$(brew --prefix xz)/lib" \
716-
./configure --with-pydebug \
717-
--with-openssl="$(brew --prefix openssl@3.0)" \
718-
--with-tcltk-libs="$(pkg-config --libs tcl tk)" \
719-
--with-tcltk-includes="$(pkg-config --cflags tcl tk)"
711+
For Python 3.11 and 3.12::
720712

721-
And finally, run ``make``::
713+
$ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
714+
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
715+
./configure --with-pydebug \
716+
--with-openssl="$(brew --prefix openssl@3.0)"
722717

723-
$ make -s -j2
718+
.. tab:: Python 3.8-3.10
719+
720+
For Python 3.8, 3.9, and 3.10::
721+
722+
$ CPPFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
723+
LDFLAGS="-L$(brew --prefix gdbm)/lib -L$(brew --prefix xz)/lib" \
724+
./configure --with-pydebug \
725+
--with-openssl="$(brew --prefix openssl@3.0)" \
726+
--with-tcltk-libs="$(pkg-config --libs tcl tk)" \
727+
--with-tcltk-includes="$(pkg-config --cflags tcl tk)"
728+
729+
.. tab:: MacPorts
730+
731+
For **MacPorts**, install dependencies using ``port``::
732+
733+
$ sudo port install pkgconfig openssl xz gdbm tcl tk +quartz mpdecimal
724734

725-
Alternatively, with **MacPorts**::
735+
.. tab:: Python 3.13+
726736

727-
$ sudo port install pkgconfig openssl xz gdbm tcl tk +quartz mpdecimal
737+
For Python 3.13 and newer::
728738

729-
Then, for Python 3.13 and newer, run ``configure``::
739+
$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
740+
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
741+
./configure --with-pydebug \
742+
--with-system-libmpdec
730743

731-
$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
732-
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
733-
./configure --with-pydebug \
734-
--with-system-libmpdec
744+
.. tab:: Python 3.11-3.12
735745

736-
Or, for Python 3.11 and 3.12, run ``configure``::
746+
For Python 3.11 and 3.12::
737747

738-
$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
739-
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
740-
./configure --with-pydebug
748+
$ GDBM_CFLAGS="-I$(dirname $(dirname $(which port)))/include" \
749+
GDBM_LIBS="-L$(dirname $(dirname $(which port)))/lib -lgdbm" \
750+
./configure --with-pydebug
741751

742752
And finally, run ``make``::
743753

0 commit comments

Comments
 (0)