www-apps/blohg: port to python 3 (bug #702226)
authorRafael Martins <rafaelmartins@gentoo.org>
Tue, 10 Mar 2020 22:16:32 +0000 (23:16 +0100)
committerRafael Martins <rafaelmartins@gentoo.org>
Tue, 10 Mar 2020 22:16:55 +0000 (23:16 +0100)
Package-Manager: Portage-2.3.79, Repoman-2.3.16
Signed-off-by: Rafael Martins <rafaelmartins@gentoo.org>
www-apps/blohg/Manifest
www-apps/blohg/blohg-0.13-r4.ebuild [moved from www-apps/blohg/blohg-0.13-r3.ebuild with 56% similarity]
www-apps/blohg/blohg-9999.ebuild
www-apps/blohg/files/use-recent-libgit2.patch [deleted file]

index fa6fb11b357a35112ee3f2f8cc722c1b590a24c3..8d8bcd4e9d73738f1119887c4ceddf60dcd10e84 100644 (file)
@@ -1 +1,2 @@
 DIST blohg-0.13.tar.gz 75003 BLAKE2B 6b9760ffa99ca85a40e35c81341e395fdfc00256f5e80091c6883e54f050d4cf3f345c4752b635b1297d15e0055c182e00e74165451d695bb396c869c285646f SHA512 de8643e85e3f72827408d726bbe2f8674dcc6dcf1efdc47d33a934892071f8365cb54e63a6adb803361c7fd04032b2ac4e786c442676e8a8132b6d3221696865
+DIST blohg-patches-0.13-r4.tar.xz 14960 BLAKE2B 31458f412395000a05b359db25e8af648c54e554a3b3216f6c62355fd7203fc19c4452defe7692d0382653563f7b0565395af4ceb2177cc8e6de1d7e1a3c7b41 SHA512 3f709880bdd1826b74982866931f5002fdda451a205b6c278a9869979314413f37c8bf6400e3064a463f2fd34810e22d0d4cd5dfc89786f9e276dd9bd9fe5ec2
similarity index 56%
rename from www-apps/blohg/blohg-0.13-r3.ebuild
rename to www-apps/blohg/blohg-0.13-r4.ebuild
index f30c7c0ad0b4d2f302eb88afd160fa7c5a48b0e4..6a4abc9a54f5df0705c9266007bef30a7175de0f 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python3_6 )
 
 GIT_ECLASS=""
 if [[ ${PV} = *9999* ]]; then
@@ -16,7 +16,8 @@ inherit distutils-r1 ${GIT_ECLASS}
 DESCRIPTION="A Mercurial (or Git) based blogging engine"
 HOMEPAGE="https://github.com/rafaelmartins/blohg"
 
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
+       https://dev.gentoo.org/~rafaelmartins/distfiles/${PN}-patches-${PVR}.tar.xz"
 KEYWORDS="~amd64 ~x86"
 if [[ ${PV} = *9999* ]]; then
        SRC_URI=""
@@ -32,27 +33,28 @@ REQUIRED_USE="|| ( git mercurial )
        test? ( git mercurial )"
 
 RDEPEND="
-       >=dev-python/click-2.0
-       >=dev-python/docutils-0.11
-       >=dev-python/flask-0.10.1
-       >=dev-python/flask-babel-0.7
-       >=dev-python/frozen-flask-0.7
-       >=dev-python/jinja-2.5.2
-       dev-python/pyyaml
-       dev-python/setuptools
-       dev-python/pygments
-       git? ( >=dev-python/pygit2-0.21.3 )
-       mercurial? ( >=dev-vcs/mercurial-1.6 )"
+       dev-python/click[${PYTHON_USEDEP}]
+       dev-python/docutils[${PYTHON_USEDEP}]
+       dev-python/feedgenerator[${PYTHON_USEDEP}]
+       dev-python/flask[${PYTHON_USEDEP}]
+       dev-python/flask-babel[${PYTHON_USEDEP}]
+       dev-python/frozen-flask[${PYTHON_USEDEP}]
+       dev-python/jinja[${PYTHON_USEDEP}]
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+       dev-python/pygments[${PYTHON_USEDEP}]
+       git? ( dev-python/pygit2[${PYTHON_USEDEP}] )
+       mercurial? ( >=dev-vcs/mercurial-5.2[${PYTHON_USEDEP}] )"
 
 DEPEND="${RDEPEND}
