Skip to content

Commit 6417814

Browse files
committed
linux: build tix
Tix is required by tkinter.
1 parent b564389 commit 6417814

File tree

5 files changed

+155
-0
lines changed

5 files changed

+155
-0
lines changed

Diff for: LICENSE.tix.txt

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Copyright (c) 1993-1999 Ioi Kim Lam.
2+
Copyright (c) 2000-2001 Tix Project Group.
3+
Copyright (c) 2004 ActiveState
4+
5+
This software is copyrighted by the above entities
6+
and other parties. The following terms apply to all files associated
7+
with the software unless explicitly disclaimed in individual files.
8+
9+
The authors hereby grant permission to use, copy, modify, distribute,
10+
and license this software and its documentation for any purpose, provided
11+
that existing copyright notices are retained in all copies and that this
12+
notice is included verbatim in any distributions. No written agreement,
13+
license, or royalty fee is required for any of the authorized uses.
14+
Modifications to this software may be copyrighted by their authors
15+
and need not follow the licensing terms described here, provided that
16+
the new terms are clearly indicated on the first page of each file where
17+
they apply.
18+
19+
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
20+
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
21+
ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
22+
DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
23+
POSSIBILITY OF SUCH DAMAGE.
24+
25+
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
26+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
27+
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
28+
IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
29+
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
30+
MODIFICATIONS.
31+
32+
GOVERNMENT USE: If you are acquiring this software on behalf of the
33+
U.S. government, the Government shall have only "Restricted Rights"
34+
in the software and related documentation as defined in the Federal
35+
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
36+
are acquiring the software on behalf of the Department of Defense, the
37+
software shall be classified as "Commercial Computer Software" and the
38+
Government shall have only "Restricted Rights" as defined in Clause
39+
252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
40+
authors grant the U.S. Government and others acting in its behalf
41+
permission to use and distribute the software in accordance with the
42+
terms specified in this license.
43+
44+
----------------------------------------------------------------------
45+
46+
Parts of this software are based on the Tcl/Tk software copyrighted by
47+
the Regents of the University of California, Sun Microsystems, Inc.,
48+
and other parties. The original license terms of the Tcl/Tk software
49+
distribution is included in the file docs/license.tcltk.
50+
51+
Parts of this software are based on the HTML Library software
52+
copyrighted by Sun Microsystems, Inc. The original license terms of
53+
the HTML Library software distribution is included in the file
54+
docs/license.html_lib.

