File: Revert-Do-not-use-distutils-to-get-Python-library-path.patch

package info (click to toggle)
libbytesize 2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 760 kB
  • sloc: python: 1,874; ansic: 990; sh: 665; makefile: 262
file content (23 lines) | stat: -rw-r--r-- 969 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: Michael Biebl <biebl@debian.org>
Date: Fri, 2 Sep 2022 12:32:41 +0200
Subject: Revert "Do not use distutils to get Python library path"

Otherwise the library path is not set properly with Python 3.10 on Debian.

See https://github.com/storaged-project/libbytesize/issues/111
This reverts commit 1dc78ff4171098ee76aa9650f37c9ae63a1fe0fe.
---
 src/python/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/python/Makefile.am b/src/python/Makefile.am
index 4fb4845..cb2b197 100644
--- a/src/python/Makefile.am
+++ b/src/python/Makefile.am
@@ -1,5 +1,5 @@
 if WITH_PYTHON3
-py3libdir = $(shell python3 -c "import sysconfig; print(sysconfig.get_path('platlib', vars={'platbase': '${exec_prefix}'}))")
+py3libdir = $(shell python3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(1,0,prefix='${exec_prefix}'))")
 py3bytesizedir    = $(py3libdir)/bytesize
 dist_py3bytesize_DATA = bytesize.py __init__.py
 endif