commit:     f670386bd4a330a24ea5da640fbaf52a13389e36
Author:     Rafael Martins <rafaelmartins <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 28 23:04:36 2020 +0000
Commit:     Rafael Martins <rafaelmartins <AT> gentoo <DOT> org>
CommitDate: Fri Feb 28 23:36:48 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f670386b

app-portage/g-octave: python3 support and more from git (bug #706214)

Package-Manager: Portage-2.3.79, Repoman-2.3.16
Signed-off-by: Rafael Martins <rafaelmartins <AT> gentoo.org>

 app-portage/g-octave/Manifest                      |  1 +
 .../files/g-octave-0.4.1-add_cave_support.patch    | 88 ----------------------
 .../files/g-octave-0.4.1-fix-Makefile.patch        | 12 ---
 .../g-octave-0.4.1-fix-sourceforge-svn-root.patch  | 36 ---------
 ...ve-0.4.1-r6.ebuild => g-octave-0.4.1-r7.ebuild} | 20 ++---
 5 files changed, 11 insertions(+), 146 deletions(-)

diff --git a/app-portage/g-octave/Manifest b/app-portage/g-octave/Manifest
index df89e8b399c..f50b4166cf1 100644
--- a/app-portage/g-octave/Manifest
+++ b/app-portage/g-octave/Manifest
@@ -1,2 +1,3 @@
 DIST g-octave-0.4.1.tar.gz 52285 BLAKE2B 
d1e39931471c527c5542683c976487c56bca2a4666a437e110fa41b504287c0dd87aad94bf98298544c374c6d3faa0722fb3fab43228c56425be19b450ae0dd4
 SHA512 
424b95e626981aa5685795ffb3df1a1d608e5293adba074cc67f7dcf08d4a0c94a0174005f97a8da1ba1ae4233299e6a530af96ba3b9fd0d8b224915e947efb3
 DIST g-octave-db-bdf02cb.tar.gz 39836 BLAKE2B 
fadc374e69bbf785f9e9ecae02eeba6f1c048d11503e5d97db2b4cc65c820ec829615be72ce823ef44ecb0e59e1b68dd40f7310d19d0b7706a2ff47ab95c0851
 SHA512 
5eae00e18b6d4633ed0feda3a2eea6b36da049c133bcd49e54481443ff435bfcab0f303ab9f0e8c3f48fad707625ee13b4564c510d89fa196e737c7599ea5fa6
+DIST g-octave-patches-0.4.1-r7.tar.xz 8800 BLAKE2B 
514b154d7cbb816f15d88a2efe0d0b8503a5a09dedfcc79ab61fdb2fca8be193752ffb477ad7ea7be167e341a91e8d83c5b70fa20ed9d55da6f668acc8743e6c
 SHA512 
cb03afd16bb7f2f0ddf2c4f11bdde2748b8ee0124642cfed4697e19adda30b141b3217afa55e996acf3e295d06af0636ba235a631039e65ca7920eef3243e267