Diff for: cpython-linux/Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ $(OUTDIR)/sqlite-$(SQLITE_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE
135135
$(OUTDIR)/tcl-$(TCL_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-tcl.sh
136136
$(BUILD) --platform $(PLATFORM) tcl
137137

138+
TIX_DEPENDS = \
139+
$(HERE)/build-tix.sh \
140+
$(OUTDIR)/tcl-$(TCL_VERSION)-$(PLATFORM).tar \
141+
$(OUTDIR)/tcl-$(TCL_VERSION)-$(PLATFORM).tar \
142+
$(OUTDIR)/tk-$(TK_VERSION)-$(PLATFORM).tar \
143+
$(OUTDIR)/libX11-$(LIBX11_VERSION)-$(PLATFORM).tar \
144+
$(OUTDIR)/xorgproto-$(XORGPROTO_VERSION)-$(PLATFORM).tar \
145+
$(NULL)
146+
147+
$(OUTDIR)/tix-$(TIX_VERSION)-$(PLATFORM).tar: $(TIX_DEPENDS)
148+
$(BUILD) --platform $(PLATFORM) tix
149+
138150
$(OUTDIR)/tk-$(TK_VERSION)-$(PLATFORM).tar: $(HERE)/build-tk.sh $(OUTDIR)/tcl-$(TCL_VERSION)-$(PLATFORM).tar $(OUTDIR)/libX11-$(LIBX11_VERSION)-$(PLATFORM).tar
139151
$(BUILD) --platform $(PLATFORM) tk
140152

@@ -178,6 +190,7 @@ PYTHON_DEPENDS := \
178190
$(OUTDIR)/readline-$(READLINE_VERSION)-$(PLATFORM).tar \
179191
$(OUTDIR)/sqlite-$(SQLITE_VERSION)-$(PLATFORM).tar \
180192
$(OUTDIR)/tcl-$(TCL_VERSION)-$(PLATFORM).tar \
193+
$(OUTDIR)/tix-$(TIX_VERSION)-$(PLATFORM).tar \
181194
$(OUTDIR)/tk-$(TK_VERSION)-$(PLATFORM).tar \
182195
$(OUTDIR)/uuid-$(UUID_VERSION)-$(PLATFORM).tar \
183196
$(OUTDIR)/xorgproto-$(XORGPROTO_VERSION)-$(PLATFORM).tar \

Diff for: cpython-linux/build-tix.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
# This Source Code Form is subject to the terms of the Mozilla Public
3+
# License, v. 2.0. If a copy of the MPL was not distributed with this
4+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
6+
set -ex
7+
8+
cd /build
9+
10+
export PATH=/tools/deps/bin:/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH
11+
export PKG_CONFIG_PATH=/tools/deps/share/pkgconfig:/tools/deps/lib/pkgconfig
12+
13+
# We need the tcl/tk source extracted because tix looks for private symbols.
14+
tar -xf tcl${TCL_VERSION}-src.tar.gz
15+
tar -xf tk${TK_VERSION}-src.tar.gz
16+
17+
tar -xf tix-${TIX_VERSION}.tar.gz
18+
19+
cd cpython-source-deps-tix-${TIX_VERSION}
20+
21+
# Yes, really.
22+
chmod +x configure
23+
24+
# -DUSE_INTERP_RESULT is to allow tix to use deprecated fields or something
25+
# like that.
26+
CFLAGS="-fPIC -DUSE_INTERP_RESULT" ./configure \
27+
--prefix=/tools/deps \
28+
--x-includes=/tools/deps/include \
29+
--x-libraries=/tools/deps/lib \
30+
--with-tcl=/tools/deps/lib \
31+
--with-tk=/tools/deps/lib \
32+
--enable-shared=no
33+
34+
make -j `nproc`
35+
make -j `nproc` install DESTDIR=/build/out

Diff for: cpython-linux/build.py

+45
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,46 @@ def build_readline(client, image, platform, musl=False):
473473
'deps')
474474

475475

476+
def build_tix(client, image, platform, musl=False):
477+
tcl_archive = download_entry('tcl', BUILD)
478+
tk_archive = download_entry('tk', BUILD)
479+
tix_archive = download_entry('tix', BUILD)
480+
481+
with run_container(client, image) as container:
482+
copy_toolchain(container, musl=musl)
483+
484+
install_tools_archive(container, archive_path('tcl', platform, musl=musl))
485+
install_tools_archive(container, archive_path('tk', platform, musl=musl))
486+
install_tools_archive(container, archive_path('libX11', platform, musl=musl))
487+
install_tools_archive(container, archive_path('xorgproto', platform, musl=musl))
488+
489+
copy_file_to_container(tcl_archive, container, '/build')
490+
copy_file_to_container(tk_archive, container, '/build')
491+
copy_file_to_container(tix_archive, container, '/build')
492+
copy_file_to_container(SUPPORT / 'build-tix.sh', container,
493+
'/build')
494+
495+
env = {
496+
'CC': 'clang',
497+
'TOOLCHAIN': 'clang-linux64',
498+
'TCL_VERSION': DOWNLOADS['tcl']['version'],
499+
'TIX_VERSION': DOWNLOADS['tix']['version'],
500+
'TK_VERSION': DOWNLOADS['tk']['version'],
501+
}
502+
503+
if musl:
504+
env['CC'] = 'musl-clang'
505+
506+
add_target_env(env, platform)
507+
508+
container_exec(container, '/build/build-tix.sh',
509+
environment=env)
510+
511+
download_tools_archive(container,
512+
archive_path('tix', platform, musl=musl),
513+
'deps')
514+
515+
476516
def python_build_info(container, config_c_in, setup_dist, setup_local, libressl=False):
477517
"""Obtain build metadata for the Python distribution."""
478518

@@ -698,6 +738,7 @@ def build_cpython(client, image, platform, debug=False, optimized=False, musl=Fa
698738
install_tools_archive(container, archive_path('readline', platform, musl=musl))
699739
install_tools_archive(container, archive_path('sqlite', platform, musl=musl))
700740
install_tools_archive(container, archive_path('tcl', platform, musl=musl))
741+
install_tools_archive(container, archive_path('tix', platform, musl=musl))
701742
install_tools_archive(container, archive_path('tk', platform, musl=musl))
702743
install_tools_archive(container, archive_path('uuid', platform, musl=musl))
703744
install_tools_archive(container, archive_path('xorgproto', platform, musl=musl))
@@ -906,6 +947,10 @@ def main():
906947
'xproto',
907948
})
908949

950+
elif action == 'tix':
951+
build_tix(client, get_image(client, 'build'),
952+
platform=platform, musl=musl)
953+
909954
elif action == 'tk':
910955
simple_build(client, get_image(client, 'xcb'), action,
911956
platform=platform,

Diff for: pythonbuild/downloads.py

+8
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@
334334
'licenses': ['TCL'],
335335
'license_file': 'LICENSE.tcl.txt',
336336
},
337+
'tix': {
338+
'url': 'https://github.com/python/cpython-source-deps/archive/tix-8.4.3.6.tar.gz',
339+
'size': 1836451,
340+
'sha256': 'f7b21d115867a41ae5fd7c635a4c234d3ca25126c3661eb36028c6e25601f85e',
341+
'version': '8.4.3.6',
342+
'licenses': ['TCL'],
343+
'license_file': 'LICENSE.tix.txt',
344+
},
337345
'tk': {
338346
'url': 'https://prdownloads.sourceforge.net/tcl/tk8.6.9.1-src.tar.gz',
339347
'size': 4364603,

0 commit comments

Comments
 (0)