-       doc? ( dev-python/sphinx )
-       test? ( dev-python/mock )"
+       doc? ( dev-python/sphinx )"
 
 python_prepare_all() {
+       if [[ ${PV} != *9999* ]]; then
+               eapply "${WORKDIR}/${PN}-patches-${PVR}"
+       fi
+
        if ! use git; then
                rm -rf blohg/vcs_backends/git || die 'rm failed'
-       else
-               local PATCHES=( "${FILESDIR}/use-recent-libgit2.patch" )
        fi
 
        if ! use mercurial; then
@@ -74,11 +76,3 @@ python_install_all() {
 python_test() {
        esetup.py test
 }
-
-pkg_postinst() {
-       local ver="${PV}"
-       [[ ${PV} = *9999* ]] && ver="latest"
-
-       elog "You may want to check the upgrade notes:"
-       elog "http://docs.blohg.org/en/${ver}/upgrade/"
-}
index 03b42c18276f0da858098f8419a8a4c6395886d1..6a4abc9a54f5df0705c9266007bef30a7175de0f 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python3_6 )
 
 GIT_ECLASS=""
 if [[ ${PV} = *9999* ]]; then
@@ -16,7 +16,8 @@ inherit distutils-r1 ${GIT_ECLASS}
 DESCRIPTION="A Mercurial (or Git) based blogging engine"
 HOMEPAGE="https://github.com/rafaelmartins/blohg"
 
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
+       https://dev.gentoo.org/~rafaelmartins/distfiles/${PN}-patches-${PVR}.tar.xz"
 KEYWORDS="~amd64 ~x86"
 if [[ ${PV} = *9999* ]]; then
        SRC_URI=""
@@ -32,23 +33,26 @@ REQUIRED_USE="|| ( git mercurial )
        test? ( git mercurial )"
 
 RDEPEND="
-       >=dev-python/click-2.0
-       >=dev-python/docutils-0.11
-       >=dev-python/flask-0.10.1
-       >=dev-python/flask-babel-0.7
-       >=dev-python/frozen-flask-0.7
-       >=dev-python/jinja-2.5.2
-       dev-python/pyyaml
-       dev-python/setuptools
-       dev-python/pygments
-       git? ( >=dev-python/pygit2-0.21.3 )
-       mercurial? ( >=dev-vcs/mercurial-1.6 )"
+       dev-python/click[${PYTHON_USEDEP}]
+       dev-python/docutils[${PYTHON_USEDEP}]
+       dev-python/feedgenerator[${PYTHON_USEDEP}]
+       dev-python/flask[${PYTHON_USEDEP}]
+       dev-python/flask-babel[${PYTHON_USEDEP}]
+       dev-python/frozen-flask[${PYTHON_USEDEP}]
+       dev-python/jinja[${PYTHON_USEDEP}]
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+       dev-python/pygments[${PYTHON_USEDEP}]
+       git? ( dev-python/pygit2[${PYTHON_USEDEP}] )
+       mercurial? ( >=dev-vcs/mercurial-5.2[${PYTHON_USEDEP}] )"
 
 DEPEND="${RDEPEND}
-       doc? ( dev-python/sphinx )
-       test? ( dev-python/mock )"
+       doc? ( dev-python/sphinx )"
 
 python_prepare_all() {
+       if [[ ${PV} != *9999* ]]; then
+               eapply "${WORKDIR}/${PN}-patches-${PVR}"
+       fi
+
        if ! use git; then
                rm -rf blohg/vcs_backends/git || die 'rm failed'
        fi
@@ -72,11 +76,3 @@ python_install_all() {
 python_test() {
        esetup.py test
 }
-
-pkg_postinst() {
-       local ver="${PV}"
-       [[ ${PV} = *9999* ]] && ver="latest"
-
-       elog "You may want to check the upgrade notes:"
-       elog "http://docs.blohg.org/en/${ver}/upgrade/"
-}
diff --git a/www-apps/blohg/files/use-recent-libgit2.patch b/www-apps/blohg/files/use-recent-libgit2.patch
deleted file mode 100644 (file)
index decd01b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-diff --git a/blohg/vcs_backends/git/filectx.py b/blohg/vcs_backends/git/filectx.py
-index 84f7aa3..5e20762 100644
---- a/blohg/vcs_backends/git/filectx.py
-+++ b/blohg/vcs_backends/git/filectx.py
-@@ -73,7 +73,11 @@ def _last_changeset(self):
-                                       GIT_SORT_TIME):
-             diff = self._repo.diff(head, commit)
-             for patch in diff:
--                if patch.new_file_path == self._path:
-+                try:
-+                    new_file_path = patch.delta.new_file.path
-+                except AttributeError:
-+                    new_file_path = patch.new_file_path
-+                if new_file_path == self._path:
-                     return head
-             head = commit