From 49d36e9793573ab563c841fc0aebeb7d62c58859 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 24 Aug 2023 03:50:36 +0100 Subject: gentoo auto-resync : 24:08:2023 - 03:50:35 --- app-misc/gramps/Manifest | 2 + .../gramps/files/gramps-5.1.6-pep517_setup.patch | 163 +++++++++++++++++++++ app-misc/gramps/gramps-5.1.6-r2.ebuild | 82 +++++++++++ 3 files changed, 247 insertions(+) create mode 100644 app-misc/gramps/files/gramps-5.1.6-pep517_setup.patch create mode 100644 app-misc/gramps/gramps-5.1.6-r2.ebuild (limited to 'app-misc/gramps') diff --git a/app-misc/gramps/Manifest b/app-misc/gramps/Manifest index 9899f88ddd91..e6b3ba1cefc4 100644 --- a/app-misc/gramps/Manifest +++ b/app-misc/gramps/Manifest @@ -1,4 +1,6 @@ AUX gramps-5.1.3-test_locale.patch 1195 BLAKE2B 1b1aeb08b90bff9db9d028499428efa60a16b48597bcf466c07a77e3f658c8550eca84b899047d1bc6e20eb26e8dfab9637ae7aced1b99167466ea6c51707132 SHA512 70daee9afdce0f939ad3cec094fb4004f5c162e6b49849f83486db5baec074a8673d7a6096a367279019712a11f0b40e827f6cb3019e7dc3cc6bad327fee35ec +AUX gramps-5.1.6-pep517_setup.patch 5873 BLAKE2B 62b8ca02f318c318e019366f35e39bda53fd000c8389cf1c4edfc673df008029d475c8667e69e25e3f27edbcce2f64e71d21fad43657bcfeb449b00ac7d9f2c0 SHA512 98a3807916f624b81f92cdbac1296fa9e91dd796b73d206da8561c61d45ead48bb178894cf0793471bb798f82d114a9fb3de1f0f0252cff7356402d0ba6111cb DIST gramps-5.1.6.tar.gz 17429153 BLAKE2B fe94d80ff209e1f27ec1cfa533e916514336c1d367435e0a9da4b8309efbc9c047302a67ec24e28237eaead67ff63e76bd1384ac1e3df10e08ae98aca126566b SHA512 419bbfa54ca3bf33e71fd579c84a56eebe4afc78ccd50c23b2d62869684709ccbf373e8da0e65835d9fc21a29d2d144597d6cf8c425e14c91574535d4b1ab64d EBUILD gramps-5.1.6-r1.ebuild 2155 BLAKE2B 61271d0bacbcb5d8b496d9ea1600a4bf39644fd090943256c9d54eb417cc0e5268b090cfb05c5d3098e9ed9cb3cd637d4af0197d821e91e54bc29195cb79c020 SHA512 d1f857f5a3d68cef31229c830a1352705cfaf7e31c4a2511c711bf814818d1e6cc597812ea8e0cc9fc55a0dd51194bb0b69833daf71770c6337072879c56eb28 +EBUILD gramps-5.1.6-r2.ebuild 2208 BLAKE2B befbd27d525bd4814d2199c42eb21d0517d377fda848a9a19d863fc5233419359b08c36fc77bf6f21037b01f481f56a94c7357220408b70d96d324d5f47cf035 SHA512 571432deebd1d74903e4ac443473d4447724e4303a8bd044fa27ed82bd3f9b96168ffbfe2424392434e7850c5e34940f861e5eb5666371980b88b5c41f8451dd MISC metadata.xml 5599 BLAKE2B a7156f87c83c95d4205c25274e04ca063a8f2246301e62c6f7854a6bb585fc895481d9accb9c6c48e30c09ccc472c81193b2d1b514fe0b53a3681f182c9922ba SHA512 41089a951759e1a3aa67009681b9f1da3ecfb92d71afe003a6560ebe268b670b9ca58b5adb397830b6538d722a31771d5b2ad1ec015f154c7739870821257cc7 diff --git a/app-misc/gramps/files/gramps-5.1.6-pep517_setup.patch b/app-misc/gramps/files/gramps-5.1.6-pep517_setup.patch new file mode 100644 index 000000000000..7853b23ba1b8 --- /dev/null +++ b/app-misc/gramps/files/gramps-5.1.6-pep517_setup.patch @@ -0,0 +1,163 @@ +--- a/setup.py ++++ b/setup.py +@@ -23,7 +23,7 @@ + # + + ''' +-Gramps distutils module. ++Gramps setuptools module. + ''' + + #check python version first +@@ -32,11 +32,11 @@ + if sys.version_info < (3, 2): + raise SystemExit("Gramps requires Python 3.2 or later.") + +-from distutils import log +-from distutils.core import setup, Command +-from distutils.util import convert_path, newer +-from distutils.command.build import build as _build +-from distutils.command.install import install as _install ++from setuptools import setup, Command ++try: ++ from setuptools.command.build import build as _build ++except ImportError: ++ from distutils.command.build import build as _build + import os + import glob + import codecs +@@ -45,6 +45,9 @@ + from gramps.version import VERSION + import unittest + import argparse ++import logging ++ ++_LOG = logging.getLogger(".setup") + + # this list MUST be a subset of _LOCALE_NAMES in gen/utils/grampslocale.py + # (that is, if you add a new language here, be sure it's in _LOCALE_NAMES too) +@@ -75,6 +78,17 @@ + packaging = True + sys.argv = [sys.argv[0]] + passthrough + ++def newer(source, target): ++ ''' ++ Determines if a target file needs to be rebuilt. ++ ++ Returns True if the target file doesn't exist or if the source file is ++ newer than the target file. ++ ''' ++ if not os.path.exists(target): ++ return True ++ return os.path.getmtime(source) > os.path.getmtime(target) ++ + def intltool_version(): + ''' + Return the version of intltool as a tuple. +@@ -140,7 +154,7 @@ + reply = input(ask) + if reply in ['n', 'N']: + raise SystemExit(msg) +- log.info('Compiling %s >> %s', po_file, mo_file) ++ _LOG.info('Compiling %s >> %s', po_file, mo_file) + + #linux specific piece: + target = 'share/locale/' + lang + '/LC_MESSAGES' +@@ -179,7 +193,7 @@ + with open(newfile, 'rb') as f_in,\ + gzip.open(man_file_gz, 'wb') as f_out: + f_out.writelines(f_in) +- log.info('Compiling %s >> %s', filename, man_file_gz) ++ _LOG.info('Compiling %s >> %s', filename, man_file_gz) + + os.remove(newfile) + filename = False +@@ -193,30 +207,26 @@ + ''' + Merge translation files into desktop and mime files + ''' +- for filename in _FILES: +- filename = convert_path(filename) +- strip_files(filename + '.in', filename, ['_tip', '_name']) +- + i_v = intltool_version() + if i_v is None or i_v < (0, 25, 0): +- log.info('No intltool or version < 0.25.0, build_intl is aborting') ++ _LOG.info('No intltool or version < 0.25.0, build_intl is aborting') + return + data_files = build_cmd.distribution.data_files + base = build_cmd.build_base + +- merge_files = (('data/gramps.desktop', 'share/applications', '-d'), +- ('data/gramps.keys', 'share/mime-info', '-k'), +- ('data/gramps.xml', 'share/mime/packages', '-x'), +- ('data/gramps.appdata.xml', 'share/metainfo', '-x')) ++ merge_files = (('gramps.desktop', 'share/applications', '-d'), ++ ('gramps.keys', 'share/mime-info', '-k'), ++ ('gramps.xml', 'share/mime/packages', '-x'), ++ ('gramps.appdata.xml', 'share/metainfo', '-x')) + + for filename, target, option in merge_files: +- filenamelocal = convert_path(filename) ++ filenamelocal = os.path.join('data', filename) + newfile = os.path.join(base, filenamelocal) + newdir = os.path.dirname(newfile) + if not(os.path.isdir(newdir) or os.path.islink(newdir)): + os.makedirs(newdir) + merge(filenamelocal + '.in', newfile, option) +- data_files.append((target, [base + '/' + filename])) ++ data_files.append((target, [base + '/data/' + filename])) + + def strip_files(in_file, out_file, mark): + ''' +@@ -232,7 +242,7 @@ + line = line.replace(marker, marker[1:]) + fb.write(line) + old.close() +- log.info('Compiling %s >> %s', in_file, out_file) ++ _LOG.info('Compiling %s >> %s', in_file, out_file) + + def merge(in_file, out_file, option, po_dir='po', cache=True): + ''' +@@ -262,7 +272,7 @@ + msg = ('ERROR: %s was not merged into the translation files!\n' % + out_file) + raise SystemExit(msg) +- log.info('Compiling %s >> %s', in_file, out_file) ++ _LOG.info('Compiling %s >> %s', in_file, out_file) + + class build(_build): + """Custom build command.""" +@@ -273,22 +283,6 @@ + build_intl(self) + _build.run(self) + +-class install(_install): +- """Custom install command.""" +- def run(self): +- resource_file = os.path.join(os.path.dirname(__file__), 'gramps', 'gen', +- 'utils', 'resource-path') +- with open(resource_file, 'w', encoding='utf-8', errors='strict') as fp: +- if packaging: +- path = resource_path +- else: +- path = os.path.abspath(os.path.join(self.install_data, 'share')) +- fp.write(path) +- +- _install.run(self) +- +- os.remove(resource_file) +- + class test(Command): + """Command to run Gramps unit tests""" + description = "run all unit tests" +@@ -503,7 +497,7 @@ + url = 'http://gramps-project.org', + license = 'GPL v2 or greater', + platforms = ['FreeBSD', 'Linux', 'MacOS', 'Windows'], +- cmdclass = {'build': build, 'install': install, 'test': test}, ++ cmdclass = {'build': build, 'test': test}, + packages = packages, + package_data = {'gramps': package_data}, + data_files = data_files, +Binary files a/.setup.py.swp and b/.setup.py.swp differ diff --git a/app-misc/gramps/gramps-5.1.6-r2.ebuild b/app-misc/gramps/gramps-5.1.6-r2.ebuild new file mode 100644 index 000000000000..21e33b40891f --- /dev/null +++ b/app-misc/gramps/gramps-5.1.6-r2.ebuild @@ -0,0 +1,82 @@ +# Copyright 2001-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_SINGLE_IMPL=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..11} ) +PYTHON_REQ_USE="sqlite" + +inherit distutils-r1 xdg-utils + +DESCRIPTION="Community genealogy program aiming to be both intuitive and feature-complete" +HOMEPAGE="https://gramps-project.org/" +SRC_URI="https://github.com/gramps-project/${PN}/archive/v${PV}.tar.gz + -> ${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="exif geo postscript +rcs +reports spell test" + +# Many tests fail unless the deprecated BerkeleyDB back-end is enabled. +RESTRICT="test" + +RDEPEND=" + $(python_gen_cond_dep ' + dev-python/pycairo[${PYTHON_USEDEP}] + >=dev-python/pygobject-3.12:3[cairo,${PYTHON_USEDEP}] + dev-python/pyicu[${PYTHON_USEDEP}] + exif? ( >=media-libs/gexiv2-0.5[${PYTHON_USEDEP},introspection] ) + ') + gnome-base/librsvg:2 + >x11-libs/gtk+-3.14.8:3[introspection] + x11-libs/pango[introspection] + x11-misc/xdg-utils + geo? ( >=sci-geosciences/osm-gps-map-1.1.0 ) + spell? ( app-text/gtkspell:3[introspection] ) + rcs? ( dev-vcs/rcs ) + reports? ( media-gfx/graphviz[postscript?] ) +" +BDEPEND="test? ( + $(python_gen_cond_dep ' + dev-python/jsonschema[${PYTHON_USEDEP}] + dev-python/lxml[${PYTHON_USEDEP}] + ') +)" + +PATCHES=( + "${FILESDIR}"/${PN}-5.1.3-test_locale.patch + "${FILESDIR}"/${PN}-5.1.6-pep517_setup.patch +) + +DISTUTILS_ARGS="--no-compress-manpages" + +distutils_enable_tests pytest + +src_prepare() { + # Install documentation to the proper location. This can't be done + # easily with a patch because we substitute in the ${PF} variable, + # and that changes with every revision. + sed -i -e "s:share/doc/gramps:share/doc/${PF}:g" setup.py || die + + # The final part of PEP-517 support, handled with sed in order to avoid + # making the patch file too large + sed -e "s:_name:name:g" data/holidays.xml.in > data/holidays.xml || die + sed -e "s:_tip:tip:g" data/tips.xml.in > data/tips.xml || die + + default +} + +pkg_postinst() { + xdg_desktop_database_update + xdg_icon_cache_update + xdg_mimeinfo_database_update +} + +pkg_postrm() { + xdg_desktop_database_update + xdg_icon_cache_update + xdg_mimeinfo_database_update +} -- cgit v1.2.3