- If this package can be used as a library and installs Python modules (*.so or *.py) into site-packages directories, then consider supporting installation for multiple Python versions. Please read section "Types of packages" in documentation [1] to decide if this package can support installation for multiple Python versions. - Ensure that the ebuilds do not use deprecated functions or variables. - Please check if Python 3 is supported by this package. You can temporarily set Python 3 as main active version of Python to properly test if this package supports Python 3. - If this package does not support Python 3: - Specify dependency on Python 2. You can use PYTHON_DEPEND helper variable, which should be set before inheriting of python eclass. Please read section "Specification of dependency on Python" in documentation [1]. - If this package cannot support installation for multiple versions of Python, then set active version of Python using python_set_active_version(). - Ensure that shebangs in installed scripts specify correct version of Python. If shebangs are too generic (e.g. '#!/usr/bin/python'), then you can use python_convert_shebangs() to convert shebangs. (Wrapper scripts generated by python_generate_wrapper_scripts() do not require any changes.) Please read section "Shebangs in installed scripts" in documentation [1]. - To ensure that changes applied to the ebuilds are sufficient, please temporarily set Python 3 as main active version of Python and test if this package can be properly installed and if it works at run time. Please see documentation [1] for more details. [1] http://www.gentoo.org/proj/en/Python/developersguide.xml
Created attachment 292689 [details] ebuild patch xac doesn't work. Can't import a pci module. DEPENDS on python2
Created attachment 292703 [details, diff] revised ebuild patch
(In reply to comment #2) PYTHON_DEPEND="2" distutils.eclass should be used.
Created attachment 292913 [details, diff] revised ebuild patch
(In reply to comment #4) distutils.eclass inherits python.eclass, so python.eclass doesn't need to be explicitly inherited. Don't set RESTRICT_PYTHON_ABIS variable if it is unused. If 'python_convert_shebangs -r 2 "${ED}"' is needed, then it should be called after installation of scripts into "${ED}". This patch causes "distutils_pkg_postinst() called illegally" error. 'chmod +x "${S}/src/setup.py"' should be deleted. - ./setup.py build || die "Failed to build the C modules" + distutils_src_compile - ./setup.py install --root "${D}" || die "Failed to install the C modules" + distutils_src_install (DISTUTILS_SETUP_FILES could be used.)
Created attachment 292967 [details, diff] revised ebuild patch gentoo64 xac # grep DISTUTILS_SETUP_FILES $PORTDIR/eclass/distutils.eclass # @ECLASS-VARIABLE: DISTUTILS_SETUP_FILES * QA Notice: command not found: * * /mnt/gen2/tmpdir/portage/x11-misc/xac-0.6_pre4/temp/environment: line 2997: DISTUTILS_SETUP_FILES: command not found strange. running install_egg_info Writing /mnt/gen2/tmpdir/portage/x11-misc/xac-0.6_pre4/image/usr/lib64/python2.7/site-packages/pci-1.0-py2.7.egg-info * Converting shebang in '/mnt/gen2/tmpdir/portage/x11-misc/xac-0.6_pre4/image/usr/sbin/xac' * Converting shebang in '/mnt/gen2/tmpdir/portage/x11-misc/xac-0.6_pre4/image/usr/lib64/xac/arch.py' --- replaced dir /usr/lib64 --- replaced dir /usr >>> Original instance of package unmerged safely. >>> x11-misc/xac-0.6_pre4 merged.
(In reply to comment #6) DISTUTILS_SETUP_FILES is an array, not function. DISTUTILS_SETUP_FILES=("src|setup.py") would cause automatic change of current directory to "src" before running setup.py commands, so 'cd "${S}"/src' could be removed. Don't define src_postint() function. Package managers don't use such a function.
Created attachment 293077 [details, diff] r figured it, should have kmown a capitalised term is an array. not seen it b4. And src_postint; was setting src_in place of pkg_. practice practice
(In reply to comment #8) > should have kmown a capitalised term is an array. Bash allows lower-case arrays and upper-case functions. > And src_postint; was setting src_in place of pkg_. This patch still contains src_postint(). If both python_set_active_version() and python_pkg_setup() are called, then python_set_active_version() should always be called before python_pkg_setup(). Other inherited eclasses don't export phase functions, so please delete: src_compile() { distutils_src_compile; } pkg_postinst() { distutils_pkg_postinst; }
Created attachment 293333 [details, diff] revised ebuild patch
(In reply to comment #10) You should still use distutils.eclass as in patch from comment #8. Start with patch from comment #8 and only apply suggestions from comment #9.
Created attachment 293707 [details, diff] ebuild patch After much deliberation; it works anyway
(In reply to comment #12) Also inherit multilib.eclass. Delete '>=dev-lang/python-2.3' from DEPEND/RDEPEND. pkg_setup() { python_set_active_version 2 python_pkg_setup } pkg_postinst() { python_mod_optimize /usr/$(get_libdir)/xac } pkg_postrm() { python_mod_cleanup /usr/$(get_libdir)/xac }
Created attachment 293825 [details, diff] revised ebuild patch
This approach was changed by the -r1 python eclasses