From 6970629b0833ad3be902e900c4c05adfee82decd Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sat, 13 Aug 2022 20:35:18 +0200 Subject: [PATCH 1/4] gh-95957: Add instructions for TCL/TK and OpenSSL on RHEL/CentOS 7 --- Doc/whatsnew/3.11.rst | 16 ++++++++++++---- ...2-08-13-20-34-51.gh-issue-95957.W9ZZAx.rst | 2 ++ Misc/rhel7/README.md | 19 +++++++++++++++++++ Misc/rhel7/openssl.pc | 3 +++ Misc/rhel7/tcl.pc | 4 ++++ Misc/rhel7/tk.pc | 5 +++++ 6 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Documentation/2022-08-13-20-34-51.gh-issue-95957.W9ZZAx.rst create mode 100644 Misc/rhel7/README.md create mode 100644 Misc/rhel7/openssl.pc create mode 100644 Misc/rhel7/tcl.pc create mode 100644 Misc/rhel7/tk.pc diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 7be9a501f53192..60a1028dad1230 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -1646,10 +1646,15 @@ Build Changes :issue:`45847`, :issue:`45747`, and :issue:`45763`.) .. note:: - Use the environment variables ``TCLTK_CFLAGS`` and ``TCLTK_LIBS`` to - manually specify the location of Tcl/Tk headers and libraries. - The :program:`configure` options ``--with-tcltk-includes`` and - ``--with-tcltk-libs`` have been removed. + Use the environment variables :envvar:`TCLTK_CFLAGS` and + :envvar:`TCLTK_LIBS` to manually specify the location of Tcl/Tk headers + and libraries. The :program:`configure` options ``--with-tcltk-includes`` + and ``--with-tcltk-libs`` have been removed. + + On RHEL 7 and CentOS 7 the development packages do not provide ``tcl.pc`` + and ``tk.pc``, use :envvar:`TCLTK_LIBS="-ltk8.5 -ltkstub8.5 -ltcl8.5"`. + The directory ``Misc/rhel7`` contains ``.pc`` files and instructions + how to build Python with RHEL 7's and CentOS 7's TCL/TK and OpenSSL. * CPython now has :pep:`11` tier 3 support for cross compiling to WebAssembly platform ``wasm32-unknown-emscripten`` (Python in the browser). The effort @@ -1677,6 +1682,9 @@ Build Changes * The :mod:`tkinter` package now requires Tcl/Tk version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.) +* :mod:`tkinter` now requires ``pkg-config`` command to detect development + settings for headers and libraries. + C API Changes ============= diff --git a/Misc/NEWS.d/next/Documentation/2022-08-13-20-34-51.gh-issue-95957.W9ZZAx.rst b/Misc/NEWS.d/next/Documentation/2022-08-13-20-34-51.gh-issue-95957.W9ZZAx.rst new file mode 100644 index 00000000000000..e32e43ed0cf4b4 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2022-08-13-20-34-51.gh-issue-95957.W9ZZAx.rst @@ -0,0 +1,2 @@ +What's new 3.11 now has instructions how to build Python with TCL/TK and +OpenSSL on RHEL 7 and CentOS 7. diff --git a/Misc/rhel7/README.md b/Misc/rhel7/README.md new file mode 100644 index 00000000000000..5ceecc67946dde --- /dev/null +++ b/Misc/rhel7/README.md @@ -0,0 +1,19 @@ +# pkg-config overrides for RHEL 7 and CentOS 7 + +RHEL 7 and CentOS 7 do not provide pkg-config `.pc` files for TCL/TK. The + OpenSSL 1.1.1 pkg-config file is named `openssl11.pc` and not picked up + by Python's `configure` script. + +To build Python with system TCL/TK libs and OpenSSL 1.1 package, first +install the developer packages and the `pkgconfig` package with `pkg-config` +command. + +```shell +sudo yum install pkgconfig 'tcl-devel >= 8.5.12' 'tk-devel >= 8.5.12' openssl11-devel +``` + +The run `configure` with `PKG_CONFIG_PATH` environment variable. + +```shell +PKG_CONFIG_PATH=Misc/rhel7 ./configure -C +``` diff --git a/Misc/rhel7/openssl.pc b/Misc/rhel7/openssl.pc new file mode 100644 index 00000000000000..ffccd36cc30dff --- /dev/null +++ b/Misc/rhel7/openssl.pc @@ -0,0 +1,3 @@ +Name: OpenSSL +Version: 1.1.1k +Requires: libssl11 libcrypto11 diff --git a/Misc/rhel7/tcl.pc b/Misc/rhel7/tcl.pc new file mode 100644 index 00000000000000..922eb51264035c --- /dev/null +++ b/Misc/rhel7/tcl.pc @@ -0,0 +1,4 @@ +Name: Tool Command Language +Version: 8.5.12 +Libs: -ltcl8.5 -ltclstub8.5 +# Libs.private: -ldl -lz -lpthread -lm diff --git a/Misc/rhel7/tk.pc b/Misc/rhel7/tk.pc new file mode 100644 index 00000000000000..67cebb27f791d3 --- /dev/null +++ b/Misc/rhel7/tk.pc @@ -0,0 +1,5 @@ +Name: The Tk Toolkit +Version: 8.5.12 +Requires: tcl >= 8.5.12 +Libs: -ltk8.5 -ltkstub8.5 +# Libs.private: -lXft -lfontconfig -lfreetype -lfontconfig -lX11 From 1880cbff3cc20e3a99d7ffb72465af7fc8f329d5 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Tue, 16 Aug 2022 09:24:28 +0200 Subject: [PATCH 2/4] Update Misc/NEWS.d/next/Documentation/2022-08-13-20-34-51.gh-issue-95957.W9ZZAx.rst Co-authored-by: Erlend E. Aasland --- .../2022-08-13-20-34-51.gh-issue-95957.W9ZZAx.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Documentation/2022-08-13-20-34-51.gh-issue-95957.W9ZZAx.rst b/Misc/NEWS.d/next/Documentation/2022-08-13-20-34-51.gh-issue-95957.W9ZZAx.rst index e32e43ed0cf4b4..c617bd42abd95a 100644 --- a/Misc/NEWS.d/next/Documentation/2022-08-13-20-34-51.gh-issue-95957.W9ZZAx.rst +++ b/Misc/NEWS.d/next/Documentation/2022-08-13-20-34-51.gh-issue-95957.W9ZZAx.rst @@ -1,2 +1,2 @@ -What's new 3.11 now has instructions how to build Python with TCL/TK and -OpenSSL on RHEL 7 and CentOS 7. +What's New 3.11 now has instructions for how to provide compiler and +linker flags for Tcl/Tk and OpenSSL on RHEL 7 and CentOS 7. From 78a04d360eee0c09973bc395e5849f7694ad2c52 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Tue, 16 Aug 2022 09:32:12 +0200 Subject: [PATCH 3/4] Address more code review comments --- Doc/whatsnew/3.11.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 60a1028dad1230..80ea99adcabb44 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -1640,13 +1640,15 @@ Build Changes * Build dependencies, compiler flags, and linker flags for most stdlib extension modules are now detected by :program:`configure`. libffi, libnsl, - libsqlite3, zlib, bzip2, liblzma, libcrypt, Tcl/Tk libs, and uuid flags - are detected by ``pkg-config`` (when available). + libsqlite3, zlib, bzip2, liblzma, libcrypt, Tcl/Tk, and uuid flags + are detected by ``pkg-config`` (when available). :mod:`tkinter` now + requires ``pkg-config`` command to detect development settings for Tcl/Tk + headers and libraries. (Contributed by Christian Heimes and Erlend Egeberg Aasland in :issue:`45847`, :issue:`45747`, and :issue:`45763`.) .. note:: - Use the environment variables :envvar:`TCLTK_CFLAGS` and + Use the environment variables :envvar:`TCLTK_CFLAGS` and :envvar:`TCLTK_LIBS` to manually specify the location of Tcl/Tk headers and libraries. The :program:`configure` options ``--with-tcltk-includes`` and ``--with-tcltk-libs`` have been removed. @@ -1654,7 +1656,7 @@ Build Changes On RHEL 7 and CentOS 7 the development packages do not provide ``tcl.pc`` and ``tk.pc``, use :envvar:`TCLTK_LIBS="-ltk8.5 -ltkstub8.5 -ltcl8.5"`. The directory ``Misc/rhel7`` contains ``.pc`` files and instructions - how to build Python with RHEL 7's and CentOS 7's TCL/TK and OpenSSL. + how to build Python with RHEL 7's and CentOS 7's Tcl/Tk and OpenSSL. * CPython now has :pep:`11` tier 3 support for cross compiling to WebAssembly platform ``wasm32-unknown-emscripten`` (Python in the browser). The effort @@ -1682,9 +1684,6 @@ Build Changes * The :mod:`tkinter` package now requires Tcl/Tk version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.) -* :mod:`tkinter` now requires ``pkg-config`` command to detect development - settings for headers and libraries. - C API Changes ============= From 53584d8c1b5ecf9d9429c2ada46361c87e148c00 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Tue, 16 Aug 2022 13:08:35 +0200 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Erlend E. Aasland --- Misc/rhel7/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/rhel7/README.md b/Misc/rhel7/README.md index 5ceecc67946dde..8642e7c678f279 100644 --- a/Misc/rhel7/README.md +++ b/Misc/rhel7/README.md @@ -1,10 +1,10 @@ # pkg-config overrides for RHEL 7 and CentOS 7 -RHEL 7 and CentOS 7 do not provide pkg-config `.pc` files for TCL/TK. The +RHEL 7 and CentOS 7 do not provide pkg-config `.pc` files for Tcl/Tk. The OpenSSL 1.1.1 pkg-config file is named `openssl11.pc` and not picked up by Python's `configure` script. -To build Python with system TCL/TK libs and OpenSSL 1.1 package, first +To build Python with system Tcl/Tk libs and OpenSSL 1.1 package, first install the developer packages and the `pkgconfig` package with `pkg-config` command.