Skip to content

Commit 27bd3fa

Browse files
committed
linux: build libX11 from source and use for tk build
This does a lot of things. Most notably the subject line. We also split up tcl and tk into separate packages. Chasing the long tail of libX11's dependencies was a PITA. We still don't build the _tkinter extension. I think we still need to work on making libX11 a static library.
1 parent e3ec3f7 commit 27bd3fa

23 files changed

+1504
-44
lines changed

LICENSE.libX11.txt

+942
Large diffs are not rendered by default.

LICENSE.libXau.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright 1988, 1993, 1994, 1998 The Open Group
2+
3+
Permission to use, copy, modify, distribute, and sell this software and its
4+
documentation for any purpose is hereby granted without fee, provided that
5+
the above copyright notice appear in all copies and that both that
6+
copyright notice and this permission notice appear in supporting
7+
documentation.
8+
9+
The above copyright notice and this permission notice shall be included in
10+
all copies or substantial portions of the Software.
11+
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15+
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
16+
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
17+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18+
19+
Except as contained in this notice, the name of The Open Group shall not be
20+
used in advertising or otherwise to promote the sale, use or other dealings
21+
in this Software without prior written authorization from The Open Group.

LICENSE.libxcb.txt

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright (C) 2001-2006 Bart Massey, Jamey Sharp, and Josh Triplett.
2+
All Rights Reserved.
3+
4+
Permission is hereby granted, free of charge, to any person
5+
obtaining a copy of this software and associated
6+
documentation files (the "Software"), to deal in the
7+
Software without restriction, including without limitation
8+
the rights to use, copy, modify, merge, publish, distribute,
9+
sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so,
11+
subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall
14+
be included in all copies or substantial portions of the
15+
Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
18+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
19+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
20+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
21+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24+
OTHER DEALINGS IN THE SOFTWARE.
25+
26+
Except as contained in this notice, the names of the authors
27+
or their institutions shall not be used in advertising or
28+
otherwise to promote the sale, use or other dealings in this
29+
Software without prior written authorization from the
30+
authors.

cpython-linux/Makefile

+64-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,49 @@ $(OUTDIR)/bzip2-$(BZIP2_VERSION)-%.tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-bzip
7171
$(OUTDIR)/gdbm-$(GDBM_VERSION)-%.tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-gdbm.sh
7272
$(BUILD) --platform $* gdbm
7373

