Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 546110 - app-text/asciidoc support for python3_x?
Summary: app-text/asciidoc support for python3_x?
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Marc Joliet
URL: https://github.com/asciidoc/asciidoc/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-10 06:02 UTC by Ian Savoy
Modified: 2018-07-21 01:07 UTC (History)
4 users (show)

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


Attachments
asciidoc-8.6.9.ebuild (asciidoc-8.6.9.ebuild,2.75 KB, text/plain)
2015-04-10 20:46 UTC, Ian Savoy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Savoy 2015-04-10 06:02:40 UTC
The author states that asciidoc supports python 2.4 or later. It is officially "tested" on python 2.6.5. 

Has asciidoc been tested on python3? Does upstream need to do something?

The reason i ask, is anyone with a doc USE flag enabled, who is running a non PYTHON_SINGLE_TARGET="python2_7" system, cannot currently install asciidoc due to PYTHON_COMPAT restrictions in the ebuild. This seems a little unfortunate as this is what keeps me from configuring a system that runs python 3.4 by default. I have no problems maintaining a 3.4 system until i enable the doc USE flag and run into this gem.
Comment 1 Ian Savoy 2015-04-10 20:44:14 UTC
I've successfully built and used asciidoc with python 3.4 using a local overlay. I added 9 characters to the PYTHON_COMPAT array within a copy of the 8.6.9-r1 ebuild.

PYTHON_COMPAT=( python3_4 python2_7 pypy )

In addition to testing compatibility, I think the ebuild logic should no longer rely on the python-single-r1 eclass, which limits builds to one specific implementation of python. Instead, it should use the python-any-r1 eclass.

I think this is a blocker that could be tested and fixed rather easily. I've run into it several times in the past year or two, always choosing to disable my doc USE flag, thinking that maybe i'm being silly. This is the first time I've bothered examining the issue.

I'm happy to test and attach a proper patch, and i'm happy to test that patch on amd64.
Comment 2 Ian Savoy 2015-04-10 20:46:44 UTC
Created attachment 401000 [details]
asciidoc-8.6.9.ebuild

proposed ebuild changes for testing
Comment 3 Dirkjan Ochtman (RETIRED) gentoo-dev 2015-04-11 19:47:38 UTC
Unless I'm misunderstanding, I think asciidoc is almost always run as a command-line tool. Thus, I don't see why you want to elimite the usage of python-single-r1; the -any- eclass should be used for libraries, not for command-line tools.
Comment 4 Ian Savoy 2015-04-12 13:50:13 UTC
Dirkjan,

Perhaps the misunderstanding is mine.

From what I've tested, it seems that asciidoc can run on any version of Python >=2.7. I didn't know that the -any- eclass is reserved for libraries. The bottom line is that having Python compat limited to 2.7 breaks ebuilds on systems where PYTHON_SINGLE_TARGET is set to Python3_3 or 3_4, while the package itself is actually compatible with those versions.
Comment 5 Ian Savoy 2015-04-14 00:24:17 UTC
Comment on attachment 401000 [details]
asciidoc-8.6.9.ebuild

