# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/python2/python2.conf # Copyright (C) 2004 - 2023 The T2 SDE Project # Copyright (C) 1998 - 2004 ROCK Linux Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- python_postmake() { cat > $root/etc/profile.d/python <<-EOT export PYTHON="$root$bindir/python" EOT } runpysetup=0 var_append confopt " " "--enable-shared --with-threads" var_append makeinstopt " " "-j1" # atstage cross && var_append confopt " " " --disable-ipv6" python_modules() { if pkginstalled gdbm; then 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 fi if pkginstalled readline; then sed -i 's:#readline:readline:' Modules/Setup.dist fi if pkginstalled openssl; then sed -i 's:#SSL=/usr/local/ssl:SSL=/usr:' Modules/Setup.dist sed -i 's:#_ssl:_ssl:' Modules/Setup.dist sed -i 's:# -DUSE_SSL: -DUSE_SSL:' Modules/Setup.dist sed -i 's:# -L$(SSL): -L$(SSL):' Modules/Setup.dist fi if pkginstalled zlib; then sed -i 's:#zlib:zlib:' Modules/Setup.dist fi } # We can savely ignore this dependencies. var_append flistrfilter "|" ".*: /usr/lib.*/python.*/site-packages/.*" atstage toolchain || hook_add preconf 5 "python_modules" atstage toolchain || hook_add postmake 5 "python_postmake" # hardcoded paths fix_python_libdir() { sed -i "s,/lib\([[:blank:]]\),/${libdir##*/}\1,g" Modules/Setup.dist ln -svnf ../lib/python${ver:0:3} $root$libdir/python${ver:0:3} } [[ $libdir = *lib ]] || hook_add preconf 9 "fix_python_libdir" # toolchain if atstage toolchain; then export LDFLAGS="-Wl,-rpath,${root}${libdir}" hook_add postmake 5 'cp Parser/pgen $root$bindir/python-pgen' fi # cross-compiling if atstage cross; then var_append configcache ' ' "ac_cv_buggy_getaddrinfo=no" var_append configcache ' ' "ac_cv_file__dev_ptmx=yes" var_append configcache ' ' "ac_cv_file__dev_ptc=no" var_insert CFLAGS ' ' "-I$root/usr/include" var_insert LDFLAGS ' ' "-L$root/usr/lib -L$root/lib" var_insert LDFLAGS ' ' "-L$builddir/Python-$ver" var_append configprefix ' ' "CFLAGS=\"$CFLAGS\"" var_append configprefix ' ' "LDFLAGS=\"$LDFLAGS\"" fi