diff --git a/app-portage/g-octave/files/g-octave-0.4.1-add_cave_support.patch 
b/app-portage/g-octave/files/g-octave-0.4.1-add_cave_support.patch
deleted file mode 100644
index 27468c1bba5..00000000000
--- a/app-portage/g-octave/files/g-octave-0.4.1-add_cave_support.patch
+++ /dev/null
@@ -1,88 +0,0 @@
---- g-octave-0.4.1/g_octave/package_manager.py 2010-10-23 23:37:26.000000000 
+0200
-+++ g-octave-0.4.1/g_octave/package_manager.py 2011-05-25 12:52:10.510019006 
+0200
-@@ -15,6 +15,7 @@
-     'Portage',
-     'Pkgcore',
-     'Paludis',
-+    'Cave',
- ]
- 
- import grp
-@@ -243,3 +244,56 @@
-                 packages.append(line.strip())
-         return packages
- 
-+class Cave(Base):
-+    
-+    _client = '/usr/bin/cave'
-+    _group = 'paludisbuild'
-+    
-+    post_uninstall = [
-+        'You may want to remove the dependencies too, using:',
-+        '# cave purge',
-+    ]
-+    
-+    def __init__(self, ask=False, verbose=False, pretend=False, 
oneshot=False, nocolor=False):
-+        self._fullcommand = [self._client]
-+        self._cmd = ['-z']
-+        oneshot and self._cmd.append('-1')
-+        not pretend and self._cmd.append('-x')
-+        #if verbose:
-+        #    self._fullcommand += [
-+        #        '--show-descriptions', 'all',
-+        #        '--show-option-descriptions', 'all',
-+        #    ]
-+        #cave doesn't support '--ask'
-+        #cave doesn't support '--no-color'
-+    
-+    def run_command(self, command):
-+        return subprocess.call(self._fullcommand + command + self._cmd)
-+    
-+    def install_package(self, pkgatom, catpkg):
-+        return self.run_command(['resolve'] + [pkgatom])
-+
-+    def uninstall_package(self, pkgatom, catpkg):
-+        return self.run_command(['uninstall'] + [pkgatom])
-+    
-+    def update_package(self, pkgatom=None, catpkg=None):
-+        cmd = ['-1','-K','s','-k','s']
-+        if pkgatom is None:
-+            pkgatom = self.installed_packages()
-+        else:
-+            pkgatom = [pkgatom]
-+        self.do_ebuilds(pkgatom)
-+        return self.run_command(['resolve'] + cmd + pkgatom)
-+    
-+    def installed_packages(self):
-+        packages = []
-+        p = subprocess.Popen([
-+            'cave',
-+            'print-ids',
-+            '--matching', 'g-octave/*::installed',
-+            '--format', '%c/%p\n',
-+        ], stdout=subprocess.PIPE)
-+        if p.wait() == os.EX_OK:
-+            for line in p.stdout:
-+                packages.append(line.strip())
-+        return packages
---- g-octave-0.4.1/scripts/g-octave    2011-05-25 12:00:25.740019020 +0200
-+++ g-octave-0.4.1/scripts/g-octave    2011-05-25 12:00:39.434019008 +0200
-@@ -217,7 +217,7 @@
-             return os.EX_DATAERR
-         return os.EX_OK
- 
--    from g_octave.package_manager import Portage, Pkgcore, Paludis
-+    from g_octave.package_manager import Portage, Pkgcore, Paludis, Cave
- 
-     if conf_prefetch.package_manager == 'portage':
-         log.info('Your package manager is: Portage')
-@@ -228,6 +228,9 @@
-     elif conf_prefetch.package_manager == 'paludis':
-         log.info('Your package manager is: Paludis')
-         pkg_manager = Paludis(options.ask, options.verbose, options.pretend, 
options.oneshot, not options.colors)
-+    elif conf_prefetch.package_manager == 'cave':
-+        log.info('Your package manager is: Paludis (Cave)')
-+        pkg_manager = Cave(options.ask, options.verbose, options.pretend, 
options.oneshot, not options.colors)
-     else:
-         log.error('Invalid package manager: %s' % 
conf_prefetch.package_manager)
-         out.eerror('Invalid package manager: %s' % 
conf_prefetch.package_manager)

diff --git a/app-portage/g-octave/files/g-octave-0.4.1-fix-Makefile.patch 
b/app-portage/g-octave/files/g-octave-0.4.1-fix-Makefile.patch
deleted file mode 100644
index af56b4f75d9..00000000000
--- a/app-portage/g-octave/files/g-octave-0.4.1-fix-Makefile.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- g-octave-0.4.1/share/g-octave.eclass       2013-05-30 19:01:07.980521612 
+0200
-+++ g-octave-0.4.1/share/g-octave.eclass.new   2013-05-30 19:03:38.933514388 
+0200
-@@ -48,6 +48,9 @@
-       for filename in Makefile configure; do
-               cp "${DISTDIR}/g-octave_${filename}" "${S}/${filename}"
-       done
-+
-+      sed -i -e 's@libexec@lib@g' "${S}/Makefile" || die 'sed failed.'
-+
-       chmod 0755 "${S}/configure"
-       if [ -e "${S}"/src/autogen.sh ]; then
-               cd "${S}"/src && ./autogen.sh || die 'failed to run autogen.sh'

diff --git 
a/app-portage/g-octave/files/g-octave-0.4.1-fix-sourceforge-svn-root.patch 
b/app-portage/g-octave/files/g-octave-0.4.1-fix-sourceforge-svn-root.patch
deleted file mode 100644
index 2700f3b100d..00000000000
--- a/app-portage/g-octave/files/g-octave-0.4.1-fix-sourceforge-svn-root.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- a/contrib/manage_pkgdb.py
-+++ b/contrib/manage_pkgdb.py
-@@ -50,7 +50,7 @@ class SfUpdates:
-     # feed url from 
'http://sourceforge.net/projects/octave/files/Octave%20Forge%20Packages/Individual%20Package%20Releases/'
-     feed_url = 
u'http://sourceforge.net/api/file/index/project-id/2888/mtime/desc/rss?path=%2FOctave%20Forge%20Packages%2FIndividual%20Package%20Releases'
- 
--    svnroot_url = 
u'https://octave.svn.sourceforge.net/svnroot/octave/trunk/octave-forge/'
-+    svnroot_url = u'http://svn.code.sf.net/p/octave/code/trunk/octave-forge'
-     categories = [u'main', u'extra', u'language', u'nonfree']
- 
-     _timestamp = None
---- a/g_octave/description.py
-+++ b/g_octave/description.py
-@@ -269,7 +269,7 @@ def __getattr__(self, name):
- 
- class SvnDescription(Description):
-     
--    _url = 
'https://octave.svn.sourceforge.net/svnroot/octave/trunk/octave-forge'
-+    _url = 'http://svn.code.sf.net/p/octave/code/trunk/octave-forge'
-     
-     def __init__(self, category, package):
-         temp_desc = config_file = tempfile.mkstemp()[1]
---- a/share/g-octave.eclass
-+++ b/share/g-octave.eclass
-@@ -13,7 +13,7 @@
- G_OCTAVE_CAT="${G_OCTAVE_CAT:-main}"
- 
- 
--REPO_URI="https://octave.svn.sourceforge.net/svnroot/octave/trunk/octave-forge";
-+REPO_URI="http://svn.code.sf.net/p/octave/code/trunk/octave-forge";
- if [[ ${PV} = 9999* ]]; then
-       inherit subversion autotools
-       ESVN_REPO_URI="${REPO_URI}/${G_OCTAVE_CAT}/${PN}"
--- 
-1.7.10
-

