[packages/meld] upstream patch to fix build with python 3.8; rel 3
atler
atler at pld-linux.org
Wed Oct 30 17:14:14 CET 2019
commit 36a7b1ffc1fbef9eef9e561bcc86822c53896c2b
Author: Jan Palus <atler at pld-linux.org>
Date: Wed Oct 30 17:13:26 2019 +0100
upstream patch to fix build with python 3.8; rel 3
meld.spec | 4 +++-
python3.8.patch | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 70 insertions(+), 1 deletion(-)
---
diff --git a/meld.spec b/meld.spec
index e95c0cd..25d74a6 100644
--- a/meld.spec
+++ b/meld.spec
@@ -2,12 +2,13 @@ Summary: Visual diff and merge tool
Summary(pl.UTF-8): Wizualne narzędzie do oglądania i włączania zmian (diff)
Name: meld
Version: 3.20.1
-Release: 2
+Release: 3
License: GPL
Group: Applications/Text
Source0: http://ftp.gnome.org/pub/GNOME/sources/meld/3.20/%{name}-%{version}.tar.xz
# Source0-md5: 0a2419d75fc8f8677fa6b4ce31ca8adc
Patch0: %{name}-desktop.patch
+Patch1: python3.8.patch
URL: http://meld.sourceforge.net/
BuildRequires: intltool
BuildRequires: itstool
@@ -54,6 +55,7 @@ zakładkami, pozwalający na otwieranie wielu plików diff naraz.
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
%build
diff --git a/python3.8.patch b/python3.8.patch
new file mode 100644
index 0000000..98c0f4b
--- /dev/null
+++ b/python3.8.patch
@@ -0,0 +1,67 @@
+From 7862ee014ecb85b2a7fe409f8b147b1ddb6e657e Mon Sep 17 00:00:00 2001
+From: Kai Willadsen <kai.willadsen at 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.
+---
+ README.md | 6 ++++++
+ 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 9c2078e4..fa1602f3 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'
+@@ -378,11 +387,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
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/meld.git/commitdiff/36a7b1ffc1fbef9eef9e561bcc86822c53896c2b
More information about the pld-cvs-commit
mailing list