Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pycairo/, dev-python/pycairo/files/
Date: Sat, 03 Nov 2018 10:15:22
Message-Id: 1541240097.4ac4e2c322c93dec2d94fd0c99db4b6217743d41.mgorny@gentoo
1 commit: 4ac4e2c322c93dec2d94fd0c99db4b6217743d41
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 3 10:12:15 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 3 10:14:57 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ac4e2c3
7
8 dev-python/pycairo: Fix pkg-config install path
9
10 Bug: https://bugs.gentoo.org/664802
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 .../files/pycairo-1.17.0-pkgconfigdir.patch | 71 ++++++++++++++++++++++
14 ...airo-1.17.0.ebuild => pycairo-1.17.0-r1.ebuild} | 9 +++
15 2 files changed, 80 insertions(+)
16
17 diff --git a/dev-python/pycairo/files/pycairo-1.17.0-pkgconfigdir.patch b/dev-python/pycairo/files/pycairo-1.17.0-pkgconfigdir.patch
18 new file mode 100644
19 index 00000000000..d4d75a172d6
20 --- /dev/null
21 +++ b/dev-python/pycairo/files/pycairo-1.17.0-pkgconfigdir.patch
22 @@ -0,0 +1,71 @@
23 +From 430c6ffb65cd839be5ba6266a89f645afa8f9442 Mon Sep 17 00:00:00 2001
24 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
25 +Date: Sun, 14 Oct 2018 12:30:56 +0200
26 +Subject: [PATCH] setup.py: Support specifying custom --pkgconfigdir
27 +
28 +Support overriding --pkgconfigdir for whenever the autodetection
29 +gives incorrect result (e.g. PyPy). Fixes #119.
30 +---
31 + setup.py | 21 ++++++++++++++++++---
32 + 1 file changed, 18 insertions(+), 3 deletions(-)
33 +
34 +diff --git a/setup.py b/setup.py
35 +index 36641d9..75c8888 100755
36 +--- a/setup.py
37 ++++ b/setup.py
38 +@@ -14,6 +14,7 @@ except ImportError:
39 + from distutils.core import Extension, Command, Distribution
40 + from distutils.ccompiler import new_compiler
41 + from distutils.sysconfig import customize_compiler
42 ++from distutils.util import change_root
43 + from distutils import log
44 + from distutils import sysconfig
45 +
46 +@@ -265,11 +266,15 @@ class test_cmd(Command):
47 +
48 + class install_pkgconfig(Command):
49 + description = "install .pc file"
50 +- user_options = []
51 ++ user_options = [
52 ++ ('pkgconfigdir=', None, 'pkg-config file install directory'),
53 ++ ]
54 +
55 + def initialize_options(self):
56 ++ self.root = None
57 + self.install_base = None
58 + self.install_data = None
59 ++ self.pkgconfigdir = None
60 + self.compiler_type = None
61 + self.outfiles = []
62 +
63 +@@ -280,6 +285,11 @@ class install_pkgconfig(Command):
64 + ('install_data', 'install_data'),
65 + )
66 +
67 ++ self.set_undefined_options(
68 ++ 'install',
69 ++ ('root', 'root'),
70 ++ )
71 ++
72 + self.set_undefined_options(
73 + 'build_ext',
74 + ('compiler_type', 'compiler_type'),
75 +@@ -315,8 +325,13 @@ class install_pkgconfig(Command):
76 + "Skipping install_pkgconfig, not supported with MSVC")
77 + return
78 +
79 +- python_lib = sysconfig.get_python_lib(True, True, self.install_data)
80 +- pkgconfig_dir = os.path.join(os.path.dirname(python_lib), 'pkgconfig')
81 ++ if self.pkgconfigdir is None:
82 ++ python_lib = sysconfig.get_python_lib(True, True,
83 ++ self.install_data)
84 ++ pkgconfig_dir = os.path.join(os.path.dirname(python_lib),
85 ++ 'pkgconfig')
86 ++ else:
87 ++ pkgconfig_dir = change_root(self.root, self.pkgconfigdir)
88 + self.mkpath(pkgconfig_dir)
89 +
90 + pcname = "py3cairo.pc" if sys.version_info[0] == 3 else "pycairo.pc"
91 +--
92 +2.19.1
93 +
94
95 diff --git a/dev-python/pycairo/pycairo-1.17.0.ebuild b/dev-python/pycairo/pycairo-1.17.0-r1.ebuild
96 similarity index 85%
97 rename from dev-python/pycairo/pycairo-1.17.0.ebuild
98 rename to dev-python/pycairo/pycairo-1.17.0-r1.ebuild
99 index 65751904ec1..44271087768 100644
100 --- a/dev-python/pycairo/pycairo-1.17.0.ebuild
101 +++ b/dev-python/pycairo/pycairo-1.17.0-r1.ebuild
102 @@ -28,6 +28,10 @@ DEPEND="${RDEPEND}
103 )
104 "
105
106 +PATCHES=(
107 + "${FILESDIR}"/pycairo-1.17.0-pkgconfigdir.patch
108 +)
109 +
110 python_compile_all() {
111 use doc && emake -C docs
112 }
113 @@ -36,6 +40,11 @@ python_test() {
114 esetup.py test
115 }
116
117 +python_install() {
118 + distutils-r1_python_install \
119 + install_pkgconfig --pkgconfigdir="/usr/$(get_libdir)/pkgconfig"
120 +}
121 +
122 python_install_all() {
123 use doc && local HTML_DOCS=( docs/_build/. )