- use same configure args for Python 2 and Python 3 <= 3.6 - Tcl/Tk not found fixed - lzma not found fixed - install Tcl/Tk and OpenSSL libs in module - TclTk and openssl are not required at run-time any more - install system libffi in module, closes #32
74 lines
2.6 KiB
Plaintext
Executable File
74 lines
2.6 KiB
Plaintext
Executable File
#!/usr/bin/env modbuild
|
|
|
|
pbuild::set_download_url "https://www.python.org/ftp/python/${V_PKG}/$P-${V_PKG}.tgz"
|
|
|
|
pbuild::set_sha256sum 'Python-3.7.3.tgz:d62e3015f2f89c970ac52343976b406694931742fbde2fed8d1ce8ebb4e1f8ff'
|
|
|
|
pbuild::add_to_group 'Programming'
|
|
|
|
pbuild::pre_configure_Linux() {
|
|
if (( V_MAJOR == 2 || (V_MAJOR == 3 && V_MINOR <= 6) )); then
|
|
pbuild::add_configure_args "CFLAGS=-fPIC -I${XZ_INCLUDE_DIR} -I${OPENSSL_INCLUDE_DIR} -I${OPENSSL_INCLUDE_DIR}/openssl"
|
|
pbuild::add_configure_args "LDFLAGS=-L${XZ_LIBRARY_DIR} -L${OPENSSL_LIBRARY_DIR}"
|
|
pbuild::add_configure_args "--enable-shared"
|
|
pbuild::add_configure_args "--with-tcltk-includes=-I${TCLTK_INCLUDE_DIR}"
|
|
pbuild::add_configure_args "--with-tcltk-libs=-L${TCLTK_LIBRARY_DIR} -ltcl8.6 -ltk8.6"
|
|
else
|
|
pbuild::add_configure_args "CFLAGS=-I${XZ_INCLUDE_DIR}"
|
|
pbuild::add_configure_args "LDFLAGS=-L${XZ_LIBRARY_DIR}"
|
|
pbuild::add_configure_args "--enable-shared"
|
|
pbuild::add_configure_args "--with-openssl=${OPENSSL_DIR}"
|
|
pbuild::add_configure_args "--enable-optimizations"
|
|
pbuild::add_configure_args "--with-tcltk-includes=-I${TCLTK_INCLUDE_DIR}"
|
|
pbuild::add_configure_args "--with-tcltk-libs=-L${TCLTK_LIBRARY_DIR} -ltcl8.6 -ltk8.6"
|
|
fi
|
|
}
|
|
|
|
pbuild::post_install_Linux() {
|
|
install "${OPENSSL_LIBRARY_DIR}"/libcrypto.so.* "${PREFIX}/lib"
|
|
install "${OPENSSL_LIBRARY_DIR}"/libssl.so.* "${PREFIX}/lib"
|
|
install "${TCLTK_LIBRARY_DIR}"/libtcl*.so "${PREFIX}/lib"
|
|
install "${TCLTK_LIBRARY_DIR}"/libtk*.so "${PREFIX}/lib"
|
|
install "${XZ_LIBRARY_DIR}"/liblzma.so.* "${PREFIX}/lib"
|
|
install /usr/lib64/libffi.so.* "${PREFIX}/lib"
|
|
}
|
|
|
|
pbuild::post_install() {
|
|
export LD_LIBRARY_PATH+=":${PREFIX}/lib"
|
|
export LDFLAGS="-L${OPENSSL_LIBRARY_DIR}"
|
|
export CPPFLAGS="-I${OPENSSL_INCLUDE_DIR} -I${OPENSSL_INCLUDE_DIR}/openssl"
|
|
export LD_LIBRARY_PATH+=":${PREFIX}/lib"
|
|
ln -fs "${PREFIX}/bin/python${V%%.*}" "${PREFIX}/bin/python"
|
|
ln -fs "${PREFIX}/include/python${V%.*}m" "${PREFIX}/include/python"
|
|
ln -fs "${PREFIX}/include/python${V%.*}m" "${PREFIX}/include/python${V%.*}"
|
|
PATH+=":${PREFIX}/bin"
|
|
cd "${BUILDBLOCK_DIR}"
|
|
"${PREFIX}/bin/python" 'get-pip.py'
|
|
|
|
std::info "Building numpy\n"
|
|
pip${V_MAJOR} install numpy
|
|
|
|
std::info "Building scipy\n"
|
|
pip${V_MAJOR} install scipy
|
|
|
|
std::info "Building matplotlub\n"
|
|
pip${V_MAJOR} install matplotlib
|
|
|
|
std::info "Building ipython\n"
|
|
pip${V_MAJOR} install ipython
|
|
|
|
std::info "Building sympy\n"
|
|
pip${V_MAJOR} install sympy
|
|
|
|
std::info "Building nose\n"
|
|
pip${V_MAJOR} install nose
|
|
|
|
std::info "Building h5py\n"
|
|
pip${V_MAJOR} install h5py
|
|
|
|
std::info "Building pandas\n"
|
|
pip${V_MAJOR} install pandas
|
|
}
|
|
|
|
|