Skip to content

Commit

Permalink
recipes: add new materialyoucolor recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Dynamos committed Mar 16, 2024
1 parent b515a04 commit e140af5
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
Original file line number Diff line number Diff line change
@@ -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"]

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
Original file line number Diff line number Diff line change
@@ -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 e140af5

Please sign in to comment.