Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 312103

Summary: app-text/gnome-doc-utils: Verify and potentially improve Python-related code
Product: Gentoo Linux Reporter: Arfrever Frehtes Taifersar Arahesis (RETIRED) <arfrever>
Component: Current packagesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED FIXED    
Severity: enhancement CC: arc, dieter.ferdinand, sgml, xmw
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 308257, 313471    

Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-03-30 16:48:45 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 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-05-14 21:04:14 UTC
*** Bug 319769 has been marked as a duplicate of this bug. ***
Comment 2 Michael Weber (RETIRED) gentoo-dev 2010-06-03 16:51:39 UTC
--- gnome-doc-utils-0.20.1.ebuild.old	2010-06-03 18:48:32.000000000 +0000
+++ gnome-doc-utils-0.20.1.ebuild	2010-06-03 18:49:55.000000000 +0000
@@ -4,6 +4,8 @@
 
 EAPI="2"
 
+PYTHON_DEPEND="2:2.4"
+
 inherit gnome2 python
 
 DESCRIPTION="A collection of documentation utilities for the Gnome project"
@@ -15,8 +17,7 @@
 IUSE=""
 
 RDEPEND=">=dev-libs/libxml2-2.6.12[python]
-	 >=dev-libs/libxslt-1.1.8
-	 >=dev-lang/python-2.4"
+	 >=dev-libs/libxslt-1.1.8"
 DEPEND="${RDEPEND}
 	sys-devel/gettext
 	>=dev-util/intltool-0.35
@@ -35,6 +36,7 @@
 
 pkg_setup() {
 	G2CONF="${G2CONF} --disable-scrollkeeper"
+	python_set_active_version 2
 }
 
 src_prepare() {


Comment 3 Michael Weber (RETIRED) gentoo-dev 2010-06-03 17:51:48 UTC
sry, i've mised a shebang entry to xml2po

--- gnome-doc-utils-0.20.1.ebuild.old   2010-06-03 18:48:32.000000000 +0000
+++ gnome-doc-utils-0.20.1.ebuild       2010-06-03 19:50:02.000000000 +0000
@@ -4,6 +4,8 @@
 
 EAPI="2"
 
+PYTHON_DEPEND="2:2.4"
+
 inherit gnome2 python
 
 DESCRIPTION="A collection of documentation utilities for the Gnome project"
@@ -15,8 +17,7 @@
 IUSE=""
 
 RDEPEND=">=dev-libs/libxml2-2.6.12[python]
-        >=dev-libs/libxslt-1.1.8
-        >=dev-lang/python-2.4"
+        >=dev-libs/libxslt-1.1.8"
 DEPEND="${RDEPEND}
        sys-devel/gettext
        >=dev-util/intltool-0.35
@@ -35,6 +36,7 @@
 
 pkg_setup() {
        G2CONF="${G2CONF} --disable-scrollkeeper"
+       python_set_active_version 2
 }
 
 src_prepare() {
@@ -43,6 +45,8 @@
        # disable pyc compiling
        mv py-compile py-compile.orig
        ln -s $(type -P true) py-compile
+
+       python_convert_shebangs -r 2 .
 }
 
 pkg_postinst() {
Comment 4 Michael Weber (RETIRED) gentoo-dev 2010-06-03 18:12:15 UTC
sorry for the bugspam, ithought correcting the shebang on the xml2po.in would be enought. This one does it as last action in src_install. I think that gnome2_src_install is the implied function w/o explicit src_install here. caling python_src_install failes with an 'not supportorted on non multi-abi ebuilds'.

--- gnome-doc-utils-0.20.1.ebuild.old	2010-06-03 18:48:32.000000000 +0000
+++ gnome-doc-utils-0.20.1.ebuild	2010-06-03 20:00:41.000000000 +0000
@@ -4,6 +4,8 @@
 
 EAPI="2"
 
+PYTHON_DEPEND="2:2.4"
+
 inherit gnome2 python
 
 DESCRIPTION="A collection of documentation utilities for the Gnome project"
@@ -15,8 +17,7 @@
 IUSE=""
 
 RDEPEND=">=dev-libs/libxml2-2.6.12[python]
-	 >=dev-libs/libxslt-1.1.8
-	 >=dev-lang/python-2.4"
+	 >=dev-libs/libxslt-1.1.8"
 DEPEND="${RDEPEND}
 	sys-devel/gettext
 	>=dev-util/intltool-0.35
@@ -35,6 +36,7 @@
 
 pkg_setup() {
 	G2CONF="${G2CONF} --disable-scrollkeeper"
+	python_set_active_version 2
 }
 
 src_prepare() {
@@ -45,6 +47,12 @@
 	ln -s $(type -P true) py-compile
 }
 
+src_install() {
+	gnome2_src_install
+
+	python_convert_shebangs -r 2 "${D}"
+}
+
 pkg_postinst() {
 	python_need_rebuild
 	python_mod_optimize $(python_get_sitedir)/xml2po
Comment 5 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-10-10 16:15:51 UTC
app-text/gnome-doc-utils-0.20.2 contains some fixes and only needs fix for shebangs.
Comment 6 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-11-01 15:54:36 UTC
  29 Oct 2010; Gilles Dartiguelongue <eva@gentoo.org>
  gnome-doc-utils-0.20.2.ebuild:
  Enhance multiple python ABI support, bug #312103.
Comment 7 Pacho Ramos gentoo-dev 2010-11-01 16:11:30 UTC
(In reply to comment #6)
>   29 Oct 2010; Gilles Dartiguelongue <eva@gentoo.org>
>   gnome-doc-utils-0.20.2.ebuild:
>   Enhance multiple python ABI support, bug #312103.
> 

Thanks a lot (I have just updated to fixed gnome-doc-utils to stop getting false positives)
Comment 8 Pacho Ramos gentoo-dev 2011-01-02 14:09:01 UTC
*** Bug 349369 has been marked as a duplicate of this bug. ***