# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/python/python.conf # Copyright (C) 2004 - 2021 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 ../lib/python $root$libdir/python cat > $root/etc/profile.d/python3 <<-EOT export PYTHON3="$root/$prefix/bin/python3" EOT } atstage toolchain || hook_add postmake 5 "python_postmake" var_append confopt " " "--enable-shared --with-threads --with-platlibdir=${libdir##*/}" var_append makeinstopt " " "-j1" 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 fi if pkginstalled readline; then sed -i 's:#readline:readline:' Modules/Setup fi if pkginstalled openssl; then sed -i 's:#SSL=/usr/local/ssl:SSL=/usr:' Modules/Setup sed -i 's:#_ssl:_ssl:' Modules/Setup sed -i 's:# -DUSE_SSL: -DUSE_SSL:' Modules/Setup sed -i 's:# -L$(SSL): -L$(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/.*" # hardcoded paths fix_python_libdir() { sed -i "s,/lib\([[:blank:]]\),/${libdir##*/}\1,g" Modules/Setup 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}" 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" 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/usr/lib -L$root/lib" var_insert LDFLAGS ' ' "-L$builddir/Python-$ver" var_append configprefix ' ' "CFLAGS=\"$CFLAGS\"" var_append configprefix ' ' "LDFLAGS=\"$LDFLAGS\"" fi