diff --git a/app-portage/g-octave/g-octave-0.4.1-r6.ebuild 
b/app-portage/g-octave/g-octave-0.4.1-r7.ebuild
similarity index 81%
rename from app-portage/g-octave/g-octave-0.4.1-r6.ebuild
rename to app-portage/g-octave/g-octave-0.4.1-r7.ebuild
index dbf8ea63a92..12d1e45780d 100644
--- a/app-portage/g-octave/g-octave-0.4.1-r6.ebuild
+++ b/app-portage/g-octave/g-octave-0.4.1-r7.ebuild
@@ -1,9 +1,10 @@
-# 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,7} )
+DISTUTILS_USE_SETUPTOOLS=no
 
 DB_COMMIT="bdf02cbf0a8d017c6c1bddeffd6f03d5d90695ed"
 DB_DIR="rafaelmartins-${PN}-db-${DB_COMMIT:0:7}"
@@ -15,7 +16,8 @@ HOMEPAGE="https://github.com/rafaelmartins/g-octave";
 
 SRC_URI="https://github.com/downloads/rafaelmartins/${PN}/${P}.tar.gz
        https://github.com/rafaelmartins/${PN}-db/tarball/${DB_COMMIT} ->
-               ${PN}-db-${DB_COMMIT:0:7}.tar.gz"
+               ${PN}-db-${DB_COMMIT:0:7}.tar.gz
+       
https://dev.gentoo.org/~rafaelmartins/distfiles/${PN}-patches-${PVR}.tar.xz";
 
 LICENSE="GPL-2"
 SLOT="0"
@@ -27,11 +29,7 @@ DEPEND="doc? ( >=dev-python/sphinx-1.0 )"
 RDEPEND="sys-apps/portage"
 
 python_prepare_all() {
-       local PATCHES=(
-               "${FILESDIR}/${P}-add_cave_support.patch"
-               "${FILESDIR}/${P}-fix-sourceforge-svn-root.patch"
-               "${FILESDIR}/${P}-fix-Makefile.patch"
-       )
+       eapply "${WORKDIR}/${PN}-patches-${PVR}"
        sed -i -e 's/^has_fetch.*$/has_fetch = False/' scripts/g-octave \
                || die 'failed to patch the g-octave main script'
        distutils-r1_python_prepare_all
@@ -50,6 +48,8 @@ python_install_all() {
                mv docs/_build/{html,sphinx} || die 'mv failed.'
                HTML_DOCS+=( docs/_build/sphinx )
        fi
+       insinto /usr/share/g-octave
+       doins "${DISTDIR}/${PN}-db-${DB_COMMIT:0:7}.tar.gz"
        distutils-r1_python_install_all
 }
 
@@ -74,7 +74,7 @@ pkg_config() {
        local db="$(g-octave --config db)"
        mkdir -p "${db}" || die 'mkdir failed.'
        einfo "Extracting g-octave database files to: ${db}"
-       tar -xzf "${DISTDIR}/${PN}-db-${DB_COMMIT:0:7}.tar.gz" -C "${db}" || 
die 'tar failed.'
+       tar -xzf "${EROOT}/usr/share/g-octave/${PN}-db-${DB_COMMIT:0:7}.tar.gz" 
-C "${db}" || die 'tar failed.'
        rm -rf "${db}"/{patches,octave-forge,info.json,manifest.json,timestamp} 
|| die 'rm db files failed.'
        mv -f "${db}/${DB_DIR}"/* "${db}" || die 'mv failed.'
        rm -rf "${db}/${DB_DIR}" || die 'rm db dir failed.'

Reply via email to