| 1 | From: Tobias Geerinckx-Rice <[email protected]>
|
| 2 | Date: Wed, 19 Aug 2020 22:58:32 +0200
|
| 3 | Subject: [PATCH] gnu: unknown-horizons: Replace ‘dist’ with ‘distro’.
|
| 4 |
|
| 5 | This fixes builds with Python >= 3.8. Taken verbatim from upstream[0].
|
| 6 |
|
| 7 | [0]: https://github.com/unknown-horizons/unknown-horizons/commit/c40fb866f3f72ac1049d6fa7859b17d8a48fe9e1
|
| 8 |
|
| 9 | From c40fb866f3f72ac1049d6fa7859b17d8a48fe9e1 Mon Sep 17 00:00:00 2001
|
| 10 | From: MarkusHackspacher <[email protected]>
|
| 11 | Date: Thu, 18 Jul 2019 11:46:39 +0200
|
| 12 | Subject: [PATCH] replace deprecated to distro package
|
| 13 |
|
| 14 | ---
|
| 15 | requirements.txt | 1 +
|
| 16 | setup.py | 4 +++-
|
| 17 | 2 files changed, 4 insertions(+), 1 deletion(-)
|
| 18 |
|
| 19 | diff --git a/requirements.txt b/requirements.txt
|
| 20 | index a5edf794fb..b58179bfa8 100644
|
| 21 | |
| 22 | |
| 23 | @@ -1,6 +1,7 @@
|
| 24 | coverage==4.4.1
|
| 25 | coveralls==1.1
|
| 26 | crayons==0.1.2
|
| 27 | +distro
|
| 28 | future==0.16.0
|
| 29 | greenlet==0.4.15
|
| 30 | isort==4.3.4
|
| 31 | diff --git a/setup.py b/setup.py
|
| 32 | index 6d63a5ce15..6a237a8749 100755
|
| 33 | |
| 34 | |
| 35 | @@ -32,6 +32,8 @@
|
| 36 | from distutils.spawn import find_executable
|
| 37 | from shutil import copytree, rmtree
|
| 38 |
|
| 39 | +import distro
|
| 40 | +
|
| 41 | import horizons
|
| 42 | from horizons.constants import VERSION
|
| 43 | from horizons.ext import polib
|
| 44 | @@ -39,7 +41,7 @@
|
| 45 | # Ensure we are in the correct directory
|
| 46 | os.chdir(os.path.realpath(os.path.dirname(__file__)))
|
| 47 |
|
| 48 | -if platform.dist()[0].lower() in ('debian', 'ubuntu'):
|
| 49 | +if distro.linux_distribution(full_distribution_name=False)[0] in ('debian', 'mint', 'ubuntu'):
|
| 50 | executable_path = 'games'
|
| 51 | else:
|
| 52 | executable_path = 'bin'
|