Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 313533 - media-libs/libkate: Verify and potentially improve Python-related code
Summary: media-libs/libkate: Verify and potentially improve Python-related code
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
: 390321 (view as bug list)
Depends on:
Blocks: 308257
  Show dependency tree
 
Reported: 2010-04-06 17:40 UTC by Arfrever Frehtes Taifersar Arahesis (RETIRED)
Modified: 2012-10-10 03:13 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild patch (libkate.patch,2.88 KB, patch)
2011-11-15 22:51 UTC, Ian Delaney (RETIRED)
Details | Diff
revised ebuild patch (libkate.patch,3.03 KB, patch)
2011-11-17 16:43 UTC, Ian Delaney (RETIRED)
Details | Diff
revised ebuild patch (libkate.patch,3.06 KB, patch)
2011-11-21 16:22 UTC, Ian Delaney (RETIRED)
Details | Diff
revised ebuild patch (libkate.patch,1.63 KB, patch)
2011-11-25 12:00 UTC, Ian Delaney (RETIRED)
Details | Diff
revised ebuild patch (libkate.patch,1.66 KB, patch)
2011-11-26 12:24 UTC, Ian Delaney (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-04-06 17:40:53 UTC
- 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
Comment 1 Ian Delaney (RETIRED) gentoo-dev 2011-11-15 22:51:24 UTC
Created attachment 292705 [details, diff]
ebuild patch

all emerge well.
Comment 2 Arfrever Frehtes Taifersar Arahesis 2011-11-16 19:29:14 UTC
(In reply to comment #1)

This package doesn't support Python 3.
This package shouldn't install byte-compiled Python modules.
python_mod_optimize() and python_mod_cleanup() should be called.
Comment 3 Ian Delaney (RETIRED) gentoo-dev 2011-11-17 16:43:18 UTC
Created attachment 292917 [details, diff]
revised ebuild patch
Comment 4 Arfrever Frehtes Taifersar Arahesis 2011-11-18 05:26:13 UTC
(In reply to comment #3)

Such pkg_setup() is not needed.

This patch doesn't disable installation of byte-compiled Python modules in src_install().

This patch causes call to die() in pkg_postinst() and pkg_postrm().
Comment 5 Ian Delaney (RETIRED) gentoo-dev 2011-11-19 14:05:26 UTC
here is another you will need help with.

ecompressdir: bzip2 -9 /usr/share/doc
removing executable bit: usr/lib64/libkate.la
removing executable bit: usr/lib64/liboggkate.la
 * ERROR: media-libs/libkate-0.3.8 failed (postinst phase):
 *   python_mod_optimize(): Missing files or directories
 with your advised inclusions.  The above is suspicious.  The 2 files are selectively removed, then python_mod_optimize can't find some files.

Needs a revision of either of the two.
Comment 6 Arfrever Frehtes Taifersar Arahesis 2011-11-20 06:53:46 UTC
(In reply to comment #5)
> here is another you will need help with.

I mentioned this call to die() in comment #4.

>  *   python_mod_optimize(): Missing files or directories
>  with your advised inclusions.  The above is suspicious.  The 2 files are
> selectively removed, then python_mod_optimize can't find some files.

The error message says that you forgot to pass paths to files or directories to this function.
Comment 7 Ian Delaney (RETIRED) gentoo-dev 2011-11-21 16:22:45 UTC
Created attachment 293337 [details, diff]
revised ebuild patch
Comment 8 Arfrever Frehtes Taifersar Arahesis 2011-11-23 20:14:09 UTC
(In reply to comment #7)

eutils.eclass isn't used, so don't inherit it.

PYTHON_DEPEND="wxwidgets? 2"
Delete 'wxwidgets? ( dev-lang/python )' from DEPEND.

pkg_setup() {
	if use wxwidgets; then
		python_set_active_version 2
		python_pkg_setup
	fi
}

This package shouldn't install byte-compiled Python modules:
src_prepare() {
	echo "#!/bin/sh" > misc/autotools/py-compile
}

Don't change DESTDIR="${D}" to DESTDIR="${ED}".

Shebang in /usr/bin/KateDJ should be fixed. (This script is installed only with USE="wxwidgets".)

python_mod_optimize() and python_mod_cleanup() should be called with correct paths. This package installs Python modules in /usr/lib/python${version}/site-packages/kdj directory, so use:
pkg_postinst() {
	python_mod_optimize kdj
}
pkg_postrm() {
	python_mod_cleanup kdj
}
Comment 9 Ian Delaney (RETIRED) gentoo-dev 2011-11-25 12:00:22 UTC
Created attachment 293703 [details, diff]
revised ebuild patch

grief. 
pkg_postinst() {
	python_mod_optimize kdj
fi
need be	
pkg_postinst() {
	if use wxwidgets; then
		python_mod_optimize kdj
	fi
}	
pkg_postrm() {
	python_mod_cleanup kdj
}
seems ok as is
Comment 10 Arfrever Frehtes Taifersar Arahesis 2011-11-25 23:06:34 UTC
(In reply to comment #9)

python_mod_cleanup() should also be called only with USE="wxwidgets":

pkg_postrm() {
	if use wxwidgets; then
		python_mod_cleanup kdj
	fi
}
Comment 11 Ian Delaney (RETIRED) gentoo-dev 2011-11-26 12:24:40 UTC
Created attachment 293821 [details, diff]
revised ebuild patch
Comment 12 Arfrever Frehtes Taifersar Arahesis 2012-10-10 02:48:22 UTC
(In reply to comment #11)

src_prepare() can be now improved:

src_prepare() {
	if use wxwidgets; then
		python_clean_py-compile_files
	fi
}
Comment 13 Rick Farina (Zero_Chaos) gentoo-dev 2012-10-10 03:12:26 UTC
Thanks for all the help Arfrever et al

/var/cvsroot/gentoo-x86/media-libs/libkate/libkate-0.4.1.ebuild,v  <--  libkate-0.4.1.ebuild
new revision: 1.4; previous revision: 1.3
/var/cvsroot/gentoo-x86/media-libs/libkate/libkate-0.3.8.ebuild,v  <--  libkate-0.3.8.ebuild
new revision: 1.3; previous revision: 1.2
/var/cvsroot/gentoo-x86/media-libs/libkate/libkate-0.3.7.ebuild,v  <--  libkate-0.3.7.ebuild
new revision: 1.17; previous revision: 1.16
Comment 14 Rick Farina (Zero_Chaos) gentoo-dev 2012-10-10 03:13:22 UTC
*** Bug 390321 has been marked as a duplicate of this bug. ***