1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/python2/python2.conf
3 # Copyright (C) 2004 - 2021 The T2 SDE Project
4 # Copyright (C) 1998 - 2004 ROCK Linux Project
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
14 cat > $root/etc/profile.d/python <<-EOT
15 export PYTHON="$root/$prefix/bin/python"
21 var_append confopt " " "--enable-shared --with-threads"
22 var_append makeinstopt " " "-j1"
24 # atstage cross && var_append confopt " " " --disable-ipv6"
27 if pkginstalled gdbm; then
28 sed -i 's:#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib:gdbm gdbmmodule.c -I/usr/include -L/usr/lib:' Modules/Setup.dist
31 if pkginstalled readline; then
32 sed -i 's:#readline:readline:' Modules/Setup.dist
35 if pkginstalled openssl; then
36 sed -i 's:#SSL=/usr/local/ssl:SSL=/usr:' Modules/Setup.dist
37 sed -i 's:#_ssl:_ssl:' Modules/Setup.dist
38 sed -i 's:# -DUSE_SSL: -DUSE_SSL:' Modules/Setup.dist
39 sed -i 's:# -L$(SSL): -L$(SSL):' Modules/Setup.dist
42 if pkginstalled zlib; then
43 sed -i 's:#zlib:zlib:' Modules/Setup.dist
47 # We can savely ignore this dependencies.
48 var_append flistrfilter "|" ".*: /usr/lib.*/python.*/site-packages/.*"
50 atstage toolchain || hook_add preconf 5 "python_modules"
51 atstage toolchain || hook_add postmake 5 "python_postmake"
55 sed -i "s,/lib\([[:blank:]]\),/${libdir##*/}\1,g" Modules/Setup.dist
56 ln -svnf ../lib/python${ver:0:3} $root$libdir/python${ver:0:3}
59 [[ $libdir = *lib ]] || hook_add preconf 9 "fix_python_libdir"
62 if atstage toolchain; then
63 export LDFLAGS="-Wl,-rpath,${root}${libdir}"
64 hook_add postmake 5 'cp Parser/pgen $root$bindir/python-pgen'
67 # gcc 6.3 / 7 - mis-compile?
68 #var_append GCC_WRAPPER_APPEND ' ' '-DHAVE_BROKEN_SEM_GETVALUE=1'
71 if atstage cross; then
72 var_append configcache ' ' "ac_cv_buggy_getaddrinfo=no"
73 var_append configcache ' ' "ac_cv_file__dev_ptmx=yes"
74 var_append configcache ' ' "ac_cv_file__dev_ptc=no"
75 var_insert CFLAGS ' ' "-I$root/usr/include"
76 var_insert LDFLAGS ' ' "-L$root/usr/lib -L$root/lib"
77 var_insert LDFLAGS ' ' "-L$builddir/Python-$ver"
78 var_append configprefix ' ' "CFLAGS=\"$CFLAGS\""
79 var_append configprefix ' ' "LDFLAGS=\"$LDFLAGS\""