Skip to content

Commit

Permalink
Merge pull request #898 from T-Dynamos/add-mcp
Browse files Browse the repository at this point in the history
recipes: add new `materialyoucolor` recipe
  • Loading branch information
AndreMiras committed Mar 17, 2024
2 parents b515a04 + 12f4a25 commit bc58062
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
17 changes: 17 additions & 0 deletions kivy_ios/recipes/materialyoucolor/__init__.py
@@ -0,0 +1,17 @@
from kivy_ios.toolchain import PythonRecipe


class MaterialYouColorRecipe(PythonRecipe):
version = "2.0.7"
url = "https://github.com/T-Dynamos/materialyoucolor-pyhton/archive/refs/tags/v{version}.tar.gz"
depends = ["hostpython3", "python3"]
hostpython_prerequisites = ["certifi"]

def prebuild_platform(self, plat):
if self.has_marker("patched"):
return
self.apply_patch("fix_cert.patch")
self.set_marker("patched")


recipe = MaterialYouColorRecipe()
22 changes: 22 additions & 0 deletions kivy_ios/recipes/materialyoucolor/fix_cert.patch
@@ -0,0 +1,22 @@
--- materialyoucolor-pyhton/setup.py 2024-03-16 20:29:35.548962347 +0530
+++ materialyoucolor-pyhton.patched/setup.py 2024-03-16 20:31:14.222400319 +0530
@@ -50,6 +50,8 @@
from functools import lru_cache
from pathlib import Path
import urllib.request
+import ssl
+import certifi
from glob import glob
from setuptools import find_packages, setup
from typing import (
@@ -537,7 +539,9 @@
print("Downloading required files...")
for file in FILES:
with open(os.path.join(FOLDER, os.path.basename(file)), "w") as write_buffer:
- write_buffer.write(urllib.request.urlopen(URL + file).read().decode("utf-8"))
+ write_buffer.write(urllib.request.urlopen(
+ URL + file, context=ssl.create_default_context(cafile=certifi.where())
+ ).read().decode("utf-8"))
write_buffer.close()
print("[Downloaded] : " + file)

0 comments on commit bc58062

Please sign in to comment.