Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 696042 - x11-wm/openbox - add python3 support
Summary: x11-wm/openbox - add python3 support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LXDE team (DEFUNCT)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-02 07:12 UTC by tt_1
Modified: 2020-01-13 16:22 UTC (History)
2 users (show)

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


Attachments
Make openbox-xdg-autostart Python 3 compatible (openbox-3.6.1-py3-xdg.patch,4.59 KB, patch)
2019-11-29 19:44 UTC, Chris Mayo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2019-10-02 07:12:31 UTC
x11-wm/openbox does depend on python-2 at the moment, via PYTHON_TARGETS="python2_7", please allow to use python3_6 via the PYTHON_COMPAT function. 

pyxdg seems to have python3 available, so all RDEPS should be fine.
Comment 1 Chris Mayo 2019-11-29 19:44:18 UTC
Created attachment 597918 [details, diff]
Make openbox-xdg-autostart Python 3 compatible

USE="xdg" requires a change. I have created the attached and posted upstream:
https://github.com/danakj/openbox/pull/35

Signed-off-by: Chris Mayo <aklhfex@gmail.com>

But as there haven't been any commits for 4 years I guess it is unlikely to be included there. Hopefully it could still be included in Gentoo because it is a very simple 2to3 conversion of print statements plus "from __future__ import print_function" to support file=sys.stderr in Python 2.

For the ebuild itself I did:

--- openbox-3.6.1-r1.ebuild
+++ openbox-3.6.1-r2.ebuild
@@ -3,8 +3,8 @@
 
 EAPI=6
 
-PYTHON_COMPAT=( python2_7 )
-inherit multilib autotools python-r1 eutils
+PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
+inherit multilib autotools python-single-r1 eutils
 
 DESCRIPTION="A standards compliant, fast, light-weight, extensible window manager"
 HOMEPAGE="http://openbox.org/"
@@ -49,7 +49,10 @@
 	virtual/pkgconfig
 	x11-base/xorg-proto"
 
-PATCHES=( "${FILESDIR}/${PN}-3.5.2-gnome-session.patch" )
+PATCHES=( 
+	"${FILESDIR}/${PN}-3.5.2-gnome-session.patch"
+	"${FILESDIR}/${P}-py3-xdg.patch"
+)
 
 src_prepare() {
 	default
@@ -89,7 +92,7 @@
 	fi
 	use static-libs || prune_libtool_files --all
 	if use xdg ; then
-		python_replicate_script "${ED}"/usr/libexec/openbox-xdg-autostart
+		python_fix_shebang "${ED}"/usr/libexec/openbox-xdg-autostart
 	else
 		rm "${ED}"/usr/libexec/openbox-xdg-autostart || die
 	fi
Comment 2 Hanno Böck gentoo-dev 2020-01-13 16:12:05 UTC
This looks mostly good, though I will also bump the EAPI and will completely remove python 2 support, it's going to be removed soon anyway.
Comment 3 Larry the Git Cow gentoo-dev 2020-01-13 16:22:36 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31bad4f781f788ccf848500f8c17905ad32a2de9

commit 31bad4f781f788ccf848500f8c17905ad32a2de9
Author:     Hanno Böck <hanno@gentoo.org>
AuthorDate: 2020-01-13 16:22:27 +0000
Commit:     Hanno Böck <hanno@gentoo.org>
CommitDate: 2020-01-13 16:22:27 +0000

    x11-wm/openbox: Python 3 support.
    
    Use EAPI 7.
    Remove Python 2, change to python single package.
    
    Closes: https://bugs.gentoo.org/696042
    Signed-off-by: Hanno Böck <hanno@gentoo.org>
    Package-Manager: Portage-2.3.84, Repoman-2.3.20

 x11-wm/openbox/files/openbox-3.6.1-py3-xdg.patch | 126 +++++++++++++++++++++++
 x11-wm/openbox/openbox-3.6.1-r2.ebuild           | 100 ++++++++++++++++++
 2 files changed, 226 insertions(+)