|
12 | 12 | # noinspection PyUnresolvedReferences
|
13 | 13 | class EmbeddedPython(ConanFile):
|
14 | 14 | name = "embedded_python"
|
15 |
| - version = "1.5.2" # of the Conan package, `options.version` is the Python version |
| 15 | + version = "1.5.3" # of the Conan package, `options.version` is the Python version |
16 | 16 | license = "PSFL"
|
17 | 17 | description = "Embedded distribution of Python"
|
18 | 18 | topics = "embedded", "python"
|
@@ -153,18 +153,14 @@ def _gather_packages(self):
|
153 | 153 | with open("packages.txt", "w") as output:
|
154 | 154 | output.write("\n".join(package_names))
|
155 | 155 |
|
156 |
| - def source(self): |
157 |
| - replace_in_file(self, "embedded_python.cmake", "${self.pyversion}", str(self.pyversion)) |
158 |
| - |
159 |
| - if self.settings.os != "Windows": |
160 |
| - UnixLikeBuildHelper.get_source(self) |
161 |
| - |
162 | 156 | def generate(self):
|
163 | 157 | prefix = pathlib.Path(self.build_folder) / "embedded_python"
|
| 158 | + replace_in_file(self, "embedded_python.cmake", "${self.pyversion}", str(self.pyversion)) |
164 | 159 | if self.settings.os == "Windows":
|
165 | 160 | self.build_helper = WindowsBuildHelper(self, prefix)
|
166 | 161 | else:
|
167 | 162 | self.build_helper = UnixLikeBuildHelper(self, prefix)
|
| 163 | + self.build_helper.get_source() |
168 | 164 | self.build_helper.generate()
|
169 | 165 |
|
170 | 166 | def build(self):
|
@@ -273,17 +269,16 @@ def __init__(self, conanfile, prefix):
|
273 | 269 | self.conanfile = conanfile
|
274 | 270 | self.prefix = prefix
|
275 | 271 |
|
276 |
| - @staticmethod |
277 |
| - def get_source(conanfile): |
278 |
| - url = f"https://github.com/python/cpython/archive/v{conanfile.pyversion}.tar.gz" |
279 |
| - get(conanfile, url, strip_root=True) |
| 272 | + def get_source(self): |
| 273 | + url = f"https://github.com/python/cpython/archive/v{self.conanfile.pyversion}.tar.gz" |
| 274 | + get(self.conanfile, url, strip_root=True) |
280 | 275 |
|
281 | 276 | # Patch a build issue with clang 13: https://bugs.python.org/issue45405. We simply apply
|
282 | 277 | # the patch for all clang versions since the flag never did anything on clang/apple-clang anyway.
|
283 |
| - compiler = conanfile.settings.compiler |
284 |
| - if "clang" in str(compiler) and Version(conanfile.pyversion) < "3.9.8": |
| 278 | + compiler = self.conanfile.settings.compiler |
| 279 | + if "clang" in str(compiler) and Version(self.conanfile.pyversion) < "3.9.8": |
285 | 280 | replace_in_file(
|
286 |
| - conanfile, |
| 281 | + self.conanfile, |
287 | 282 | "configure",
|
288 | 283 | "MULTIARCH=$($CC --print-multiarch 2>/dev/null)",
|
289 | 284 | "MULTIARCH=''",
|
|
0 commit comments