aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Marc-Antoine Perennou <keruspe@exherbo.org> 2019-11-07 09:57:25 +0100
committerAvatar Marc-Antoine Perennou <keruspe@exherbo.org> 2019-11-07 10:02:29 +0100
commit3dabaed66b19e2487bb470c8ea2234b193bcde12 (patch)
tree1f63059ddeea866fd194de83654c5d3f3b7e5600
parentf3f57b41eabcb77d328a4ffb313ed2b3ae35f4a4 (diff)
downloadkeruspe-3dabaed66b19e2487bb470c8ea2234b193bcde12.tar.gz
keruspe-3dabaed66b19e2487bb470c8ea2234b193bcde12.tar.xz
meld: fix build with python 3.8
Signed-off-by: Marc-Antoine Perennou <keruspe@exherbo.org>
-rw-r--r--packages/dev-util/meld/files/9cb590f9804a89d8914d0d7d6c89c336f6d86d86.patch67
-rw-r--r--packages/dev-util/meld/meld-3.20.1.exheres-04
2 files changed, 71 insertions, 0 deletions
diff --git a/packages/dev-util/meld/files/9cb590f9804a89d8914d0d7d6c89c336f6d86d86.patch b/packages/dev-util/meld/files/9cb590f9804a89d8914d0d7d6c89c336f6d86d86.patch
new file mode 100644
index 0000000..7c3209c
--- /dev/null
+++ b/packages/dev-util/meld/files/9cb590f9804a89d8914d0d7d6c89c336f6d86d86.patch
@@ -0,0 +1,67 @@
+Upstream: yes
+From 9cb590f9804a89d8914d0d7d6c89c336f6d86d86 Mon Sep 17 00:00:00 2001
+From: Kai Willadsen <kai.willadsen@gmail.com>
+Date: Mon, 6 May 2019 08:15:23 +1000
+Subject: [PATCH] Update build helpers for Python 3.8 compatibility (#322)
+
+The `linux_distribution` helper for the platform module has been removed
+in Python 3.8, so we need an additional helper to check for the Debian-
+style packaging layout.
+
+Really this should be an `install_requires`, but moving our build
+helpers to `setuptools` is a not-insignificant risk that I'd rather not
+take when we're looking at moving to Meson.
+---
+ meld/build_helpers.py | 29 ++++++++++++++++++++++++-----
+ 2 files changed, 30 insertions(+), 5 deletions(-)
+
+diff --git a/meld/build_helpers.py b/meld/build_helpers.py
+index 5977b3cd..f9fb302b 100644
+--- a/meld/build_helpers.py
++++ b/meld/build_helpers.py
+@@ -31,6 +31,15 @@ import platform
+ import sys
+ from distutils.log import info
+
++try:
++ import distro
++except ImportError:
++ python_version = tuple(int(x) for x in platform.python_version_tuple())
++ if python_version >= (3, 8):
++ print(
++ 'Missing build requirement "distro" Python module; '
++ 'install paths may be incorrect', file=sys.stderr)
++
+
+ def has_help(self):
+ return "build_help" in self.distribution.cmdclass and os.name != 'nt'
+@@ -404,11 +413,21 @@ class install(distutils.command.install.install):
+
+ def finalize_options(self):
+ special_cases = ('debian', 'ubuntu', 'linuxmint')
+- if (platform.system() == 'Linux' and
+- platform.linux_distribution()[0].lower() in special_cases):
+- # Maintain an explicit install-layout, but use deb by default
+- specified_layout = getattr(self, 'install_layout', None)
+- self.install_layout = specified_layout or 'deb'
++ if platform.system() == 'Linux':
++ # linux_distribution has been removed in Python 3.8; we require
++ # the third-party distro package for future handling.
++ try:
++ distribution = platform.linux_distribution()[0].lower()
++ except AttributeError:
++ try:
++ distribution = distro.id()
++ except NameError:
++ distribution = 'unknown'
++
++ if distribution in special_cases:
++ # Maintain an explicit install-layout, but use deb by default
++ specified_layout = getattr(self, 'install_layout', None)
++ self.install_layout = specified_layout or 'deb'
+
+ distutils.command.install.install.finalize_options(self)
+
+--
+2.22.0
+
diff --git a/packages/dev-util/meld/meld-3.20.1.exheres-0 b/packages/dev-util/meld/meld-3.20.1.exheres-0
index 740e566..285dc6b 100644
--- a/packages/dev-util/meld/meld-3.20.1.exheres-0
+++ b/packages/dev-util/meld/meld-3.20.1.exheres-0
@@ -25,6 +25,10 @@ RESTRICT="test"
SETUP_PY_PARAMS=( --no-update-icon-cache --no-compile-schemas )
+DEFAULT_SRC_PREPARE_PATCHES=(
+ "${FILES}"/9cb590f9804a89d8914d0d7d6c89c336f6d86d86.patch
+)
+
DEPENDENCIES="
build:
dev-util/itstool