Summary: | x11-misc/xac: Verify and potentially improve Python-related code | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Arfrever Frehtes Taifersar Arahesis (RETIRED) <arfrever> |
Component: | Current packages | Assignee: | Joe Jezak (RETIRED) <josejx> |
Status: | RESOLVED OBSOLETE | ||
Severity: | normal | CC: | idella4 |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 308257 | ||
Attachments: |
ebuild patch
revised ebuild patch revised ebuild patch revised ebuild patch r revised ebuild patch ebuild patch revised ebuild patch |
Description
Arfrever Frehtes Taifersar Arahesis (RETIRED)
![]() 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 |