74+
$(OUTDIR)/inputproto-$(INPUTPROTO_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-inputproto.sh
75+
$(BUILD) --platform $(PLATFORM) inputproto
76+
77+
$(OUTDIR)/kbproto-$(KBPROTO_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-kbproto.sh
78+
$(BUILD) --platform $(PLATFORM) kbproto
79+
7480
$(OUTDIR)/libffi-$(LIBFFI_VERSION)-%.tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-libffi.sh
7581
$(BUILD) --platform $* libffi
7682

83+
$(OUTDIR)/libpthread-stubs-$(LIBPTHREAD_STUBS_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-libpthread-stubs.sh $(OUTDIR)/image-build.tar
84+
$(BUILD) --platform $(PLATFORM) libpthread-stubs
85+
86+
LIBX11_DEPENDS = \
87+
$(PYTHON_DEP_DEPENDS) \
88+
$(HERE)/build-libX11.sh \
89+
$(OUTDIR)/xproto-$(XPROTO_VERSION)-$(PLATFORM).tar \
90+
$(OUTDIR)/xextproto-$(XEXTPROTO_VERSION)-$(PLATFORM).tar \
91+
$(OUTDIR)/kbproto-$(KBPROTO_VERSION)-$(PLATFORM).tar \
92+
$(OUTDIR)/inputproto-$(INPUTPROTO_VERSION)-$(PLATFORM).tar \
93+
$(OUTDIR)/libxcb-$(LIBXCB_VERSION)-$(PLATFORM).tar \
94+
$(OUTDIR)/xtrans-$(XTRANS_VERSION)-$(PLATFORM).tar \
95+
$(OUTDIR)/xorgproto-$(XORGPROTO_VERSION)-$(PLATFORM).tar \
96+
$(NULL)
97+
98+
$(OUTDIR)/libX11-$(LIBX11_VERSION)-$(PLATFORM).tar: $(LIBX11_DEPENDS)
99+
$(BUILD) --platform $(PLATFORM) libX11
100+
101+
$(OUTDIR)/libXau-$(LIBXAU_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-libXau.sh $(OUTDIR)/x11-util-macros-$(X11_UTIL_MACROS_VERSION)-$(PLATFORM).tar $(OUTDIR)/xproto-$(XPROTO_VERSION)-$(PLATFORM).tar
102+
$(BUILD) --platform $(PLATFORM) libXau
103+
104+
LIBXCB_DEPENDS = \
105+
$(PYTHON_DEP_DEPENDS) \
106+
$(HERE)/build-libxcb.sh \
107+
$(OUTDIR)/image-xcb.tar \
108+
$(OUTDIR)/xcb-proto-$(XCB_PROTO_VERSION)-$(PLATFORM).tar \
109+
$(OUTDIR)/libXau-$(LIBXAU_VERSION)-$(PLATFORM).tar \
110+
$(OUTDIR)/xproto-$(XPROTO_VERSION)-$(PLATFORM).tar \
111+
$(OUTDIR)/libpthread-stubs-$(LIBPTHREAD_STUBS_VERSION)-$(PLATFORM).tar
112+
$(NULL)
113+
114+
$(OUTDIR)/libxcb-$(LIBXCB_VERSION)-$(PLATFORM).tar: $(LIBXCB_DEPENDS)
115+
$(BUILD) --platform $(PLATFORM) libxcb
116+
77117
$(OUTDIR)/ncurses-$(NCURSES_VERSION)-%.tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-ncurses.sh
78118
$(BUILD) --platform $* ncurses
79119

@@ -92,12 +132,33 @@ $(OUTDIR)/readline-$(READLINE_VERSION)-%.tar: $(PYTHON_DEP_DEPENDS) $(OUTDIR)/nc
92132
$(OUTDIR)/sqlite-$(SQLITE_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-sqlite.sh
93133
$(BUILD) --platform $(PLATFORM) sqlite
94134

95-
$(OUTDIR)/tcl-$(TCL_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-tcltk.sh
96-
$(BUILD) --platform $(PLATFORM) tcltk
135+
$(OUTDIR)/tcl-$(TCL_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-tcl.sh
136+
$(BUILD) --platform $(PLATFORM) tcl
137+
138+
$(OUTDIR)/tk-$(TK_VERSION)-$(PLATFORM).tar: $(HERE)/build-tk.sh $(OUTDIR)/tcl-$(TCL_VERSION)-$(PLATFORM).tar $(OUTDIR)/libX11-$(LIBX11_VERSION)-$(PLATFORM).tar
139+
$(BUILD) --platform $(PLATFORM) tk
97140

98141
$(OUTDIR)/uuid-$(UUID_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-uuid.sh
99142
$(BUILD) --platform $(PLATFORM) uuid
100143

144+
$(OUTDIR)/x11-util-macros-$(X11_UTIL_MACROS_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-x11-util-macros.sh
145+
$(BUILD) --platform $(PLATFORM) x11-util-macros
146+
147+
$(OUTDIR)/xcb-proto-$(XCB_PROTO_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-xcb-proto.sh
148+
$(BUILD) --platform $(PLATFORM) xcb-proto
149+
150+
$(OUTDIR)/xextproto-$(XEXTPROTO_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-xextproto.sh
151+
$(BUILD) --platform $(PLATFORM) xextproto
152+
153+
$(OUTDIR)/xorgproto-$(XORGPROTO_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-xorgproto.sh
154+
$(BUILD) --platform $(PLATFORM) xorgproto
155+
156+
$(OUTDIR)/xproto-$(XPROTO_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-xproto.sh
157+
$(BUILD) --platform $(PLATFORM) xproto
158+
159+
$(OUTDIR)/xtrans-$(XTRANS_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-xtrans.sh
160+
$(BUILD) --platform $(PLATFORM) xtrans
161+
101162
$(OUTDIR)/xz-$(XZ_VERSION)-$(PLATFORM).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-xz.sh
102163
$(BUILD) --platform $(PLATFORM) xz
103164

@@ -114,6 +175,7 @@ PYTHON_DEPENDS := \
114175
$(OUTDIR)/readline-$(READLINE_VERSION)-$(PLATFORM).tar \
115176
$(OUTDIR)/sqlite-$(SQLITE_VERSION)-$(PLATFORM).tar \
116177
$(OUTDIR)/tcl-$(TCL_VERSION)-$(PLATFORM).tar \
178+
$(OUTDIR)/tk-$(TK_VERSION)-$(PLATFORM).tar \
117179
$(OUTDIR)/uuid-$(UUID_VERSION)-$(PLATFORM).tar \
118180
$(OUTDIR)/xz-$(XZ_VERSION)-$(PLATFORM).tar \
119181
$(OUTDIR)/zlib-$(ZLIB_VERSION)-$(PLATFORM).tar \

cpython-linux/build-inputproto.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
pkg-config --version
11+
12+
export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH
13+
export PKG_CONFIG_PATH=/tools/deps/share/pkgconfig
14+
15+
tar -xf inputproto-${INPUTPROTO_VERSION}.tar.gz
16+
pushd inputproto-${INPUTPROTO_VERSION}
17+
18+
CFLAGS="-fPIC" ./configure \
19+
--prefix=/tools/deps
20+
21+
make -j `nproc`
22+
make -j `nproc` install DESTDIR=/build/out

cpython-linux/build-kbproto.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
pkg-config --version
11+
12+
export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH
13+
export PKG_CONFIG_PATH=/tools/deps/share/pkgconfig
14+
15+
tar -xf kbproto-${KBPROTO_VERSION}.tar.gz
16+
pushd kbproto-${KBPROTO_VERSION}
17+
18+
CFLAGS="-fPIC" ./configure \
19+
--prefix=/tools/deps
20+
21+
make -j `nproc`
22+
make -j `nproc` install DESTDIR=/build/out

cpython-linux/build-libX11.sh

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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/${TOOLCHAIN}/bin:/tools/host/bin:$PATH
11+
export PKG_CONFIG_PATH=/tools/deps/share/pkgconfig:/tools/deps/lib/pkgconfig
12+
13+
tar -xf libX11-${LIBX11_VERSION}.tar.gz
14+
pushd libX11-${LIBX11_VERSION}
15+
16+
patch -p1 << 'EOF'
17+
diff --git a/configure b/configure
18+
--- a/configure
19+
+++ b/configure
20+
@@ -19557,8 +19557,6 @@ else
21+
RAWCPPFLAGS="-undef -ansi"
22+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, with -ansi" >&5
23+
$as_echo "yes, with -ansi" >&6; }
24+
- else
25+
- as_fn_error $? "${RAWCPP} defines unix with or without -undef. I don't know what to do." "$LINENO" 5
26+
fi
27+
fi
28+
rm -f conftest.$ac_ext
29+
@@ -19578,8 +19576,6 @@ else
30+
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
31+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32+
$as_echo "yes" >&6; }
33+
- else
34+
- as_fn_error $? "${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do." "$LINENO" 5
35+
fi
36+
fi
37+
rm -f conftest.$ac_ext
38+
EOF
39+
40+
CFLAGS="-fPIC -I/tools/deps/include" ./configure \
41+
--prefix=/tools/deps
42+
43+
make -j `nproc`
44+
make -j `nproc` install DESTDIR=/build/out

cpython-linux/build-libXau.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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/${TOOLCHAIN}/bin:/tools/host/bin:$PATH
11+
export PKG_CONFIG_PATH=/tools/deps/share/pkgconfig:/tools/deps/lib/pkgconfig
12+
13+
tar -xf libXau-${LIBXAU_VERSION}.tar.gz
14+
pushd libXau-${LIBXAU_VERSION}
15+
CFLAGS="-fPIC" ./configure \
16+
--prefix=/tools/deps
17+
18+
make -j `nproc`
19+
make -j `nproc` install DESTDIR=/build/out
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
pkg-config --version
11+
12+
export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH
13+
export PKG_CONFIG_PATH=/tools/deps/share/pkgconfig
14+
15+
tar -xf libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz
16+
pushd libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}
17+
18+
CFLAGS="-fPIC" ./configure \
19+
--prefix=/tools/deps
20+
21+
make -j `nproc`
22+
make -j `nproc` install DESTDIR=/build/out

cpython-linux/build-libxcb.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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/${TOOLCHAIN}/bin:/tools/host/bin:$PATH
11+
export PKG_CONFIG_PATH=/tools/deps/share/pkgconfig:/tools/deps/lib/pkgconfig
12+
13+
tar -xf libxcb-${LIBXCB_VERSION}.tar.gz
14+
pushd libxcb-${LIBXCB_VERSION}
15+
16+
CFLAGS="-fPIC" ./configure \
17+
--prefix=/tools/deps
18+
19+
make -j `nproc`
20+
make -j `nproc` install DESTDIR=/build/out

cpython-linux/build-tcltk.sh renamed to cpython-linux/build-tcl.sh

+3-9
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,11 @@ set -ex
88
cd /build
99

1010
export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH
11+
export PKG_CONFIG_PATH=/tools/deps/share/pkgconfig:/tools/deps/lib/pkgconfig
1112

1213
tar -xf tcl8.6.9-src.tar.gz
1314
pushd tcl8.6.9/unix
14-
./configure --prefix=/tools/deps --enable-shared=no
15-
make -j `nproc`
16-
make -j `nproc` install DESTDIR=/build/out
17-
make -j `nproc` install
18-
popd
19-
20-
tar -xf tk8.6.9.1-src.tar.gz
21-
pushd tk8.6.9/unix
22-
./configure --prefix=/tools/deps --with-tcl=/tools/deps/lib --enable-shared=no
15+
CFLAGS="-fPIC -I/tools/deps/include" ./configure \
16+
--prefix=/tools/deps
2317
make -j `nproc`
2418
make -j `nproc` install DESTDIR=/build/out

cpython-linux/build-tk.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
tar -xf tk${TK_VERSION}-src.tar.gz
14+
pushd tk8.6.9/unix
15+
16+
CFLAGS="-fPIC" ./configure \
17+
--prefix=/tools/deps \
18+
--x-includes=/tools/deps/include \
19+
--x-libraries=/tools/deps/lib \
20+
--with-tcl=/tools/deps/lib \
21+
--enable-shared=no
22+
make -j `nproc`
23+
make -j `nproc` install DESTDIR=/build/out
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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/${TOOLCHAIN}/bin:/tools/host/bin:$PATH
11+
12+
tar -xzf util-macros-${X11_UTIL_MACROS_VERSION}.tar.gz
13+
pushd util-macros-${X11_UTIL_MACROS_VERSION}
14+
./configure \
15+
--prefix=/tools/deps
16+
17+
make -j `nproc`
18+
make -j `nproc` install DESTDIR=/build/out

cpython-linux/build-xcb-proto.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
pkg-config --version
11+
12+
export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH
13+
export PKG_CONFIG_PATH=/tools/deps/share/pkgconfig
14+
15+
tar -xf xcb-proto-${XCB_PROTO_VERSION}.tar.gz
16+
pushd xcb-proto-${XCB_PROTO_VERSION}
17+
18+
CFLAGS="-fPIC" ./configure \
19+
--prefix=/tools/deps
20+
21+
make -j `nproc`
22+
make -j `nproc` install DESTDIR=/build/out

0 commit comments

Comments
 (0)