># Copyright 1999-2014 Gentoo Foundation
># Distributed under the terms of the GNU General Public License v2
># $Header: /var/cvsroot/gentoo-x86/app-text/asciidoc/asciidoc-8.6.9.ebuild,v 1.2 2014/12/03 08:21:16 djc Exp $
>
>EAPI=5
>
>PYTHON_COMPAT=( python3_4 python3_3 python2_7 pypy )
>
>[ "$PV" == "9999" ] && inherit mercurial autotools
>inherit python-single-r1
>
>DESCRIPTION="A text document format for writing short documents, articles, books and UNIX man pages"
>HOMEPAGE="http://www.methods.co.nz/asciidoc/"
>if [ "$PV" == "9999" ]; then
>	EHG_REPO_URI="https://asciidoc.googlecode.com/hg/"
>	SRC_URI=""
>	KEYWORDS=""
>else
>	SRC_URI="mirror://sourceforge/project/${PN}/${PN}/${PV}/${P}.tar.gz"
>	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
>fi
>
>LICENSE="GPL-2"
>SLOT="0"
>IUSE="examples graphviz highlight test vim-syntax"
>
>REQUIRED_USE="${PYTHON_REQUIRED_USE}"
>
>RDEPEND=">=app-text/docbook-xsl-stylesheets-1.75
>		dev-libs/libxslt
>		graphviz? ( media-gfx/graphviz )
>		app-text/docbook-xml-dtd:4.5
>		highlight? ( || ( dev-python/pygments[${PYTHON_USEDEP}] dev-util/source-highlight ) )
>		${PYTHON_DEPS}
>"
>DEPEND="test? ( dev-util/source-highlight
>			media-sound/lilypond
>			media-gfx/imagemagick
>			dev-texlive/texlive-latex
>			app-text/dvipng
>			media-gfx/graphviz
>			${PYTHON_DEPS} )
>"
>
>if [ "$PV" == "9999" ]; then
>	DEPEND="${DEPEND}
>		dev-util/aap
>		www-client/lynx
>		dev-util/source-highlight"
>fi
>
>src_prepare() {
>	if ! use vim-syntax; then
>		sed -i -e '/^install/s/install-vim//' Makefile.in || die
>	else
>		sed -i\
>			-e "/^vimdir/s:@sysconfdir@/vim:${EPREFIX}/usr/share/vim/vimfiles:" \
>			-e 's:/etc/vim::' \
>			Makefile.in || die
>	fi
>
>	# Only needed for prefix - harmless (does nothing) otherwise
>	sed -i -e "s:^CONF_DIR=.*:CONF_DIR='${EPREFIX}/etc/asciidoc':" \
>		"${S}/asciidoc.py" || die
>
>	[ "$PV" == "9999" ] && eautoconf
>}
>
>src_configure() {
>	econf --sysconfdir="${EPREFIX}"/usr/share
>}
>
>src_compile() {
>	default
>
>	if [ "$PV" == "9999" ]; then
>		cd doc || die
>		aap -f main.aap ../{CHANGELOG,README,BUGS} || die
>	fi
>}
>
>src_install() {
>	use vim-syntax && dodir /usr/share/vim/vimfiles
>
>	emake DESTDIR="${D}" install
>
>	python_fix_shebang "${ED}"/usr/bin/*.py
>
>	if use examples; then
>		# This is a symlink to a directory
>		rm examples/website/images || die
>
>		dodoc -r examples
>		docompress -x /usr/share/doc/${PF}/examples
>		dosym ../../../asciidoc/images /usr/share/doc/${PF}/examples
>	fi
>
>	dodoc BUGS CHANGELOG README docbook-xsl/asciidoc-docbook-xsl.txt \
>			dblatex/dblatex-readme.txt filters/code/code-filter-readme.txt
>}
>
>src_test() {
>	cd tests || die
>	local -x ASCIIDOC_PY=../asciidoc.py
>	"${PYTHON}" test${PN}.py update || die
>	"${PYTHON}" test${PN}.py run || die
>}
Comment 6 Dirkjan Ochtman (RETIRED) gentoo-dev 2015-07-12 15:59:11 UTC
Should be fixed now.
Comment 7 Dirkjan Ochtman (RETIRED) gentoo-dev 2015-07-19 09:39:20 UTC
I've reverted this change, due to bug 554786. I'm not sure what you actually tested. I also wasn't able to find anything on the asciidoc website about Python 3 compatibility.
Comment 8 Tomas Racek 2015-10-30 08:36:55 UTC
Reverting the change with PYTHON_SINGLE_TARGET="python3_4" (I guess that is the reason because I didn't encounter the problem before) breaks the emerge -auvDN world:

These are the packages that would be merged, in order:

Calculating dependencies /

!!! Problem resolving dependencies for app-text/asciidoc from @selected
... done!

!!! The ebuild selected to satisfy "app-text/asciidoc" has unmet requirements.
- app-text/asciidoc-8.6.9-r1::gentoo USE="highlight vim-syntax -examples -graphviz -test" ABI_X86="64" PYTHON_SINGLE_TARGET="-pypy -python2_7" PYTHON_TARGETS="python2_7 -pypy"

  The following REQUIRED_USE flag constraints are unsatisfied:
    exactly-one-of ( python_single_target_pypy python_single_target_python2_7 )

  The above constraints are a subset of the following complete expression:
    exactly-one-of ( python_single_target_pypy python_single_target_python2_7 ) python_single_target_pypy? ( python_targets_pypy ) python_single_target_python2_7? ( python_targets_python2_7 )

(dependency required by "@selected" [set])
(dependency required by "@world" [argument])
Comment 9 Marc Joliet 2015-11-09 13:38:22 UTC
Alone the fact that asciidoc still uses print statements should make it clear that Python 3 is not supported.  Apparently some people are working on it, though: https://github.com/asciidoc/asciidoc/issues/83.
Comment 10 Marc Joliet 2017-06-06 19:31:38 UTC
I'm just going to close this, as all I can do is wait for upstream to get around to porting to Python 3, anyway.