# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/python/python.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 --- runpysetup=0 python_postmake() { ln -svnf $root$libdir/python${ver%.*} $root$libdir/python cat > $root/etc/profile.d/python3 <<-EOT export PYTHON3="$bindir/python3" export PYTHONPATH="$libdir/python${ver%.*}" EOT } atstage toolchain || hook_add postmake 5 "python_postmake" var_append confopt ' ' '--without-ensurepip' var_append confopt " " "--enable-shared --with-threads --with-platlibdir=${libdir##/${prefix}/}" var_append makeinstopt " " "-j1" python_modules() { if pkginstalled gdbm; then sed -i 's/#_gdbm _gdbmmodule.c -lgdbm/_gdbm _gdbmmodule.c -lgdbm/' Modules/Setup fi if pkginstalled readline; then sed -i 's/#readline/readline/' Modules/Setup fi if pkginstalled openssl; then sed -i 's/#_ssl/_ssl/' Modules/Setup fi if pkginstalled zlib; then sed -i 's/#zlib/zlib/' Modules/Setup fi } atstage toolchain || hook_add preconf 5 "python_modules" # We can savely ignore this dependencies. var_append flistrfilter "|" ".*: /usr/lib.*/python.*/site-packages/.*" # toolchain if atstage toolchain; then export LDFLAGS="-Wl,-rpath,${root}${libdir}" else export ax_cv_c_float_words_bigendian=$arch_bigendian fi # default python symlinks hook_add postmake 5 'ln -sf python3 $root$bindir/python' hook_add postmake 5 'ln -sf python3-config $root$bindir/python-config' if atstage cross; then # need a working getaddrinfo(), force enable or disable ipv6: var_append confopt " " " --enable-ipv6 --with-build-python=python" export READELF=${CC%-*}-readelf # e.g. for altered sparcv9 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$libdir -L$root/${libdir##*/}" var_insert LDFLAGS ' ' "-L$builddir/Python-$ver" var_append configprefix ' ' "CFLAGS=\"$CFLAGS\"" var_append configprefix ' ' "LDFLAGS=\"$LDFLAGS\"" fi