Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
|
06bb62ccda |
315 changed files with 25789 additions and 5719 deletions
|
@ -1,4 +0,0 @@
|
|||
BROKEN_RECIPES = set()
|
||||
|
||||
# recipes that were already built will be skipped
|
||||
CORE_RECIPES = set(["kivy", "hostpython3", "python3"])
|
|
@ -1,48 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
"""
|
||||
Continuous Integration helper script.
|
||||
Automatically detects recipes modified in a changeset (compares with master)
|
||||
and recompiles them.
|
||||
|
||||
Current limitations:
|
||||
- will fail on conflicting requirements
|
||||
"""
|
||||
import sh
|
||||
import subprocess
|
||||
from fnmatch import fnmatch
|
||||
from constants import CORE_RECIPES, BROKEN_RECIPES
|
||||
|
||||
|
||||
def modified_recipes(branch="origin/master"):
|
||||
"""
|
||||
Returns a set of modified recipes between the current branch and the one
|
||||
in param.
|
||||
"""
|
||||
# using the contrib version on purpose rather than sh.git, since it comes
|
||||
# with a bunch of fixes, e.g. disabled TTY, see:
|
||||
# https://stackoverflow.com/a/20128598/185510
|
||||
sh.contrib.git.fetch("origin", "master")
|
||||
git_diff = sh.contrib.git.diff("--name-only", branch)
|
||||
recipes = set()
|
||||
for file_path in git_diff:
|
||||
if fnmatch(file_path, "kivy_ios/recipes/*/__init__.py\n"):
|
||||
recipe = file_path.split("/")[2]
|
||||
recipes.add(recipe)
|
||||
return recipes
|
||||
|
||||
|
||||
def main():
|
||||
recipes = modified_recipes()
|
||||
recipes -= CORE_RECIPES
|
||||
recipes -= BROKEN_RECIPES
|
||||
updated_recipes = " ".join(recipes)
|
||||
if updated_recipes != "":
|
||||
subprocess.run(
|
||||
f"python3 toolchain.py build {updated_recipes}", shell=True, check=True
|
||||
)
|
||||
else:
|
||||
print("Nothing to do. No updated recipes.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -1,11 +0,0 @@
|
|||
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
python3 toolchain.py create Touchtracer kivy-ci-clone/examples/demo/touchtracer
|
||||
|
||||
xcodebuild -project touchtracer-ios/touchtracer.xcodeproj \
|
||||
-scheme touchtracer \
|
||||
-destination generic/platform=iOS\
|
||||
clean build CODE_SIGNING_ALLOWED=NO | xcpretty
|
51
.github/ISSUE_TEMPLATE/bug_report.md
vendored
51
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
@ -1,51 +0,0 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
The issue tracker is a tool to address bugs.
|
||||
Please use the Discord community or Stack Overflow for support questions,
|
||||
more information at https://github.com/kivy/kivy-ios#support
|
||||
|
||||
Before opening a new issue, make sure you do the following:
|
||||
* check that your issue isn't already filed: https://github.com/kivy/kivy-ios/issues
|
||||
* prepare a short, runnable example that reproduces the issue
|
||||
* reproduce the problem with the latest development version (`master`)
|
||||
* double-check that the issue is indeed a bug and not a support request
|
||||
* please use backticks to format code or logs
|
||||
-->
|
||||
|
||||
**Versions**
|
||||
|
||||
* Python :
|
||||
* MacOS version :
|
||||
* XCode Version :
|
||||
* Cython version :
|
||||
|
||||
**Describe the bug**
|
||||
// REPLACE ME: A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
// REPLACE ME: Add your `toolchain.py ....` command or a complete explanation of what you did so We can reproduce your error.
|
||||
|
||||
**Expected behavior**
|
||||
// REPLACE ME: A clear and concise description of what you expected to happen.
|
||||
|
||||
**Logs**
|
||||
```
|
||||
// REPLACE ME: Paste the build output containing the error
|
||||
```
|
||||
|
||||
**Screenshots**
|
||||
<!--
|
||||
ONLY for XCode related errors, use the LOGS section for toolchain.py related problems!
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
-->
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
100
.github/workflows/kivy_ios.yml
vendored
100
.github/workflows/kivy_ios.yml
vendored
|
@ -1,100 +0,0 @@
|
|||
name: kivy-ios
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
flake8:
|
||||
name: Flake8 tests
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout kivy-ios
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python 3.7
|
||||
uses: actions/setup-python@v1.1.0
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: Run flake8
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install tox>=2.0
|
||||
tox -e pep8
|
||||
|
||||
build_python3_kivy:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout kivy-ios
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python 3.7.x
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.7.x
|
||||
- name: Install requirements
|
||||
run: |
|
||||
pip3 install -r requirements.txt
|
||||
brew install autoconf automake libtool pkg-config
|
||||
brew link libtool
|
||||
pip3 install Cython==0.29.17
|
||||
gem install xcpretty
|
||||
- name: Build Python & Kivy
|
||||
run: |
|
||||
python toolchain.py build python3 kivy
|
||||
- name: Checkout kivy for tests apps
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: kivy/kivy
|
||||
path: kivy-ci-clone
|
||||
- name: Create & Build test project
|
||||
run: |
|
||||
.ci/test_project.sh
|
||||
|
||||
build_python3_kivy_venv:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout kivy-ios
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python 3.7.x
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.7.x
|
||||
- name: Install requirements
|
||||
run: |
|
||||
python -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
pip install sh
|
||||
brew install autoconf automake libtool pkg-config
|
||||
brew link libtool
|
||||
pip install Cython==0.29.17
|
||||
- name: Build Python & Kivy
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
python toolchain.py build python3 kivy
|
||||
- name: Checkout kivy for tests apps
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: kivy/kivy
|
||||
path: kivy-ci-clone
|
||||
- name: Create & Build test project
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
.ci/test_project.sh
|
||||
|
||||
build_updated_recipes:
|
||||
needs: flake8
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout kivy-ios
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python 3.7.x
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: 3.7.x
|
||||
- name: Install requirements
|
||||
run: |
|
||||
pip3 install -r requirements.txt
|
||||
brew install autoconf automake libtool pkg-config
|
||||
brew link libtool
|
||||
pip3 install Cython==0.29.17
|
||||
- name: Build updated recipes
|
||||
run: |
|
||||
python3 .ci/rebuild_updated_recipes.py
|
25
.github/workflows/pypi-release.yml
vendored
25
.github/workflows/pypi-release.yml
vendored
|
@ -1,25 +0,0 @@
|
|||
name: PyPI release
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
pypi_release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade setuptools wheel twine
|
||||
- name: Build
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
twine check dist/*
|
||||
- name: Publish package
|
||||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
|
||||
uses: pypa/gh-action-pypi-publish@v1.1.0
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.pypi_password }}
|
35
.github/workflows/setup.yml
vendored
35
.github/workflows/setup.yml
vendored
|
@ -1,35 +0,0 @@
|
|||
name: setup
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
checks:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout kivy-ios
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Python 3.7
|
||||
uses: actions/setup-python@v1.1.0
|
||||
with:
|
||||
python-version: 3.7
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade setuptools wheel twine
|
||||
- name: sdist bdist_wheel
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
- name: Twine check
|
||||
run: |
|
||||
twine check dist/*
|
||||
- name: Local install
|
||||
run: |
|
||||
python -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install dist/kivy-ios-*.tar.gz
|
||||
pip install Cython==0.29.17
|
||||
brew install autoconf automake libtool pkg-config
|
||||
- name: Basic toolchain commands
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
toolchain --help
|
||||
toolchain recipes
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -19,5 +19,3 @@ src/ios/ios.c
|
|||
*.DS_Store*
|
||||
*-ios/
|
||||
__pycache__
|
||||
.tox
|
||||
venv
|
||||
|
|
48
CHANGELOG.md
48
CHANGELOG.md
|
@ -1,48 +0,0 @@
|
|||
# Changelog
|
||||
|
||||
## [1.1.2] - 2020-05-11
|
||||
### Fixed
|
||||
- Fixes (venv build) reference to SDL\_main.h [\#493](https://github.com/kivy/kivy-ios/issues/493) ([AndreMiras](https://github.com/AndreMiras))
|
||||
|
||||
## [1.1.1] - 2020-05-11
|
||||
### Added
|
||||
- Add python depends [\#455](https://github.com/kivy/kivy-ios/issues/455) ([misl6](https://github.com/misl6))
|
||||
|
||||
### Removed
|
||||
- Removed Python 2 support [\#482](https://github.com/kivy/kivy-ios/issues/482) ([AndreMiras](https://github.com/AndreMiras))
|
||||
|
||||
### Fixed
|
||||
- Adds initial\_working\_directory [\#489](https://github.com/kivy/kivy-ios/issues/489) ([misl6](https://github.com/misl6))
|
||||
- Adds netifaces recipe, closes #239 [\#488](https://github.com/kivy/kivy-ios/issues/488) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Uses contextlib.suppress to ignore exceptions [\#487](https://github.com/kivy/kivy-ios/issues/487) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- DRY via the find\_xcodeproj() helper method [\#486](https://github.com/kivy/kivy-ios/issues/486) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Uses cd context manager in Python3Recipe.reduce\_python() [\#485](https://github.com/kivy/kivy-ios/issues/485) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Uses Python 3 syntax [\#484](https://github.com/kivy/kivy-ios/issues/484) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Also lints the tools/ folder [\#483](https://github.com/kivy/kivy-ios/issues/483) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Migrates libffi build to Python 3 [\#481](https://github.com/kivy/kivy-ios/issues/481) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Uses a couple of syntax shortcuts [\#479](https://github.com/kivy/kivy-ios/issues/479) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Takes ToolchainCL definition outside the main [\#478](https://github.com/kivy/kivy-ios/issues/478) ([AndreMiras](https://github.com/AndreMiras))
|
||||
|
||||
## [1.1.0] - 2020-05-05
|
||||
### Added
|
||||
- Automatically publish to PyPI upon tagging [\#475](https://github.com/kivy/kivy-ios/issues/475) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Dedicated setup.py test workflow [\#474](https://github.com/kivy/kivy-ios/issues/474) ([AndreMiras](https://github.com/AndreMiras))
|
||||
|
||||
### Fixed
|
||||
- Fixes a regression introduced during the linting [\#477](https://github.com/kivy/kivy-ios/issues/477) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- More fixes to Numpy so that the binary is accepted by the App Store [\#473](https://github.com/kivy/kivy-ios/issues/473) ([lerela](https://github.com/lerela))
|
||||
- Do not build known broken recipes [\#471](https://github.com/kivy/kivy-ios/issues/471) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Fixes minor typos in the issue template [\#469](https://github.com/kivy/kivy-ios/issues/469) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Activates venv before venv build [\#464](https://github.com/kivy/kivy-ios/issues/464) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Fixes building in venv [\#462](https://github.com/kivy/kivy-ios/issues/462) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Cleanup - Removes vendored deps [\#454](https://github.com/kivy/kivy-ios/issues/454) ([misl6](https://github.com/misl6))
|
||||
|
||||
### Changed
|
||||
- Updates README.md with install/usage from PyPI [\#476](https://github.com/kivy/kivy-ios/issues/476) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Moving to dedicated kivy\_ios/ package directory [\#472](https://github.com/kivy/kivy-ios/issues/472) ([AndreMiras](https://github.com/AndreMiras))
|
||||
- Bumps Cython version [\#470](https://github.com/kivy/kivy-ios/issues/470) ([misl6](https://github.com/misl6))
|
||||
- Uses new `cd` context manager more [\#465](https://github.com/kivy/kivy-ios/issues/465) ([AndreMiras](https://github.com/AndreMiras))
|
||||
|
||||
|
||||
## [1.0.0] - 2020-05-02
|
||||
- Initial release
|
98
README.md
98
README.md
|
@ -1,7 +1,5 @@
|
|||
# Kivy for iOS
|
||||
|
||||
[](https://github.com/kivy/kivy-ios/actions?query=workflow%3Akivy-ios)
|
||||
[](https://badge.fury.io/py/kivy-ios)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
|
@ -16,23 +14,25 @@ The toolchain supports:
|
|||
- iPhone Simulator (x86_64)
|
||||
- iPhone / iOS (armv7 and arm64)
|
||||
|
||||
You can select between Python 2.7 or Python 3.7 by specifying the recipes
|
||||
`python2` or `python3` when building.
|
||||
|
||||
These recipes are not ported to the new toolchain yet:
|
||||
|
||||
- lxml
|
||||
|
||||
|
||||
## Installation & requirements
|
||||
## Requirements
|
||||
|
||||
Before we start, we strongly advise to use a Python virtual environment to install Python packages.
|
||||
Currently, the toolchain requires a few tools for compilation. You will need:
|
||||
|
||||
python3 -m venv venv
|
||||
. venv/bin/activate
|
||||
- Ensure you have python3 installed - this is needed for toolchain.py:
|
||||
|
||||
Install [Kivy for iOS from PyPI](https://pypi.org/project/kivy-ios) with pip like any Python package.
|
||||
brew install python
|
||||
|
||||
pip3 install kivy-ios
|
||||
- Ensure you have the right dependencies installed for python3:
|
||||
|
||||
Additionally you would need few system dependencies and configuration.
|
||||
pip3 install -r requirements.txt
|
||||
|
||||
- Xcode 10 or above, with an iOS SDK and command line tools installed:
|
||||
|
||||
|
@ -43,6 +43,12 @@ Additionally you would need few system dependencies and configuration.
|
|||
brew install autoconf automake libtool pkg-config
|
||||
brew link libtool
|
||||
|
||||
- Install Cython (0.28.1):
|
||||
|
||||
# pip method if available (sudo might be needed.)
|
||||
pip install cython==0.28.1
|
||||
|
||||
|
||||
## Using the toolchain
|
||||
|
||||
Any Python extensions or C/C++ library must be compiled: you need to have what
|
||||
|
@ -52,58 +58,61 @@ contained in a `recipe`.
|
|||
|
||||
You can list the available recipes and their versions with:
|
||||
|
||||
$ toolchain recipes
|
||||
$ ./toolchain.py recipes
|
||||
audiostream master
|
||||
click 7.1.2
|
||||
click master
|
||||
cymunk master
|
||||
distribute 0.7.3
|
||||
ffmpeg 2.6.3
|
||||
ffpyplayer v3.2
|
||||
flask 1.1.2
|
||||
flask master
|
||||
freetype 2.5.5
|
||||
hostlibffi 3.2.1
|
||||
hostpython2 2.7.1
|
||||
hostpython3 3.7.1
|
||||
ios master
|
||||
itsdangerous 1.1.0
|
||||
jinja2 2.11.2
|
||||
itsdangerous master
|
||||
jinja2 master
|
||||
kivy 1.10.1
|
||||
libffi 3.2.1
|
||||
libjpeg v9a
|
||||
libpng 1.6.26
|
||||
markupsafe 1.1.1
|
||||
markupsafe master
|
||||
moodstocks 4.1.5
|
||||
numpy 1.16.4
|
||||
numpy 1.9.1
|
||||
openssl 1.0.2k
|
||||
photolibrary master
|
||||
pillow 6.1.0
|
||||
pil 2.8.2
|
||||
plyer master
|
||||
pycrypto 2.6.1
|
||||
pykka 1.2.1
|
||||
pyobjus master
|
||||
python2 2.7.1
|
||||
python3 3.7.1
|
||||
pyyaml 3.11
|
||||
sdl2 2.0.8
|
||||
sdl2_image 2.0.0
|
||||
sdl2_mixer 2.0.0
|
||||
sdl2_ttf 2.0.12
|
||||
werkzeug 1.0.1
|
||||
werkzeug master
|
||||
|
||||
Then, start the compilation with:
|
||||
|
||||
$ toolchain build python3 kivy
|
||||
$ ./toolchain.py build python3 kivy
|
||||
|
||||
You can build recipes at the same time by adding them as parameters:
|
||||
|
||||
$ toolchain build python3 openssl kivy
|
||||
$ ./toolchain.py build python3 openssl kivy
|
||||
|
||||
Recipe builds can be removed via the clean command e.g.:
|
||||
|
||||
$ toolchain clean openssl
|
||||
|
||||
$ ./toolchain.py clean openssl
|
||||
|
||||
You can install package that don't require compilation with pip::
|
||||
|
||||
$ toolchain pip install plyer
|
||||
$ ./toolchain.py pip install plyer
|
||||
|
||||
The Kivy recipe depends on several others, like the sdl\* and python recipes.
|
||||
The Kivy recipe depends on several others, like the sdl* and python recipes.
|
||||
These may in turn depend on others e.g. sdl2_ttf depends on freetype, etc.
|
||||
You can think of it as follows: the kivy recipe will compile everything
|
||||
necessary for a minimal working version of Kivy.
|
||||
|
@ -113,14 +122,14 @@ time, 3x over (remember, 3 archs, x86_64, armv7, arm64) will take time.
|
|||
|
||||
For a complete list of available commands, type:
|
||||
|
||||
$ toolchain
|
||||
$ ./toolchain.py
|
||||
|
||||
## Create the Xcode project
|
||||
|
||||
The `toolchain.py` can create the initial Xcode project for you::
|
||||
|
||||
$ toolchain create <title> <app_directory>
|
||||
$ toolchain create Touchtracer ~/code/kivy/examples/demo/touchtracer
|
||||
$ ./toolchain.py create <title> <app_directory>
|
||||
$ ./toolchain.py create Touchtracer ~/code/kivy/examples/demo/touchtracer
|
||||
|
||||
Your app directory must contain a main.py. A directory named `<title>-ios`
|
||||
will be created, with an Xcode project in it.
|
||||
|
@ -191,12 +200,12 @@ things you can do to achieve this:
|
|||
|
||||
The procedure is to first compile/build all the host recipes as is:
|
||||
|
||||
toolchain build hostpython3
|
||||
./toolchain.py build hostpython3
|
||||
|
||||
Then build all the rest of the recipes using --arch=armv7 --arch=arm64
|
||||
arguments as follows:
|
||||
|
||||
toolchain build python3 kivy --arch=armv7 --arch=arm64
|
||||
./toolchain.py build python3 kivy --arch=armv7 --arch=arm64
|
||||
|
||||
Note that these packages will not run in the iOS emulators, so use them
|
||||
only for deployment.
|
||||
|
@ -204,7 +213,7 @@ things you can do to achieve this:
|
|||
## Usage
|
||||
|
||||
```
|
||||
toolchain <command> [<args>]
|
||||
./toolchain.py <command> [<args>]
|
||||
|
||||
Available commands:
|
||||
build Build a recipe (compile a library for the required target
|
||||
|
@ -220,26 +229,8 @@ Xcode:
|
|||
launchimage Create Launch images for your xcode project
|
||||
icon Create Icons for your xcode project
|
||||
pip Install a pip dependency into the distribution
|
||||
pip3 Install a pip dependency into the python 3 distribution
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Alternatively, it's also possible to clone the repository and use all the
|
||||
described commands in the above sections.
|
||||
Clone and install it to your local virtual environment:
|
||||
|
||||
git clone https://github.com/kivy/kivy-ios.git
|
||||
cd kivy-ios/
|
||||
python3 -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install -e .
|
||||
|
||||
Then use the `toolchain.py` script:
|
||||
|
||||
python toolchain.py --help
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### Fatal error: "stdio.h" file not found
|
||||
|
@ -256,16 +247,6 @@ It is due to invalid archs, search for them and check it. Maybe you
|
|||
targetted a simulator but have only armv7/arm64. Maybe you want to target
|
||||
your iPad but it as only x86_64.
|
||||
|
||||
### Why does the python multiprocess/subprocess module not work?
|
||||
|
||||
The iOS application model does not currently support multi-processing in a
|
||||
cross-platform compatible way. The application design focuses on minimizing
|
||||
processor usage (to minimize power consumption) and promotes an
|
||||
[alternative concurrency model](https://developer.apple.com/library/archive/documentation/General/Conceptual/ConcurrencyProgrammingGuide/Introduction/Introduction.html).
|
||||
|
||||
If you need to make use of multiple processes, you should consider using
|
||||
[PyObjus](https://github.com/kivy/pyobjus) to leverage native iOS
|
||||
functionals for this.
|
||||
|
||||
## Support
|
||||
|
||||
|
@ -324,4 +305,3 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
|
|||
<a href="https://opencollective.com/kivy/sponsor/7/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/kivy/sponsor/8/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/kivy/sponsor/9/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/9/avatar.svg"></a>
|
||||
|
||||
|
|
|
@ -1,339 +0,0 @@
|
|||
Metadata-Version: 2.1
|
||||
Name: kivy-ios
|
||||
Version: 1.1.2.dev0
|
||||
Summary: Kivy for iOS
|
||||
Home-page: https://github.com/kivy/kivy-ios
|
||||
Author: The Kivy team
|
||||
Author-email: kivy-dev@googlegroups.com
|
||||
License: UNKNOWN
|
||||
Description: # Kivy for iOS
|
||||
|
||||
[](https://github.com/kivy/kivy-ios/actions?query=workflow%3Akivy-ios)
|
||||
[](https://badge.fury.io/py/kivy-ios)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
This toolchain is designed to compile the necessary libraries for iOS to run
|
||||
your application and manage the creation of the Xcode project.
|
||||
|
||||
We do not provide any binary distributions of this toolchain.
|
||||
You do need to compile it at least once before creating your Xcode project.
|
||||
|
||||
The toolchain supports:
|
||||
|
||||
- iPhone Simulator (x86_64)
|
||||
- iPhone / iOS (armv7 and arm64)
|
||||
|
||||
These recipes are not ported to the new toolchain yet:
|
||||
|
||||
- lxml
|
||||
|
||||
|
||||
## Installation & requirements
|
||||
|
||||
Before we start, we strongly advise to use a Python virtual environment to install Python packages.
|
||||
|
||||
python3 -m venv venv
|
||||
. venv/bin/activate
|
||||
|
||||
Install [Kivy for iOS from PyPI](https://pypi.org/project/kivy-ios) with pip like any Python package.
|
||||
|
||||
pip3 install kivy-ios
|
||||
|
||||
Additionally you would need few system dependencies and configuration.
|
||||
|
||||
- Xcode 10 or above, with an iOS SDK and command line tools installed:
|
||||
|
||||
xcode-select --install
|
||||
|
||||
- Using brew, you can install the following dependencies:
|
||||
|
||||
brew install autoconf automake libtool pkg-config
|
||||
brew link libtool
|
||||
|
||||
## Using the toolchain
|
||||
|
||||
Any Python extensions or C/C++ library must be compiled: you need to have what
|
||||
we call a `recipe` to compile it. For example, Python, libffi, SDL2, SDL_image,
|
||||
freetype... all the dependencies, compilation and packaging instructions are
|
||||
contained in a `recipe`.
|
||||
|
||||
You can list the available recipes and their versions with:
|
||||
|
||||
$ toolchain recipes
|
||||
audiostream master
|
||||
click 7.1.2
|
||||
cymunk master
|
||||
ffmpeg 2.6.3
|
||||
ffpyplayer v3.2
|
||||
flask 1.1.2
|
||||
freetype 2.5.5
|
||||
hostlibffi 3.2.1
|
||||
hostpython3 3.7.1
|
||||
ios master
|
||||
itsdangerous 1.1.0
|
||||
jinja2 2.11.2
|
||||
kivy 1.10.1
|
||||
libffi 3.2.1
|
||||
libjpeg v9a
|
||||
libpng 1.6.26
|
||||
markupsafe 1.1.1
|
||||
moodstocks 4.1.5
|
||||
numpy 1.16.4
|
||||
openssl 1.0.2k
|
||||
photolibrary master
|
||||
pillow 6.1.0
|
||||
plyer master
|
||||
pycrypto 2.6.1
|
||||
pykka 1.2.1
|
||||
pyobjus master
|
||||
python3 3.7.1
|
||||
pyyaml 3.11
|
||||
sdl2 2.0.8
|
||||
sdl2_image 2.0.0
|
||||
sdl2_mixer 2.0.0
|
||||
sdl2_ttf 2.0.12
|
||||
werkzeug 1.0.1
|
||||
|
||||
Then, start the compilation with:
|
||||
|
||||
$ toolchain build python3 kivy
|
||||
|
||||
You can build recipes at the same time by adding them as parameters:
|
||||
|
||||
$ toolchain build python3 openssl kivy
|
||||
|
||||
Recipe builds can be removed via the clean command e.g.:
|
||||
|
||||
$ toolchain clean openssl
|
||||
|
||||
You can install package that don't require compilation with pip::
|
||||
|
||||
$ toolchain pip install plyer
|
||||
|
||||
The Kivy recipe depends on several others, like the sdl\* and python recipes.
|
||||
These may in turn depend on others e.g. sdl2_ttf depends on freetype, etc.
|
||||
You can think of it as follows: the kivy recipe will compile everything
|
||||
necessary for a minimal working version of Kivy.
|
||||
|
||||
Don't grab a coffee, just do diner. Compiling all the libraries for the first
|
||||
time, 3x over (remember, 3 archs, x86_64, armv7, arm64) will take time.
|
||||
|
||||
For a complete list of available commands, type:
|
||||
|
||||
$ toolchain
|
||||
|
||||
## Create the Xcode project
|
||||
|
||||
The `toolchain.py` can create the initial Xcode project for you::
|
||||
|
||||
$ toolchain create <title> <app_directory>
|
||||
$ toolchain create Touchtracer ~/code/kivy/examples/demo/touchtracer
|
||||
|
||||
Your app directory must contain a main.py. A directory named `<title>-ios`
|
||||
will be created, with an Xcode project in it.
|
||||
You can open the Xcode project using::
|
||||
|
||||
$ open touchtracer-ios/touchtracer.xcodeproj
|
||||
|
||||
Then click on `Play`, and enjoy.
|
||||
|
||||
> *Did you know ?*
|
||||
>
|
||||
> Everytime you press `Play`, your application directory will be synced to
|
||||
> the `<title>-ios/YourApp` directory. Don't make changes in the -ios
|
||||
> directory directly.
|
||||
|
||||
|
||||
## Configuring your App
|
||||
|
||||
You can configure and customize your app in various ways:
|
||||
|
||||
- Set the icon and launch images in XCode. Note that XCode requires that you
|
||||
specify these assests per device or/and iOS version.
|
||||
|
||||
- When you first build your XCode project, a 'main.m' file is created in your
|
||||
XCode project folder. This file configures your environment variables and
|
||||
controls your application startup. You can edit this file to customize your
|
||||
launch environment.
|
||||
|
||||
- Kivy uses SDL, and as soon as the application starts the SDL main, the launch
|
||||
image will disappear. To prevent that, you need to have 2 files named
|
||||
`Default.png` and `Default-Landscape.png`, and put them
|
||||
in the `Resources` folder in Xcode (not in your application folder)
|
||||
|
||||
> *Did you know ?*
|
||||
>
|
||||
> If you wish to restrict your apps orientation, you should do this via
|
||||
> the 'export_orientation' function in 'main.m'. The XCode orientation
|
||||
> settings should be set to support all.
|
||||
|
||||
|
||||
## Using recipes
|
||||
|
||||
Recipes are used to install and compile any libraries you may need to use. These
|
||||
recipes follow the same format as those used by the
|
||||
[Python-for-Android](https://github.com/kivy/python-for-android) sister project.
|
||||
Please refer to the
|
||||
[recipe documentation](https://python-for-android.readthedocs.io/en/latest/recipes/)
|
||||
there for more detail.
|
||||
|
||||
|
||||
## Reducing the application size
|
||||
|
||||
If you would like to reduce the size of your distributed app, there are a few
|
||||
things you can do to achieve this:
|
||||
|
||||
- Minimize the `build/pythonX/lib/pythonXX.zip`: this contains all the python
|
||||
modules. You can edit the zip file and remove all the files you'll not use
|
||||
(reduce encodings, remove xml, email...)
|
||||
|
||||
- Go to the settings `panel` > `build`, search for `"strip"` options, and
|
||||
triple-check that they are all set to `NO`. Stripping does not work with
|
||||
Python dynamic modules and will remove needed symbols.
|
||||
|
||||
- By default, the iOS package compiles binaries for all processor
|
||||
architectures, namely x86_64, armv7 and arm64 as per the guidelines from
|
||||
Apple. You can reduce the size of your ipa significantly by removing the
|
||||
x86_64 architecture as they are used only for the emulator.
|
||||
|
||||
The procedure is to first compile/build all the host recipes as is:
|
||||
|
||||
toolchain build hostpython3
|
||||
|
||||
Then build all the rest of the recipes using --arch=armv7 --arch=arm64
|
||||
arguments as follows:
|
||||
|
||||
toolchain build python3 kivy --arch=armv7 --arch=arm64
|
||||
|
||||
Note that these packages will not run in the iOS emulators, so use them
|
||||
only for deployment.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
toolchain <command> [<args>]
|
||||
|
||||
Available commands:
|
||||
build Build a recipe (compile a library for the required target
|
||||
architecture)
|
||||
clean Clean the build of the specified recipe
|
||||
distclean Clean the build and the result
|
||||
recipes List all the available recipes
|
||||
status List all the recipes and their build status
|
||||
|
||||
Xcode:
|
||||
create Create a new xcode project
|
||||
update Update an existing xcode project (frameworks, libraries..)
|
||||
launchimage Create Launch images for your xcode project
|
||||
icon Create Icons for your xcode project
|
||||
pip Install a pip dependency into the distribution
|
||||
pip3 Install a pip dependency into the python 3 distribution
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Alternatively, it's also possible to clone the repository and use all the
|
||||
described commands in the above sections.
|
||||
Clone and install it to your local virtual environment:
|
||||
|
||||
git clone https://github.com/kivy/kivy-ios.git
|
||||
cd kivy-ios/
|
||||
python3 -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install -e .
|
||||
|
||||
Then use the `toolchain.py` script:
|
||||
|
||||
python toolchain.py --help
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### Fatal error: "stdio.h" file not found
|
||||
|
||||
You need to install the Command line tools: `xcode-select --install`
|
||||
|
||||
### You must build with bitcode disabled (Xcode setting ENABLE_BITCODE should be No).
|
||||
|
||||
We don't support bitcode. You need to go to the project setting, and disable bitcode.
|
||||
|
||||
### You don't have permissions to run
|
||||
|
||||
It is due to invalid archs, search for them and check it. Maybe you
|
||||
targetted a simulator but have only armv7/arm64. Maybe you want to target
|
||||
your iPad but it as only x86_64.
|
||||
|
||||
### Why does the python multiprocess/subprocess module not work?
|
||||
|
||||
The iOS application model does not currently support multi-processing in a
|
||||
cross-platform compatible way. The application design focuses on minimizing
|
||||
processor usage (to minimize power consumption) and promotes an
|
||||
[alternative concurrency model](https://developer.apple.com/library/archive/documentation/General/Conceptual/ConcurrencyProgrammingGuide/Introduction/Introduction.html).
|
||||
|
||||
If you need to make use of multiple processes, you should consider using
|
||||
[PyObjus](https://github.com/kivy/pyobjus) to leverage native iOS
|
||||
functionals for this.
|
||||
|
||||
## Support
|
||||
|
||||
If you need assistance, you can ask for help on our mailing list:
|
||||
|
||||
* User Group : https://groups.google.com/group/kivy-users
|
||||
* Email : kivy-users@googlegroups.com
|
||||
|
||||
We also have a Discord channel:
|
||||
|
||||
* Server : https://chat.kivy.org
|
||||
* Channel : #support
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
We love pull requests and discussing novel ideas. Check out our
|
||||
[contribution guide](http://kivy.org/docs/contribute.html) and
|
||||
feel free to improve Kivy for iOS.
|
||||
|
||||
The following mailing list and IRC channel are used exclusively for
|
||||
discussions about developing the Kivy framework and its sister projects:
|
||||
|
||||
* Dev Group : https://groups.google.com/group/kivy-dev
|
||||
* Email : kivy-dev@googlegroups.com
|
||||
|
||||
Discord channel:
|
||||
|
||||
* Server : https://chat.kivy.org
|
||||
* Channel : #dev
|
||||
|
||||
## License
|
||||
|
||||
Kivy for iOS is released under the terms of the MIT License. Please refer to the
|
||||
LICENSE file.
|
||||
|
||||
|
||||
## Backers
|
||||
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/kivy#backer)]
|
||||
|
||||
<a href="https://opencollective.com/kivy#backers" target="_blank"><img src="https://opencollective.com/kivy/backers.svg?width=890"></a>
|
||||
|
||||
|
||||
## Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/kivy#sponsor)]
|
||||
|
||||
<a href="https://opencollective.com/kivy/sponsor/0/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/kivy/sponsor/1/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/kivy/sponsor/2/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/kivy/sponsor/3/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/kivy/sponsor/4/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/kivy/sponsor/5/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/kivy/sponsor/6/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/kivy/sponsor/7/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/kivy/sponsor/8/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/kivy/sponsor/9/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/9/avatar.svg"></a>
|
||||
|
||||
|
||||
Platform: UNKNOWN
|
||||
Requires-Python: >=3.6.0
|
||||
Description-Content-Type: text/markdown
|
|
@ -1,256 +0,0 @@
|
|||
README.md
|
||||
setup.py
|
||||
kivy_ios/__init__.py
|
||||
kivy_ios/context_managers.py
|
||||
kivy_ios/toolchain.py
|
||||
kivy_ios.egg-info/PKG-INFO
|
||||
kivy_ios.egg-info/SOURCES.txt
|
||||
kivy_ios.egg-info/dependency_links.txt
|
||||
kivy_ios.egg-info/entry_points.txt
|
||||
kivy_ios.egg-info/requires.txt
|
||||
kivy_ios.egg-info/top_level.txt
|
||||
kivy_ios/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/__pycache__/context_managers.cpython-37.pyc
|
||||
kivy_ios/__pycache__/context_managers.cpython-38.pyc
|
||||
kivy_ios/__pycache__/toolchain.cpython-37.pyc
|
||||
kivy_ios/__pycache__/toolchain.cpython-38.pyc
|
||||
kivy_ios/recipes/__init__.py
|
||||
kivy_ios/recipes/hostpython.py
|
||||
kivy_ios/recipes/python.py
|
||||
kivy_ios/recipes/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/__pycache__/python.cpython-37.pyc
|
||||
kivy_ios/recipes/__pycache__/python.cpython-38.pyc
|
||||
kivy_ios/recipes/aiohttp/__init__.py
|
||||
kivy_ios/recipes/aioupnp/__init__.py
|
||||
kivy_ios/recipes/appdirs/__init__.py
|
||||
kivy_ios/recipes/appdirs/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/asn1crypto/__init__.py
|
||||
kivy_ios/recipes/asn1crypto/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/async-timeout/__init__.py
|
||||
kivy_ios/recipes/attrs/__init__.py
|
||||
kivy_ios/recipes/attrs/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/audiostream/__init__.py
|
||||
kivy_ios/recipes/audiostream/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/base58/__init__.py
|
||||
kivy_ios/recipes/base58/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/cffi/__init__.py
|
||||
kivy_ios/recipes/cffi/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/chardet/__init__.py
|
||||
kivy_ios/recipes/click/__init__.py
|
||||
kivy_ios/recipes/click/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/coincurve/__init__.py
|
||||
kivy_ios/recipes/coincurve/cross_compile.patch
|
||||
kivy_ios/recipes/coincurve/drop_setup_requires.patch
|
||||
kivy_ios/recipes/coincurve/find_lib.patch
|
||||
kivy_ios/recipes/coincurve/no-download.patch
|
||||
kivy_ios/recipes/coincurve/setup.py.patch
|
||||
kivy_ios/recipes/colorama/__init__.py
|
||||
kivy_ios/recipes/colorama/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/cryptography/__init__.py
|
||||
kivy_ios/recipes/cryptography/getentropy.patch
|
||||
kivy_ios/recipes/cryptography/osrandom.patch
|
||||
kivy_ios/recipes/cryptography/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/curly/__init__.py
|
||||
kivy_ios/recipes/curly/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/cymunk/__init__.py
|
||||
kivy_ios/recipes/cymunk/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/defusedxml/__init__.py
|
||||
kivy_ios/recipes/docopt/__init__.py
|
||||
kivy_ios/recipes/docopt/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/ecdsa/__init__.py
|
||||
kivy_ios/recipes/ecdsa/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/ffmpeg/__init__.py
|
||||
kivy_ios/recipes/ffmpeg/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/ffpyplayer/__init__.py
|
||||
kivy_ios/recipes/ffpyplayer/misc-visibility.patch
|
||||
kivy_ios/recipes/ffpyplayer/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/flask/__init__.py
|
||||
kivy_ios/recipes/flask/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/freetype/__init__.py
|
||||
kivy_ios/recipes/freetype/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/freetype/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/hachoir/__init__.py
|
||||
kivy_ios/recipes/host_cffi/__init__.py
|
||||
kivy_ios/recipes/host_setuptools/__init__.py
|
||||
kivy_ios/recipes/host_setuptools/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/host_setuptools/setuptools/README.rst
|
||||
kivy_ios/recipes/host_setuptools3/__init__.py
|
||||
kivy_ios/recipes/host_setuptools3/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/host_setuptools3/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/host_setuptools3/setuptools/README.rst
|
||||
kivy_ios/recipes/hostlibffi/__init__.py
|
||||
kivy_ios/recipes/hostlibffi/ffi-3.0.13-sysv.S.patch
|
||||
kivy_ios/recipes/hostlibffi/fix-win32-unreferenced-symbol.patch
|
||||
kivy_ios/recipes/hostlibffi/generate-darwin-source-and-headers-python3-items.patch
|
||||
kivy_ios/recipes/hostlibffi/libffi-xcode10.patch
|
||||
kivy_ios/recipes/hostlibffi/public_include.patch
|
||||
kivy_ios/recipes/hostlibffi/staticlib.patch
|
||||
kivy_ios/recipes/hostlibffi/staticlib2.patch
|
||||
kivy_ios/recipes/hostlibffi/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/hostlibffi/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/hostopenssl/__init__.py
|
||||
kivy_ios/recipes/hostopenssl/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/hostopenssl/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/hostpython3/ModulesSetup
|
||||
kivy_ios/recipes/hostpython3/__init__.py
|
||||
kivy_ios/recipes/hostpython3/pyconfig_detection.patch
|
||||
kivy_ios/recipes/hostpython3/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/hostpython3/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/idna/__init__.py
|
||||
kivy_ios/recipes/idna/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/ios/__init__.py
|
||||
kivy_ios/recipes/ios/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/ios/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/ios/src/ios.pyx
|
||||
kivy_ios/recipes/ios/src/ios_browser.m
|
||||
kivy_ios/recipes/ios/src/ios_filechooser.m
|
||||
kivy_ios/recipes/ios/src/ios_mail.m
|
||||
kivy_ios/recipes/ios/src/ios_utils.m
|
||||
kivy_ios/recipes/ios/src/ios_wrapper.h
|
||||
kivy_ios/recipes/ios/src/setup.py
|
||||
kivy_ios/recipes/ipaddress/__init__.py
|
||||
kivy_ios/recipes/ipaddress/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/itsdangerous/__init__.py
|
||||
kivy_ios/recipes/itsdangerous/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/jinja2/__init__.py
|
||||
kivy_ios/recipes/jinja2/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/jsonschema/__init__.py
|
||||
kivy_ios/recipes/jsonschema/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/keyring/__init__.py
|
||||
kivy_ios/recipes/keyring/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/kivent_core/__init__.py
|
||||
kivy_ios/recipes/kivent_core/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/kivy/__init__.py
|
||||
kivy_ios/recipes/kivy/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/kivy/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/lbry/__init__.py
|
||||
kivy_ios/recipes/lbry/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/libcurl/__init__.py
|
||||
kivy_ios/recipes/libcurl/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/libffi/__init__.py
|
||||
kivy_ios/recipes/libffi/ffi-3.0.13-sysv.S.patch
|
||||
kivy_ios/recipes/libffi/fix-win32-unreferenced-symbol.patch
|
||||
kivy_ios/recipes/libffi/generate-darwin-source-and-headers-python3-items.patch
|
||||
kivy_ios/recipes/libffi/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/libffi/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/libjpeg/__init__.py
|
||||
kivy_ios/recipes/libjpeg/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/libpng/__init__.py
|
||||
kivy_ios/recipes/libpng/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/libsecp256k1/__init__.py
|
||||
kivy_ios/recipes/libzbar/__init__.py
|
||||
kivy_ios/recipes/libzbar/werror.patch
|
||||
kivy_ios/recipes/libzbar/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/markupsafe/__init__.py
|
||||
kivy_ios/recipes/markupsafe/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/mock/__init__.py
|
||||
kivy_ios/recipes/msgpack/__init__.py
|
||||
kivy_ios/recipes/multidict/__init__.py
|
||||
kivy_ios/recipes/netifaces/__init__.py
|
||||
kivy_ios/recipes/netifaces/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/numpy/__init__.py
|
||||
kivy_ios/recipes/numpy/numpy-1.16.4.patch
|
||||
kivy_ios/recipes/numpy/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/openssl/__init__.py
|
||||
kivy_ios/recipes/openssl/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/openssl/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/pbkdf2/__init__.py
|
||||
kivy_ios/recipes/pbkdf2/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/photolibrary/__init__.py
|
||||
kivy_ios/recipes/photolibrary/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/pillow/__init__.py
|
||||
kivy_ios/recipes/pillow/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/plyer/__init__.py
|
||||
kivy_ios/recipes/plyer/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/prometheus_client/__init__.py
|
||||
kivy_ios/recipes/protobuf/__init__.py
|
||||
kivy_ios/recipes/protobuf/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/pyasn1/__init__.py
|
||||
kivy_ios/recipes/pyasn1-modules/__init__.py
|
||||
kivy_ios/recipes/pyasn1-modules/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/pyasn1/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/pycparser/__init__.py
|
||||
kivy_ios/recipes/pycrypto/__init__.py
|
||||
kivy_ios/recipes/pycrypto/hash_SHA2_template.c.patch
|
||||
kivy_ios/recipes/pycrypto/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/pykka/__init__.py
|
||||
kivy_ios/recipes/pykka/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/pylru/__init__.py
|
||||
kivy_ios/recipes/pyobjus/__init__.py
|
||||
kivy_ios/recipes/pyobjus/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/pyobjus/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/python3/ModulesSetup
|
||||
kivy_ios/recipes/python3/ModulesSetup.mobile
|
||||
kivy_ios/recipes/python3/__init__.py
|
||||
kivy_ios/recipes/python3/config.sub.patch
|
||||
kivy_ios/recipes/python3/configure.patch
|
||||
kivy_ios/recipes/python3/ctypes_duplicate.patch
|
||||
kivy_ios/recipes/python3/disable_explicit_blake2.patch
|
||||
kivy_ios/recipes/python3/dynload_shlib.patch
|
||||
kivy_ios/recipes/python3/posixmodule.patch
|
||||
kivy_ios/recipes/python3/pyconfig_detection.patch
|
||||
kivy_ios/recipes/python3/random.patch
|
||||
kivy_ios/recipes/python3/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/python3/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/python3/mock_modules/_sqlite3/__init__.py
|
||||
kivy_ios/recipes/python3/mock_modules/_sqlite3/_sqlite3.cpython-38-darwin.so
|
||||
kivy_ios/recipes/pyyaml/__init__.py
|
||||
kivy_ios/recipes/pyyaml/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/sdl2/__init__.py
|
||||
kivy_ios/recipes/sdl2/uikit-transparent.patch
|
||||
kivy_ios/recipes/sdl2/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/sdl2/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/sdl2_image/__init__.py
|
||||
kivy_ios/recipes/sdl2_image/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/sdl2_image/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/sdl2_mixer/__init__.py
|
||||
kivy_ios/recipes/sdl2_mixer/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/sdl2_mixer/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/sdl2_ttf/__init__.py
|
||||
kivy_ios/recipes/sdl2_ttf/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/sdl2_ttf/__pycache__/__init__.cpython-38.pyc
|
||||
kivy_ios/recipes/setuptools/__init__.py
|
||||
kivy_ios/recipes/setuptools/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/six/__init__.py
|
||||
kivy_ios/recipes/six/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/werkzeug/__init__.py
|
||||
kivy_ios/recipes/werkzeug/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/recipes/yarl/__init__.py
|
||||
kivy_ios/recipes/zbarlight/__init__.py
|
||||
kivy_ios/recipes/zbarlight/zbarlight_1_2.patch
|
||||
kivy_ios/recipes/zbarlight/__pycache__/__init__.cpython-37.pyc
|
||||
kivy_ios/tools/__init__.py
|
||||
kivy_ios/tools/biglink
|
||||
kivy_ios/tools/cythonize.py
|
||||
kivy_ios/tools/liblink
|
||||
kivy_ios/tools/external/__init__.py
|
||||
kivy_ios/tools/external/xcassets.py
|
||||
kivy_ios/tools/templates/cookiecutter.json
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/bridge.h
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/bridge.m
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/icon.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/main.m
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/{{ cookiecutter.project_name }}-Info.plist
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/LaunchImages/Default-568h@2x.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/LaunchImages/Default-667h@2x.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/LaunchImages/Default-763h@3x.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/LaunchImages/Default-Landscape.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/LaunchImages/Default-Landscape@2x.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/LaunchImages/Default-Portrait.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/LaunchImages/Default-Portrait@2x~ipad.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/LaunchImages/Default-Portrait@3x~ipad.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/LaunchImages/Default.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/LaunchImages/Default@2x.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/LaunchImages/Default@3x.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/YourApp/README.txt
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/YourApp/android.txt
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/YourApp/pictures.kv
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/YourApp/shadow32.png
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/YourApp/images/5509213687_ffd18df0b9_b.jpg
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/YourApp/images/5552597274_de8b3fb5d2_b.jpg
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/YourApp/images/faust_github.jpg
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/{{ cookiecutter.project_name }}.xcodeproj/project.pbxproj
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/{{ cookiecutter.project_name }}.xcodeproj/project.xcworkspace/contents.xcworkspacedata
|
||||
kivy_ios/tools/templates/{{ cookiecutter.project_name }}-ios/{{ cookiecutter.project_name }}/Images.xcassets/AppIcon.appiconset/Contents.json
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
[console_scripts]
|
||||
toolchain = kivy_ios.toolchain:main
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
cookiecutter
|
||||
pbxproj
|
||||
Pillow
|
||||
requests
|
||||
sh
|
|
@ -1 +0,0 @@
|
|||
kivy_ios
|
|
@ -1,46 +0,0 @@
|
|||
"""
|
||||
This module houses context managers to assist in the managing of state during
|
||||
kivy-ios builds.
|
||||
"""
|
||||
from logging import getLogger
|
||||
from contextlib import contextmanager
|
||||
from os import getcwd, chdir, environ
|
||||
from os.path import expanduser
|
||||
|
||||
|
||||
logger = getLogger(__name__)
|
||||
|
||||
|
||||
@contextmanager
|
||||
def cd(newdir):
|
||||
"""
|
||||
Set the current working directory to `newdir` for the duration of the
|
||||
context.
|
||||
"""
|
||||
prevdir = getcwd()
|
||||
logger.info("cd {}".format(newdir))
|
||||
chdir(expanduser(newdir))
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
logger.info("cd {}".format(prevdir))
|
||||
chdir(prevdir)
|
||||
|
||||
|
||||
@contextmanager
|
||||
def python_path(newdir):
|
||||
"""
|
||||
Set the PYTHONPATH environmnet variable to `newdir` for the duraiton of the
|
||||
context.
|
||||
"""
|
||||
prevdir = environ.get("PYTHONPATH")
|
||||
logger.debug("Setting PYTHONPATH to {}".format(newdir))
|
||||
environ["PYTHONPATH"] = newdir
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
logger.debug("Setting PYTHONPATH to {}".format(prevdir))
|
||||
if prevdir is None:
|
||||
environ.pop("PYTHONPATH")
|
||||
else:
|
||||
environ["PYTHONPATH"] = prevdir
|
|
@ -1,29 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import CythonRecipe, shprint
|
||||
from os.path import join
|
||||
|
||||
class AioupnpRecipe(CythonRecipe):
|
||||
version = "0.0.17"
|
||||
url = "https://pypi.python.org/packages/source/a/aioupnp/aioupnp-{version}.tar.gz"
|
||||
depends = ["python", "defusedxml"]
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
if self.has_marker("patched"):
|
||||
return
|
||||
self.apply_patch("exclude_netifaces.patch")
|
||||
self.apply_patch("none_netifaces.patch")
|
||||
self.set_marker("patched")
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = AioupnpRecipe()
|
|
@ -1,10 +0,0 @@
|
|||
--- a/setup.py 2020-09-28 10:20:48.000000000 +0100
|
||||
+++ b/setup.py 2020-09-28 10:21:12.000000000 +0100
|
||||
@@ -36,7 +36,6 @@
|
||||
packages=find_packages(exclude=('tests',)),
|
||||
entry_points={'console_scripts': console_scripts},
|
||||
install_requires=[
|
||||
- 'netifaces',
|
||||
'defusedxml'
|
||||
]
|
||||
)
|
|
@ -1,16 +0,0 @@
|
|||
--- a/aioupnp/interfaces.py 2020-09-28 10:23:40.000000000 +0100
|
||||
+++ b/aioupnp/interfaces.py 2020-09-28 10:23:56.000000000 +0100
|
||||
@@ -1,12 +1,11 @@
|
||||
import socket
|
||||
from collections import OrderedDict
|
||||
import typing
|
||||
-import netifaces
|
||||
from aioupnp.fault import UPnPError
|
||||
|
||||
|
||||
def get_netifaces():
|
||||
- return netifaces
|
||||
+ return None
|
||||
|
||||
|
||||
def ifaddresses(iface: str) -> typing.Dict[int, typing.List[typing.Dict[str, str]]]:
|
|
@ -1,22 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class AsyncTimeoutRecipe(PythonRecipe):
|
||||
version = "3.0.1"
|
||||
url = "https://pypi.python.org/packages/source/a/async-timeout/async-timeout-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = AsyncTimeoutRecipe()
|
|
@ -1,23 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class CertifiRecipe(PythonRecipe):
|
||||
version = "2020.6.20"
|
||||
url = "https://pypi.python.org/packages/source/c/certifi/certifi-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = CertifiRecipe()
|
|
@ -1,23 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class ChardetRecipe(PythonRecipe):
|
||||
version = "3.0.4"
|
||||
url = "https://pypi.python.org/packages/source/c/chardet/chardet-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = ChardetRecipe()
|
|
@ -1,76 +0,0 @@
|
|||
import sh
|
||||
import os
|
||||
from os.path import join
|
||||
|
||||
from kivy_ios.toolchain import CythonRecipe, Recipe, shprint
|
||||
from kivy_ios.context_managers import cd
|
||||
|
||||
|
||||
class CoincurveRecipe(CythonRecipe):
|
||||
version = "7.1.0"
|
||||
url = "https://github.com/ofek/coincurve/archive/{version}.tar.gz"
|
||||
depends = ["python3", "libffi", "cffi", "pycparser", "libsecp256k1"]
|
||||
library = 'libcoincurve.a'
|
||||
pre_build_ext = True
|
||||
include_per_arch = True
|
||||
|
||||
def dest_dir(self):
|
||||
return join(self.ctx.dist_dir, "root", "python3")
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
# common to all archs
|
||||
if self.has_marker("patched"):
|
||||
return
|
||||
self.apply_patch("cross_compile.patch")
|
||||
self.apply_patch("drop_setup_requires.patch")
|
||||
self.apply_patch("find_lib.patch")
|
||||
self.apply_patch("no-download.patch")
|
||||
self.apply_patch("setup.py.patch")
|
||||
self.set_marker("patched")
|
||||
|
||||
def get_recipe_env(self, arch):
|
||||
env = arch.get_env()
|
||||
# sets linker to use the correct gcc (cross compiler)
|
||||
env['TOOLCHAIN_PREFIX'] = arch.triple
|
||||
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl'
|
||||
libsecp256k1 = self.get_recipe('libsecp256k1', self.ctx)
|
||||
libsecp256k1_dir = libsecp256k1.get_build_dir(arch.arch)
|
||||
env['LDFLAGS'] += ' -L{}'.format(os.path.join(libsecp256k1_dir, '.libs'))
|
||||
env['CFLAGS'] += ' -I' + os.path.join(libsecp256k1_dir, 'include')
|
||||
|
||||
target_python = Recipe.get_recipe('python3', self.ctx).get_build_dir(arch.arch)
|
||||
env['LDFLAGS'] += ' -L' + target_python
|
||||
|
||||
print(env['LDFLAGS'])
|
||||
|
||||
python_version = '3.8'
|
||||
env["PYTHONPATH"] = join(self.dest_dir(), "lib", "python3.8", "site-packages")
|
||||
env['PYTHON_ROOT'] = join(self.ctx.dist_dir, "root", "python3")
|
||||
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python{}'.format(python_version)
|
||||
env['LDFLAGS'] += " -lpython{}".format(python_version)
|
||||
env['LDFLAGS'] += " -lsecp256k1 -lssl -lcrypto -lffi -lz"
|
||||
return env
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
def postbuild_arch(self, arch):
|
||||
py_arch = arch.arch
|
||||
if py_arch == "arm64":
|
||||
py_arch = "x86_64"
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
build_env = self.get_recipe_env(arch)
|
||||
tmp_folder = 'build/temp.macosx-10.15-{}-3.8/build/temp.macosx-10.15-{}-3.8'.format(py_arch, py_arch)
|
||||
shprint(sh.Command(build_env['AR']),
|
||||
"-q",
|
||||
"{}/{}".format(self.build_dir, self.library),
|
||||
"{}/{}/_libsecp256k1.o".format(self.build_dir, tmp_folder))
|
||||
|
||||
recipe = CoincurveRecipe()
|
|
@ -1,22 +0,0 @@
|
|||
From bf3a0684e9b0af29d9777f61d6e7e1d3cc0f2803 Mon Sep 17 00:00:00 2001
|
||||
From: Kieran Prasch <kieranprasch@gmail.com>
|
||||
Date: Thu, 19 Jul 2018 14:11:48 -0700
|
||||
Subject: [PATCH] Exclude tests in setup.py
|
||||
|
||||
---
|
||||
setup.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 0b579f1..0a793ed 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -277,7 +277,7 @@ def has_c_libraries(self):
|
||||
install_requires=['asn1crypto', 'cffi>=1.3.0'],
|
||||
tests_require=['pytest>=2.8.7'],
|
||||
|
||||
- packages=find_packages(exclude=('_cffi_build', '_cffi_build.*', 'libsecp256k1')),
|
||||
+ packages=find_packages(exclude=('_cffi_build', '_cffi_build.*', 'libsecp256k1', 'tests')),
|
||||
|
||||
distclass=Distribution,
|
||||
zip_safe=False,
|
|
@ -1,79 +0,0 @@
|
|||
from os.path import join
|
||||
from kivy_ios.toolchain import CythonRecipe, Recipe, shprint
|
||||
from kivy_ios.context_managers import cd
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class CryptographyRecipe(CythonRecipe):
|
||||
name = "cryptography"
|
||||
version = "3.1.1"
|
||||
url = "https://pypi.python.org/packages/source/c/cryptography/cryptography-{version}.tar.gz"
|
||||
library = "libcryptography.a"
|
||||
depends = ["host_setuptools3", "host_cffi", "cffi", "asn1crypto", "idna", "six"]
|
||||
python_depends = ["setuptools"]
|
||||
cythonize = False
|
||||
pre_build_ext = True
|
||||
include_per_arch = True
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
if self.has_marker("patched"):
|
||||
return
|
||||
self.apply_patch("osrandom.patch")
|
||||
self.set_marker("patched")
|
||||
|
||||
def dest_dir(self):
|
||||
return join(self.ctx.dist_dir, "root", "python3")
|
||||
|
||||
def get_recipe_env(self, arch):
|
||||
env = super(CryptographyRecipe, self).get_recipe_env(arch)
|
||||
r = self.get_recipe('openssl', self.ctx)
|
||||
openssl_dir = r.get_build_dir(arch.arch)
|
||||
target_python = Recipe.get_recipe('python3', self.ctx).get_build_dir(arch.arch)
|
||||
env['TOOLCHAIN_PREFIX'] = arch.triple
|
||||
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl'
|
||||
env['LDFLAGS'] += ' -L' + target_python
|
||||
|
||||
env['PYTHON_ROOT'] = join(self.ctx.dist_dir, "root", "python3")
|
||||
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python3.8' + \
|
||||
' -I' + join(openssl_dir, 'include') + \
|
||||
' -I' + join(self.ctx.dist_dir, "include", arch.arch, "libffi")
|
||||
env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \
|
||||
' -L' + openssl_dir + \
|
||||
' -lpython3.8' + \
|
||||
' -lssl' + \
|
||||
' -lcrypto' + \
|
||||
' -lffi' + \
|
||||
' -lcffi ' + \
|
||||
' -lz'
|
||||
return env
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
with cd(build_dir):
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
def postbuild_arch(self, arch):
|
||||
py_arch = arch.arch
|
||||
if py_arch == "arm64":
|
||||
py_arch = "x86_64"
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
build_env = self.get_recipe_env(arch)
|
||||
tmp_folder = 'build/temp.macosx-10.15-{}-3.8/build/temp.macosx-10.15-{}-3.8'.format(py_arch, py_arch)
|
||||
for o_file in [
|
||||
"_openssl.o",
|
||||
"_padding.o",
|
||||
]:
|
||||
shprint(sh.Command(build_env['AR']),
|
||||
"-q",
|
||||
"{}/{}".format(self.build_dir, self.library),
|
||||
"{}/{}/{}".format(self.build_dir, tmp_folder, o_file))
|
||||
|
||||
|
||||
recipe = CryptographyRecipe()
|
|
@ -1,12 +0,0 @@
|
|||
from kivy_ios.toolchain import CythonRecipe
|
||||
|
||||
|
||||
class CurlyRecipe(CythonRecipe):
|
||||
version = "master"
|
||||
url = "https://github.com/tito/curly/archive/{version}.zip"
|
||||
library = "libcurly.a"
|
||||
depends = ["python", "libcurl", "sdl2", "sdl2_image"]
|
||||
pre_build_ext = True
|
||||
|
||||
|
||||
recipe = CurlyRecipe()
|
|
@ -1,24 +0,0 @@
|
|||
"""
|
||||
Author: Lawrence Du, Lukasz Mach
|
||||
E-mail: larrydu88@gmail.com, maho@pagema.net
|
||||
"""
|
||||
|
||||
from kivy_ios.toolchain import CythonRecipe
|
||||
|
||||
|
||||
class CymunkRecipe(CythonRecipe):
|
||||
version = 'master'
|
||||
url = 'https://github.com/kivy/cymunk/archive/{version}.zip'
|
||||
name = 'cymunk'
|
||||
pre_build_ext = True
|
||||
library = 'libcymunk.a'
|
||||
|
||||
depends = ['python']
|
||||
|
||||
def get_recipe_env(self, arch):
|
||||
ret = super(CymunkRecipe, self).get_recipe_env(arch)
|
||||
ret['CFLAGS'] += ' -Wno-implicit-function-declaration'
|
||||
return ret
|
||||
|
||||
|
||||
recipe = CymunkRecipe()
|
|
@ -1,23 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class DefusedXmlRecipe(PythonRecipe):
|
||||
version = "0.6.0"
|
||||
url = "https://pypi.python.org/packages/source/d/defusedxml/defusedxml-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = DefusedXmlRecipe()
|
|
@ -1,41 +0,0 @@
|
|||
diff --git a/ffpyplayer/clib/misc.c b/ffpyplayer/clib/misc.c
|
||||
index 55181d1..6011ffa 100644
|
||||
--- a/ffpyplayer/clib/misc.c
|
||||
+++ b/ffpyplayer/clib/misc.c
|
||||
@@ -1,8 +1,7 @@
|
||||
-
|
||||
#include "misc.h"
|
||||
|
||||
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
|
||||
-void print_all_libs_info(int flags, int level)
|
||||
+void __attribute__ ((visibility ("hidden"))) print_all_libs_info(int flags, int level)
|
||||
{
|
||||
#if CONFIG_AVUTIL
|
||||
PRINT_LIB_INFO(avutil, AVUTIL, flags, level);
|
||||
@@ -30,7 +29,7 @@ void print_all_libs_info(int flags, int level)
|
||||
#endif
|
||||
}
|
||||
|
||||
-const AVOption *opt_find(void *obj, const char *name, const char *unit,
|
||||
+const AVOption __attribute__ ((visibility ("hidden"))) *opt_find(void *obj, const char *name, const char *unit,
|
||||
int opt_flags, int search_flags)
|
||||
{
|
||||
const AVOption *o = av_opt_find(obj, name, unit, opt_flags, search_flags);
|
||||
@@ -40,7 +39,7 @@ const AVOption *opt_find(void *obj, const char *name, const char *unit,
|
||||
}
|
||||
|
||||
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
|
||||
-int opt_default(const char *opt, const char *arg,
|
||||
+int __attribute__ ((visibility ("hidden"))) opt_default(const char *opt, const char *arg,
|
||||
struct SwsContext *sws_opts, AVDictionary **sws_dict, AVDictionary **swr_opts,
|
||||
AVDictionary **resample_opts, AVDictionary **format_opts, AVDictionary **codec_opts)
|
||||
{
|
||||
@@ -140,7 +139,7 @@ int opt_default(const char *opt, const char *arg,
|
||||
return AVERROR_OPTION_NOT_FOUND;
|
||||
}
|
||||
|
||||
-int get_plane_sizes(int size[4], int required_plane[4], enum AVPixelFormat pix_fmt,
|
||||
+int __attribute__ ((visibility ("hidden"))) get_plane_sizes(int size[4], int required_plane[4], enum AVPixelFormat pix_fmt,
|
||||
int height, const int linesizes[4])
|
||||
{
|
||||
int i, total_size;
|
|
@ -1,23 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class HachoirRecipe(PythonRecipe):
|
||||
version = "3.1.1"
|
||||
url = "https://pypi.python.org/packages/source/h/hachoir/hachoir-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = HachoirRecipe()
|
|
@ -1,34 +0,0 @@
|
|||
from kivy_ios.toolchain import Recipe, shprint
|
||||
from os.path import join
|
||||
import sh
|
||||
import os
|
||||
import shutil
|
||||
|
||||
|
||||
class HostSetuptools(Recipe):
|
||||
depends = ["openssl", "hostpython"]
|
||||
archs = ["x86_64"]
|
||||
url = "setuptools"
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
sh.curl("-O", "https://bootstrap.pypa.io/ez_setup.py")
|
||||
shprint(hostpython, "./ez_setup.py")
|
||||
# Extract setuptools egg and remove .pth files. Otherwise subsequent
|
||||
# python package installations using setuptools will raise exceptions.
|
||||
# Setuptools version 28.3.0
|
||||
site_packages_path = join(
|
||||
self.ctx.dist_dir, 'hostpython3',
|
||||
'lib', 'python3.8', 'site-packages')
|
||||
os.chdir(site_packages_path)
|
||||
with open('setuptools.pth', 'r') as f:
|
||||
setuptools_egg_path = f.read().strip('./').strip('\n')
|
||||
unzip = sh.Command('unzip')
|
||||
shprint(unzip, '-o', setuptools_egg_path)
|
||||
os.remove(setuptools_egg_path)
|
||||
os.remove('setuptools.pth')
|
||||
os.remove('easy-install.pth')
|
||||
shutil.rmtree('EGG-INFO')
|
||||
|
||||
|
||||
recipe = HostSetuptools()
|
|
@ -1,24 +0,0 @@
|
|||
from kivy_ios.toolchain import Recipe, shprint, cache_execution
|
||||
from kivy_ios.context_managers import cd, python_path
|
||||
import sh
|
||||
|
||||
|
||||
class HostSetuptools3(Recipe):
|
||||
depends = ["openssl", "hostpython3", "python3"]
|
||||
archs = ["x86_64"]
|
||||
version = '40.9.0'
|
||||
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.zip'
|
||||
|
||||
@cache_execution
|
||||
def install(self):
|
||||
arch = self.filtered_archs[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
|
||||
with python_path(self.ctx.site_packages_dir):
|
||||
with cd(build_dir):
|
||||
shprint(hostpython, "setup.py", "install",
|
||||
f"--prefix={self.ctx.python_prefix}")
|
||||
|
||||
|
||||
recipe = HostSetuptools3()
|
|
@ -1 +0,0 @@
|
|||
Make toolchain happy
|
|
@ -1,12 +0,0 @@
|
|||
diff -Nru libffi-3.2.1/generate-darwin-source-and-headers.py libffi-3.2.1-new/generate-darwin-source-and-headers.py
|
||||
--- libffi-3.2.1/generate-darwin-source-and-headers.py 2014-11-08 13:47:24.000000000 +0100
|
||||
+++ libffi-3.2.1-new/generate-darwin-source-and-headers.py 2020-05-06 10:30:46.000000000 +0200
|
||||
@@ -194,7 +194,7 @@
|
||||
build_target(desktop64_platform, platform_headers)
|
||||
|
||||
mkdir_p('darwin_common/include')
|
||||
- for header_name, tag_tuples in platform_headers.iteritems():
|
||||
+ for header_name, tag_tuples in platform_headers.items():
|
||||
basename, suffix = os.path.splitext(header_name)
|
||||
with open(os.path.join('darwin_common/include', header_name), 'w') as header:
|
||||
for tag_tuple in tag_tuples:
|
|
@ -1,39 +0,0 @@
|
|||
from kivy_ios.toolchain import Recipe, shprint
|
||||
from os.path import join
|
||||
import sh
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class HostOpensslRecipe(Recipe):
|
||||
version = "1.1.1f"
|
||||
url = "http://www.openssl.org/source/openssl-{version}.tar.gz"
|
||||
archs = ["x86_64"]
|
||||
|
||||
def get_build_env(self):
|
||||
build_env = self.ctx.env.copy()
|
||||
self.build_env_x86_84 = build_env
|
||||
return build_env
|
||||
|
||||
def build_x86_64(self):
|
||||
build_env = self.get_build_env()
|
||||
configure = sh.Command(join(self.build_dir, "Configure"))
|
||||
shprint(configure,
|
||||
"darwin64-x86_64-cc",
|
||||
_env=build_env)
|
||||
shprint(sh.make, "clean")
|
||||
shprint(sh.make, self.ctx.concurrent_make, "build_libs")
|
||||
|
||||
def install(self):
|
||||
sh.mkdir('-p', join(self.ctx.dist_dir, 'hostopenssl'))
|
||||
sh.cp('-r', join(self.get_build_dir('x86_64'), 'include'),
|
||||
join(self.ctx.dist_dir, 'hostopenssl', 'include'))
|
||||
sh.mkdir('-p', join(self.ctx.dist_dir, 'hostopenssl', 'lib'))
|
||||
sh.cp(join(self.get_build_dir('x86_64'), 'libssl.a'),
|
||||
join(self.ctx.dist_dir, 'hostopenssl', 'lib'))
|
||||
sh.cp(join(self.get_build_dir('x86_64'), 'libcrypto.a'),
|
||||
join(self.ctx.dist_dir, 'hostopenssl', 'lib'))
|
||||
|
||||
|
||||
recipe = HostOpensslRecipe()
|
|
@ -1,100 +0,0 @@
|
|||
from kivy_ios.toolchain import Recipe, shprint
|
||||
from os.path import join
|
||||
import os
|
||||
import sh
|
||||
import shutil
|
||||
import logging
|
||||
from kivy_ios.context_managers import cd
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Hostpython3Recipe(Recipe):
|
||||
version = "3.8.2"
|
||||
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tgz"
|
||||
depends = ["hostlibffi", "hostopenssl"]
|
||||
optional_depends = []
|
||||
archs = ["x86_64"]
|
||||
build_subdir = 'native-build'
|
||||
|
||||
def init_with_ctx(self, ctx):
|
||||
super().init_with_ctx(ctx)
|
||||
self.set_hostpython(self, "3.8")
|
||||
self.ctx.so_suffix = ".cpython-38m-darwin.so"
|
||||
self.ctx.hostpython = join(self.ctx.dist_dir, "hostpython3", "bin", "python")
|
||||
self.ctx.hostpgen = join(self.ctx.dist_dir, "hostpython3", "bin", "pgen")
|
||||
logger.info("Global: hostpython located at {}".format(self.ctx.hostpython))
|
||||
logger.info("Global: hostpgen located at {}".format(self.ctx.hostpgen))
|
||||
|
||||
def get_build_subdir(self, arch):
|
||||
return join(self.get_build_dir(arch), self.build_subdir)
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
if self.has_marker("patched"):
|
||||
return
|
||||
self.apply_patch("pyconfig_detection.patch")
|
||||
self.copy_file("ModulesSetup", "Modules/Setup.local")
|
||||
self.set_marker("patched")
|
||||
|
||||
def postbuild_arch(self, arch):
|
||||
return
|
||||
|
||||
def get_build_env(self):
|
||||
sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip()
|
||||
build_env = self.ctx.env.copy()
|
||||
self.build_env_x86_84 = build_env
|
||||
ccache = (build_env["CCACHE"] + ' ') if 'CCACHE' in build_env else ''
|
||||
build_env["CC"] = ccache + "clang -Qunused-arguments -fcolor-diagnostics"
|
||||
build_env["LDFLAGS"] = " ".join([
|
||||
"-lsqlite3",
|
||||
"-lffi",
|
||||
"-L{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "lib"))
|
||||
])
|
||||
build_env["CFLAGS"] = " ".join([
|
||||
"--sysroot={}".format(sdk_path),
|
||||
"-arch x86_64",
|
||||
"-mmacosx-version-min=10.12",
|
||||
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
|
||||
])
|
||||
return build_env
|
||||
|
||||
def build_x86_64(self):
|
||||
build_env = self.get_build_env()
|
||||
configure = sh.Command(join(self.build_dir, "configure"))
|
||||
arch = self.filtered_archs[0]
|
||||
build_subdir = self.get_build_subdir(arch.arch)
|
||||
os.makedirs(build_subdir, exist_ok=True)
|
||||
with cd(build_subdir):
|
||||
shprint(configure,
|
||||
"--prefix={}".format(join(self.ctx.dist_dir, "hostpython3")),
|
||||
"--with-openssl={}".format(join(self.ctx.dist_dir, 'hostopenssl')),
|
||||
_env=build_env)
|
||||
shprint(sh.make, "-C", build_subdir, self.ctx.concurrent_make,
|
||||
_env=build_env)
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_env = self.get_build_env()
|
||||
build_subdir = self.get_build_subdir(arch.arch)
|
||||
build_env["PATH"] = os.environ["PATH"]
|
||||
shprint(sh.make, self.ctx.concurrent_make,
|
||||
"-C", build_subdir,
|
||||
"install",
|
||||
_env=build_env)
|
||||
shutil.copy(
|
||||
join(self.ctx.dist_dir, "hostpython3", "bin", "python3"),
|
||||
join(self.ctx.dist_dir, "hostpython3", "bin", "python"))
|
||||
"""
|
||||
I don't like this kind of "patches".
|
||||
sysconfig was overriding our cflags and extensions were failing to build.
|
||||
This hack resets the cflags provided by sysconfig.
|
||||
"""
|
||||
with open(join(self.ctx.dist_dir, "hostpython3", "lib", "python3.8", "distutils", "sysconfig.py"), 'r') as sysconfigfile:
|
||||
lines = sysconfigfile.readlines()
|
||||
lines[192] = ' cflags = ""\n'
|
||||
with open(join(self.ctx.dist_dir, "hostpython3", "lib", "python3.8", "distutils", "sysconfig.py"), 'w') as sysconfigfile:
|
||||
sysconfigfile.writelines(lines)
|
||||
|
||||
|
||||
recipe = Hostpython3Recipe()
|
|
@ -1,25 +0,0 @@
|
|||
diff -Nru Python-3.8.2/Lib/site.py Python-3.8.2-new/Lib/site.py
|
||||
--- Python-3.8.2/Lib/site.py 2020-02-24 22:36:25.000000000 +0100
|
||||
+++ Python-3.8.2-new/Lib/site.py 2020-05-01 17:10:43.000000000 +0200
|
||||
@@ -458,9 +458,8 @@
|
||||
|
||||
env = os.environ
|
||||
if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in env:
|
||||
- executable = sys._base_executable = os.environ['__PYVENV_LAUNCHER__']
|
||||
- else:
|
||||
- executable = sys.executable
|
||||
+ print("Ignoring __PYVENV_LAUNCHER__")
|
||||
+ executable = sys.executable
|
||||
exe_dir, _ = os.path.split(os.path.abspath(executable))
|
||||
site_prefix = os.path.dirname(exe_dir)
|
||||
sys._home = None
|
||||
@@ -487,7 +486,8 @@
|
||||
if key == 'include-system-site-packages':
|
||||
system_site = value.lower()
|
||||
elif key == 'home':
|
||||
- sys._home = value
|
||||
+ # this is breaking pyconfig.h path detection with venv
|
||||
+ print('Ignoring "sys._home = value" override')
|
||||
|
||||
sys.prefix = sys.exec_prefix = site_prefix
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
from kivy_ios.toolchain import CythonRecipe
|
||||
|
||||
|
||||
class IosRecipe(CythonRecipe):
|
||||
version = "master"
|
||||
url = "src"
|
||||
library = "libios.a"
|
||||
depends = ["python"]
|
||||
pbx_frameworks = ["MessageUI", "CoreMotion", "UIKit", "WebKit", "Photos"]
|
||||
|
||||
def install(self):
|
||||
self.install_python_package(
|
||||
name=self.so_filename("ios"), is_dir=False)
|
||||
|
||||
|
||||
recipe = IosRecipe()
|
|
@ -1,45 +0,0 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#include "ios_wrapper.h"
|
||||
|
||||
@interface NativeImagePicker : NSObject
|
||||
@end
|
||||
@implementation NativeImagePicker
|
||||
|
||||
- (NSString*) getFileName:(NSURL *) ns_url {
|
||||
// Return the file name without the path or file extention
|
||||
NSString *image_name = ns_url.pathComponents.lastObject;
|
||||
NSArray *listItems = [image_name componentsSeparatedByString:@"."];
|
||||
NSString *ret = listItems[0];
|
||||
return ret;
|
||||
}
|
||||
|
||||
- (NSString*) writeToPNG: (NSDictionary *) info {
|
||||
/* Given the info frozen dictionary returned by the file picker, convert
|
||||
the image selected to a PNG and return the full path. */
|
||||
|
||||
// Get the image name, stripped of path and extention
|
||||
NSString *image_name = [self getFileName: info[UIImagePickerControllerImageURL]];
|
||||
|
||||
// Get the png representation of the image
|
||||
UIImage *image = info[UIImagePickerControllerOriginalImage];
|
||||
NSData *imageData = UIImagePNGRepresentation(image);
|
||||
|
||||
// Generate the final image destination
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
NSString *documentsDirectory = [paths objectAtIndex:0];
|
||||
NSString *imagePath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png", image_name]];
|
||||
|
||||
// Write the image data to the file
|
||||
if (![imageData writeToFile:imagePath atomically:NO])
|
||||
{
|
||||
NSLog(@"Failed to cache image data to disk");
|
||||
return @"";
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"the cachedImagedPath is %@",imagePath);
|
||||
return imagePath;
|
||||
}
|
||||
}
|
||||
@end
|
|
@ -1,163 +0,0 @@
|
|||
/*
|
||||
* iOS utils
|
||||
*
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <sys/utsname.h>
|
||||
#include "ios_wrapper.h"
|
||||
|
||||
|
||||
float ios_uiscreen_get_scale() {
|
||||
float scale = 1.0;
|
||||
if ([[UIScreen mainScreen] respondsToSelector:@selector(nativeScale)]) {
|
||||
scale = [[UIScreen mainScreen] nativeScale];
|
||||
};
|
||||
return scale;
|
||||
}
|
||||
|
||||
int ios_uiscreen_get_dpi() {
|
||||
/*
|
||||
* dpi function from src/video/uikit/SDL_uikitmodes.m (SDL2)
|
||||
*/
|
||||
|
||||
/*
|
||||
* A well up to date list of device info can be found here:
|
||||
* https://github.com/lmirosevic/GBDeviceInfo/blob/master/GBDeviceInfo/GBDeviceInfo_iOS.m
|
||||
*/
|
||||
NSDictionary* devices = @{
|
||||
@"iPhone1,1": @163,
|
||||
@"iPhone1,2": @163,
|
||||
@"iPhone2,1": @163,
|
||||
@"iPhone3,1": @326,
|
||||
@"iPhone3,2": @326,
|
||||
@"iPhone3,3": @326,
|
||||
@"iPhone4,1": @326,
|
||||
@"iPhone5,1": @326,
|
||||
@"iPhone5,2": @326,
|
||||
@"iPhone5,3": @326,
|
||||
@"iPhone5,4": @326,
|
||||
@"iPhone6,1": @326,
|
||||
@"iPhone6,2": @326,
|
||||
@"iPhone7,1": @401,
|
||||
@"iPhone7,2": @326,
|
||||
@"iPhone8,1": @326,
|
||||
@"iPhone8,2": @401,
|
||||
@"iPhone8,4": @326,
|
||||
@"iPhone9,1": @326,
|
||||
@"iPhone9,2": @401,
|
||||
@"iPhone9,3": @326,
|
||||
@"iPhone9,4": @401,
|
||||
@"iPhone10,1": @326,
|
||||
@"iPhone10,2": @401,
|
||||
@"iPhone10,3": @458,
|
||||
@"iPhone10,4": @326,
|
||||
@"iPhone10,5": @401,
|
||||
@"iPhone10,6": @458,
|
||||
@"iPhone11,2": @458,
|
||||
@"iPhone11,4": @458,
|
||||
@"iPhone11,6": @458,
|
||||
@"iPhone11,8": @326,
|
||||
@"iPhone12,1": @326,
|
||||
@"iPhone12,3": @458,
|
||||
@"iPhone12,5": @458,
|
||||
@"iPad1,1": @132,
|
||||
@"iPad2,1": @132,
|
||||
@"iPad2,2": @132,
|
||||
@"iPad2,3": @132,
|
||||
@"iPad2,4": @132,
|
||||
@"iPad2,5": @163,
|
||||
@"iPad2,6": @163,
|
||||
@"iPad2,7": @163,
|
||||
@"iPad3,1": @264,
|
||||
@"iPad3,2": @264,
|
||||
@"iPad3,3": @264,
|
||||
@"iPad3,4": @264,
|
||||
@"iPad3,5": @264,
|
||||
@"iPad3,6": @264,
|
||||
@"iPad4,1": @264,
|
||||
@"iPad4,2": @264,
|
||||
@"iPad4,3": @264,
|
||||
@"iPad4,4": @326,
|
||||
@"iPad4,5": @326,
|
||||
@"iPad4,6": @326,
|
||||
@"iPad4,7": @326,
|
||||
@"iPad4,8": @326,
|
||||
@"iPad4,9": @326,
|
||||
@"iPad5,1": @326,
|
||||
@"iPad5,2": @326,
|
||||
@"iPad5,3": @264,
|
||||
@"iPad5,4": @264,
|
||||
@"iPad6,3": @264,
|
||||
@"iPad6,4": @264,
|
||||
@"iPad6,7": @264,
|
||||
@"iPad6,8": @264,
|
||||
@"iPad6,11": @264,
|
||||
@"iPad6,12": @264,
|
||||
@"iPad7,1": @264,
|
||||
@"iPad7,2": @264,
|
||||
@"iPad7,3": @264,
|
||||
@"iPad7,4": @264,
|
||||
@"iPad7,5": @264,
|
||||
@"iPad7,6": @264,
|
||||
@"iPad7,11": @264,
|
||||
@"iPad7,12": @264,
|
||||
@"iPad8,1": @264,
|
||||
@"iPad8,2": @264,
|
||||
@"iPad8,3": @264,
|
||||
@"iPad8,4": @264,
|
||||
@"iPad8,5": @264,
|
||||
@"iPad8,6": @264,
|
||||
@"iPad8,7": @264,
|
||||
@"iPad8,8": @264,
|
||||
@"iPad11,1": @326,
|
||||
@"iPad11,2": @326,
|
||||
@"iPad11,3": @326,
|
||||
@"iPad11,4": @326,
|
||||
@"iPod1,1": @163,
|
||||
@"iPod2,1": @163,
|
||||
@"iPod3,1": @163,
|
||||
@"iPod4,1": @326,
|
||||
@"iPod5,1": @326,
|
||||
@"iPod7,1": @326,
|
||||
@"iPod9,1": @326,
|
||||
};
|
||||
struct utsname systemInfo;
|
||||
uname(&systemInfo);
|
||||
NSString* deviceName = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
|
||||
id foundDPI = devices[deviceName];
|
||||
if (foundDPI) {
|
||||
return (float)[foundDPI integerValue];
|
||||
} else {
|
||||
/*
|
||||
* Estimate the DPI based on the screen scale multiplied by the base DPI for the device
|
||||
* type (e.g. based on iPhone 1 and iPad 1)
|
||||
*/
|
||||
float scale = ios_uiscreen_get_scale();
|
||||
float dpi = 160 * scale;
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||
dpi = 132 * scale;
|
||||
} else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
|
||||
dpi = 163 * scale;
|
||||
}
|
||||
return dpi;
|
||||
}
|
||||
}
|
||||
|
||||
padding ios_get_safe_area() {
|
||||
padding safearea;
|
||||
if (@available(iOS 11.0, *)){
|
||||
UIWindow *window = UIApplication.sharedApplication.windows[0];
|
||||
safearea.top = window.safeAreaInsets.top;
|
||||
safearea.bottom = window.safeAreaInsets.bottom;
|
||||
safearea.left = window.safeAreaInsets.left;
|
||||
safearea.right = window.safeAreaInsets.right;
|
||||
} else {
|
||||
safearea.top = 0;
|
||||
safearea.bottom = 0;
|
||||
safearea.left = 0;
|
||||
safearea.right = 0;
|
||||
}
|
||||
return safearea;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
from distutils.core import setup, Extension
|
||||
|
||||
|
||||
setup(name='ios',
|
||||
version='1.1',
|
||||
ext_modules=[
|
||||
Extension('ios',
|
||||
['ios.c', 'ios_utils.m', 'ios_mail.m', 'ios_browser.m',
|
||||
'ios_filechooser.m'],
|
||||
libraries=[],
|
||||
library_dirs=[],
|
||||
)
|
||||
]
|
||||
)
|
|
@ -1,58 +0,0 @@
|
|||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh, os
|
||||
|
||||
class LbryRecipe(PythonRecipe):
|
||||
version = "v0.82.0"
|
||||
url = "https://github.com/lbryio/lbry/archive/{version}.tar.gz"
|
||||
depends = [
|
||||
"openssl",
|
||||
"python",
|
||||
"ios",
|
||||
"pyobjus",
|
||||
"sdl2",
|
||||
"setuptools",
|
||||
|
||||
# install_requires dependencies
|
||||
"aiohttp",
|
||||
"aioupnp",
|
||||
"appdirs",
|
||||
"async-timeout",
|
||||
"base58",
|
||||
"certifi",
|
||||
"chardet",
|
||||
"coincurve",
|
||||
"colorama",
|
||||
"cryptography",
|
||||
"defusedxml",
|
||||
"docopt",
|
||||
"ecdsa",
|
||||
"hachoir",
|
||||
"keyring",
|
||||
"mock",
|
||||
"msgpack",
|
||||
"pbkdf2",
|
||||
"prometheus_client",
|
||||
"protobuf",
|
||||
"pylru",
|
||||
"pyyaml",
|
||||
"six"
|
||||
]
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
if self.has_marker("patched"):
|
||||
return
|
||||
self.apply_patch("setup_override.patch")
|
||||
self.set_marker("patched")
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = LbryRecipe()
|
|
@ -1,33 +0,0 @@
|
|||
--- a/setup.py 2020-09-28 10:43:56.000000000 +0100
|
||||
+++ b/setup.py 2020-09-28 10:44:34.000000000 +0100
|
||||
@@ -32,29 +32,7 @@
|
||||
'orchstr8=lbry.wallet.orchstr8.cli:main',
|
||||
],
|
||||
},
|
||||
- install_requires=[
|
||||
- 'aiohttp==3.5.4',
|
||||
- 'aioupnp==0.0.17',
|
||||
- 'appdirs==1.4.3',
|
||||
- 'certifi>=2018.11.29',
|
||||
- 'colorama==0.3.7',
|
||||
- 'distro==1.4.0',
|
||||
- 'base58==1.0.0',
|
||||
- 'cffi==1.13.2',
|
||||
- 'cryptography==2.5',
|
||||
- 'protobuf==3.6.1',
|
||||
- 'msgpack==0.6.1',
|
||||
- 'prometheus_client==0.7.1',
|
||||
- 'ecdsa==0.13.3',
|
||||
- 'pyyaml==5.3.1',
|
||||
- 'docopt==0.6.2',
|
||||
- 'hachoir',
|
||||
- 'multidict==4.6.1',
|
||||
- 'coincurve==11.0.0',
|
||||
- 'pbkdf2==1.3',
|
||||
- 'attrs==18.2.0',
|
||||
- 'pylru==1.1.0'
|
||||
- ] + PLYVEL,
|
||||
+ install_requires=[],
|
||||
classifiers=[
|
||||
'Framework :: AsyncIO',
|
||||
'Intended Audience :: Developers',
|
|
@ -1,29 +0,0 @@
|
|||
from kivy_ios.toolchain import Recipe, shprint
|
||||
from os.path import join
|
||||
import sh
|
||||
|
||||
|
||||
class CurlRecipe(Recipe):
|
||||
version = "7.65.3"
|
||||
url = "https://curl.haxx.se/download/curl-{version}.tar.gz"
|
||||
library = "lib/.libs/libcurl.a"
|
||||
include_dir = "include"
|
||||
depends = ["openssl"]
|
||||
|
||||
def build_arch(self, arch):
|
||||
build_env = arch.get_env()
|
||||
configure = sh.Command(join(self.build_dir, "configure"))
|
||||
shprint(configure,
|
||||
"CC={}".format(build_env["CC"]),
|
||||
"LD={}".format(build_env["LD"]),
|
||||
"CFLAGS={}".format(build_env["CFLAGS"]),
|
||||
"LDFLAGS={}".format(build_env["LDFLAGS"]),
|
||||
"--prefix=/",
|
||||
"--host={}".format(arch.triple),
|
||||
"--disable-shared",
|
||||
"--without-libidn2")
|
||||
shprint(sh.make, "clean")
|
||||
shprint(sh.make, self.ctx.concurrent_make)
|
||||
|
||||
|
||||
recipe = CurlRecipe()
|
|
@ -1,12 +0,0 @@
|
|||
diff -Nru libffi-3.2.1/generate-darwin-source-and-headers.py libffi-3.2.1-new/generate-darwin-source-and-headers.py
|
||||
--- libffi-3.2.1/generate-darwin-source-and-headers.py 2014-11-08 13:47:24.000000000 +0100
|
||||
+++ libffi-3.2.1-new/generate-darwin-source-and-headers.py 2020-05-06 10:30:46.000000000 +0200
|
||||
@@ -194,7 +194,7 @@
|
||||
build_target(desktop64_platform, platform_headers)
|
||||
|
||||
mkdir_p('darwin_common/include')
|
||||
- for header_name, tag_tuples in platform_headers.iteritems():
|
||||
+ for header_name, tag_tuples in platform_headers.items():
|
||||
basename, suffix = os.path.splitext(header_name)
|
||||
with open(os.path.join('darwin_common/include', header_name), 'w') as header:
|
||||
for tag_tuple in tag_tuples:
|
|
@ -1,29 +0,0 @@
|
|||
from kivy_ios.toolchain import Recipe, shprint
|
||||
from os.path import join, exists
|
||||
from multiprocessing import cpu_count
|
||||
import sh
|
||||
|
||||
class LibSecp256k1Recipe(Recipe):
|
||||
version = 'b0452e6'
|
||||
url = 'https://github.com/bitcoin-core/secp256k1/archive/{version}.zip'
|
||||
library = '.libs/libsecp256k1.a'
|
||||
include_per_arch = True
|
||||
|
||||
def build_arch(self, arch):
|
||||
super(LibSecp256k1Recipe, self).build_arch(arch)
|
||||
env = self.get_recipe_env(arch)
|
||||
|
||||
if not exists(join(self.build_dir, "configure")):
|
||||
shprint(sh.Command('./autogen.sh'))
|
||||
shprint(
|
||||
sh.Command('./configure'),
|
||||
'--host=' + arch.triple,
|
||||
'--prefix=/',
|
||||
'--enable-module-recovery',
|
||||
'--enable-experimental',
|
||||
'--enable-module-ecdh',
|
||||
'--disable-shared',
|
||||
_env=env)
|
||||
shprint(sh.make, '-j' + str(cpu_count()), _env=env)
|
||||
|
||||
recipe = LibSecp256k1Recipe()
|
|
@ -1,58 +0,0 @@
|
|||
from kivy_ios.toolchain import Recipe, shprint
|
||||
from os.path import join
|
||||
import sh
|
||||
|
||||
|
||||
class LibZBarRecipe(Recipe):
|
||||
|
||||
version = '0.10'
|
||||
|
||||
url = 'https://github.com/ZBar/ZBar/archive/{version}.zip'
|
||||
|
||||
depends = ['hostpython3']
|
||||
|
||||
library = 'zbar/.libs/libzbar.a'
|
||||
|
||||
include_per_arch = True
|
||||
include_dir = [
|
||||
("include", "")
|
||||
]
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
if self.has_marker("patched"):
|
||||
return
|
||||
self.apply_patch("werror.patch")
|
||||
self.set_marker("patched")
|
||||
|
||||
def build_arch(self, arch):
|
||||
super(LibZBarRecipe, self).build_arch(arch)
|
||||
build_env = arch.get_env()
|
||||
build_env["CFLAGS"] = " ".join([
|
||||
"-I{}".format(join(self.ctx.dist_dir, "build", "libiconv", arch.arch)) +
|
||||
" -arch {}".format(arch.arch), build_env['CFLAGS']
|
||||
])
|
||||
shprint(sh.Command('autoreconf'), '-vif')
|
||||
shprint(
|
||||
sh.Command('./configure'),
|
||||
"CC={}".format(build_env["CC"]),
|
||||
"LD={}".format(build_env["LD"]),
|
||||
"CFLAGS={}".format(build_env["CFLAGS"]),
|
||||
"LDFLAGS={}".format(build_env["LDFLAGS"]),
|
||||
"--host={}".format(arch.triple),
|
||||
'--target={}'.format(arch.triple),
|
||||
# Python bindings are compiled in a separated recipe
|
||||
'--with-python=no',
|
||||
'--with-gtk=no',
|
||||
'--with-qt=no',
|
||||
'--with-x=no',
|
||||
'--with-jpeg=no',
|
||||
'--with-imagemagick=no',
|
||||
'--enable-pthread=no',
|
||||
'--enable-video=no',
|
||||
"--disable-shared",
|
||||
_env=build_env)
|
||||
shprint(sh.make, 'clean')
|
||||
shprint(sh.make, _env=build_env)
|
||||
|
||||
|
||||
recipe = LibZBarRecipe()
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/configure.ac b/configure.ac
|
||||
index 256aedb..727caba 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3,7 +3,7 @@ AC_PREREQ([2.61])
|
||||
AC_INIT([zbar], [0.10], [spadix@users.sourceforge.net])
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
AC_CONFIG_MACRO_DIR(config)
|
||||
-AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects std-options dist-bzip2])
|
||||
+AM_INIT_AUTOMAKE([1.10 -Wall foreign subdir-objects std-options dist-bzip2])
|
||||
AC_CONFIG_HEADERS([include/config.h])
|
||||
AC_CONFIG_SRCDIR(zbar/scanner.c)
|
||||
LT_PREREQ([2.2])
|
|
@ -1,23 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class MockRecipe(PythonRecipe):
|
||||
version = "4.0.2"
|
||||
url = "https://pypi.python.org/packages/source/m/mock/mock-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = MockRecipe()
|
|
@ -1,23 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class MsgpackRecipe(PythonRecipe):
|
||||
version = "0.6.1"
|
||||
url = "https://pypi.python.org/packages/source/m/msgpack/msgpack-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = MsgpackRecipe()
|
|
@ -1,22 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class MultidictRecipe(PythonRecipe):
|
||||
version = "4.5.2"
|
||||
url = "https://pypi.python.org/packages/source/m/multidict/multidict-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = MultidictRecipe()
|
|
@ -1,43 +0,0 @@
|
|||
import sh
|
||||
|
||||
from os.path import join
|
||||
|
||||
from kivy_ios.toolchain import CythonRecipe, shprint
|
||||
from kivy_ios.context_managers import cd
|
||||
|
||||
|
||||
class NetifacesRecipe(CythonRecipe):
|
||||
version = "0.10.9"
|
||||
url = "https://pypi.io/packages/source/n/netifaces/netifaces-{version}.tar.gz"
|
||||
depends = ["python3", "host_setuptools3"]
|
||||
python_depends = ["setuptools"]
|
||||
library = "libnetifaces.a"
|
||||
cythonize = False
|
||||
|
||||
def dest_dir(self):
|
||||
return join(self.ctx.dist_dir, "root", "python3")
|
||||
|
||||
def get_netifaces_env(self, arch):
|
||||
build_env = arch.get_env()
|
||||
build_env["PYTHONPATH"] = join(
|
||||
self.dest_dir(), "lib", "python3.8", "site-packages"
|
||||
)
|
||||
return build_env
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
build_env = self.get_netifaces_env(arch)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
with cd(build_dir):
|
||||
shprint(
|
||||
hostpython,
|
||||
"setup.py",
|
||||
"install",
|
||||
"--prefix",
|
||||
self.dest_dir(),
|
||||
_env=build_env,
|
||||
)
|
||||
|
||||
|
||||
recipe = NetifacesRecipe()
|
|
@ -1,128 +0,0 @@
|
|||
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
|
||||
index aad0aae43..407e64fe3 100644
|
||||
--- a/numpy/core/setup.py
|
||||
+++ b/numpy/core/setup.py
|
||||
@@ -757,7 +757,9 @@ def configuration(parent_package='',top_path=None):
|
||||
join('src', 'common', 'numpyos.c'),
|
||||
]
|
||||
|
||||
- blas_info = get_info('blas_opt', 0)
|
||||
+ # XXX IOS, no blas available
|
||||
+ # blas_info = get_info('blas_opt', 0)
|
||||
+ blas_info = None
|
||||
if blas_info and ('HAVE_CBLAS', None) in blas_info.get('define_macros', []):
|
||||
extra_info = blas_info
|
||||
# These files are also in MANIFEST.in so that they are always in
|
||||
@@ -822,7 +824,10 @@ def configuration(parent_package='',top_path=None):
|
||||
join('include', 'numpy', 'npy_1_7_deprecated_api.h'),
|
||||
# add library sources as distuils does not consider libraries
|
||||
# dependencies
|
||||
- ] + npysort_sources + npymath_sources
|
||||
+
|
||||
+ # XXX This breaks for iOS, it results on duplicate symbols
|
||||
+ # ] + npysort_sources + npymath_sources
|
||||
+ ] #+ npysort_sources + npymath_sources
|
||||
|
||||
multiarray_src = [
|
||||
join('src', 'multiarray', 'alloc.c'),
|
||||
@@ -921,7 +926,7 @@ def configuration(parent_package='',top_path=None):
|
||||
|
||||
config.add_extension('_multiarray_umath',
|
||||
sources=multiarray_src + umath_src +
|
||||
- npymath_sources + common_src +
|
||||
+ common_src +
|
||||
[generate_config_h,
|
||||
generate_numpyconfig_h,
|
||||
generate_numpy_api,
|
||||
diff --git a/numpy/linalg/lapack_lite/python_xerbla.c b/numpy/linalg/lapack_lite/python_xerbla.c
|
||||
index dfc195556..7110d1fc3 100644
|
||||
--- a/numpy/linalg/lapack_lite/python_xerbla.c
|
||||
+++ b/numpy/linalg/lapack_lite/python_xerbla.c
|
||||
@@ -20,7 +20,7 @@
|
||||
info: Number of the invalid parameter.
|
||||
*/
|
||||
|
||||
-int xerbla_(char *srname, integer *info)
|
||||
+int custom_xerbla_(char *srname, integer *info)
|
||||
{
|
||||
static const char format[] = "On entry to %.*s" \
|
||||
" parameter number %d had an illegal value";
|
||||
diff --git a/numpy/linalg/lapack_litemodule.c b/numpy/linalg/lapack_litemodule.c
|
||||
index 696a6d874..d187ad2d1 100644
|
||||
--- a/numpy/linalg/lapack_litemodule.c
|
||||
+++ b/numpy/linalg/lapack_litemodule.c
|
||||
@@ -45,7 +45,7 @@ extern int FNAME(zungqr)(int *m, int *n, int *k, f2c_doublecomplex a[],
|
||||
int *lda, f2c_doublecomplex tau[],
|
||||
f2c_doublecomplex work[], int *lwork, int *info);
|
||||
|
||||
-extern int FNAME(xerbla)(char *srname, int *info);
|
||||
+extern int FNAME(custom_xerbla)(char *srname, int *info);
|
||||
|
||||
static PyObject *LapackError;
|
||||
|
||||
@@ -291,7 +291,7 @@ lapack_lite_xerbla(PyObject *NPY_UNUSED(self), PyObject *args)
|
||||
|
||||
NPY_BEGIN_THREADS_DEF;
|
||||
NPY_BEGIN_THREADS;
|
||||
- FNAME(xerbla)("test", &info);
|
||||
+ FNAME(custom_xerbla)("test", &info);
|
||||
NPY_END_THREADS;
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
diff --git a/numpy/linalg/setup.py b/numpy/linalg/setup.py
|
||||
index 66c07c9e1..6f81243be 100644
|
||||
--- a/numpy/linalg/setup.py
|
||||
+++ b/numpy/linalg/setup.py
|
||||
@@ -48,7 +48,7 @@ def configuration(parent_package='', top_path=None):
|
||||
# umath_linalg module
|
||||
config.add_extension(
|
||||
'_umath_linalg',
|
||||
- sources=['umath_linalg.c.src', get_lapack_lite_sources],
|
||||
+ sources=['umath_linalg.c.src', lambda e, b: []],
|
||||
depends=['lapack_lite/f2c.h'],
|
||||
extra_info=lapack_info,
|
||||
libraries=['npymath'],
|
||||
diff --git a/numpy/linalg/umath_linalg.c.src b/numpy/linalg/umath_linalg.c.src
|
||||
index 9fc68a7aa..270c9bc32 100644
|
||||
--- a/numpy/linalg/umath_linalg.c.src
|
||||
+++ b/numpy/linalg/umath_linalg.c.src
|
||||
@@ -68,6 +68,8 @@ dbg_stack_trace()
|
||||
# define FNAME(x) x##_
|
||||
#endif
|
||||
|
||||
+# define FNAME_APPLE(x) cblas_##x
|
||||
+
|
||||
typedef struct { float r, i; } f2c_complex;
|
||||
typedef struct { double r, i; } f2c_doublecomplex;
|
||||
/* typedef long int (*L_fp)(); */
|
||||
@@ -284,21 +286,25 @@ FNAME(zpotri)(char *uplo, int *n,
|
||||
int *info);
|
||||
|
||||
extern int
|
||||
-FNAME(scopy)(int *n,
|
||||
+FNAME_APPLE(scopy)(int *n,
|
||||
float *sx, int *incx,
|
||||
float *sy, int *incy);
|
||||
+#define scopy_ FNAME_APPLE(scopy)
|
||||
extern int
|
||||
-FNAME(dcopy)(int *n,
|
||||
+FNAME_APPLE(dcopy)(int *n,
|
||||
double *sx, int *incx,
|
||||
double *sy, int *incy);
|
||||
+#define dcopy_ FNAME_APPLE(dcopy)
|
||||
extern int
|
||||
-FNAME(ccopy)(int *n,
|
||||
+FNAME_APPLE(ccopy)(int *n,
|
||||
f2c_complex *sx, int *incx,
|
||||
f2c_complex *sy, int *incy);
|
||||
+#define ccopy_ FNAME_APPLE(ccopy)
|
||||
extern int
|
||||
-FNAME(zcopy)(int *n,
|
||||
+FNAME_APPLE(zcopy)(int *n,
|
||||
f2c_doublecomplex *sx, int *incx,
|
||||
- f2c_doublecomplex *sy, int *incy);
|
||||
+ f2c_doublecomplex *sy, int *incy);
|
||||
+#define zcopy_ FNAME_APPLE(zcopy)
|
||||
|
||||
extern float
|
||||
FNAME(sdot)(int *n,
|
|
@ -1,36 +0,0 @@
|
|||
from kivy_ios.toolchain import Recipe, shprint
|
||||
from os.path import join
|
||||
import sh
|
||||
|
||||
|
||||
arch_mapper = {'i386': 'darwin-i386-cc',
|
||||
'x86_64': 'darwin64-x86_64-cc',
|
||||
'armv7': 'ios-cross',
|
||||
'arm64': 'ios64-cross'}
|
||||
|
||||
|
||||
class OpensslRecipe(Recipe):
|
||||
version = "1.1.1f"
|
||||
url = "http://www.openssl.org/source/openssl-{version}.tar.gz"
|
||||
libraries = ["libssl.a", "libcrypto.a"]
|
||||
include_dir = "include"
|
||||
include_per_arch = True
|
||||
|
||||
def build_arch(self, arch):
|
||||
build_env = arch.get_env()
|
||||
target = arch_mapper[arch.arch]
|
||||
shprint(sh.env, _env=build_env)
|
||||
sh.perl(join(self.build_dir, "Configure"),
|
||||
target,
|
||||
_env=build_env)
|
||||
if target.endswith('-cross'):
|
||||
with open('Makefile', 'r') as makefile:
|
||||
filedata = makefile.read()
|
||||
filedata = filedata.replace('$(CROSS_TOP)/SDKs/$(CROSS_SDK)', arch.sysroot)
|
||||
with open('Makefile', 'w') as makefile:
|
||||
makefile.write(filedata)
|
||||
shprint(sh.make, "clean")
|
||||
shprint(sh.make, self.ctx.concurrent_make, "build_libs")
|
||||
|
||||
|
||||
recipe = OpensslRecipe()
|
|
@ -1,23 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class PrometheusClientRecipe(PythonRecipe):
|
||||
version = "0.8.0"
|
||||
url = "https://pypi.python.org/packages/source/p/prometheus_client/prometheus_client-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = PrometheusClientRecipe()
|
|
@ -1,23 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class PycparserRecipe(PythonRecipe):
|
||||
version = "2.20"
|
||||
url = "https://pypi.python.org/packages/source/p/pycparser/pycparser-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = PycparserRecipe()
|
|
@ -1,23 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class PylruRecipe(PythonRecipe):
|
||||
version = "1.2.0"
|
||||
url = "https://pypi.python.org/packages/source/p/pylru/pylru-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = PylruRecipe()
|
|
@ -1,24 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from kivy_ios.toolchain import Recipe
|
||||
import logging
|
||||
from os.path import join
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PythonAliasRecipe(Recipe):
|
||||
"""
|
||||
Note this recipe was created to handle both python2 and python3.
|
||||
As python2 support was dropped, this could probably be simplified.
|
||||
"""
|
||||
is_alias = True
|
||||
|
||||
def init_after_import(self, ctx):
|
||||
python = ctx.state.get("python")
|
||||
if not python:
|
||||
python = "python3"
|
||||
self.depends = [python]
|
||||
self.recipe_dir = join(ctx.root_dir, "recipes", python)
|
||||
|
||||
|
||||
recipe = PythonAliasRecipe()
|
|
@ -1,31 +0,0 @@
|
|||
diff -Naur Python-3.8.2.orig/.building Python-3.8.2/.building
|
||||
--- Python-3.8.2.orig/.building 2020-04-11 23:53:30.000000000 +0200
|
||||
+++ Python-3.8.2/.building 1970-01-01 01:00:00.000000000 +0100
|
||||
@@ -1 +0,0 @@
|
||||
-ok
|
||||
\ No newline at end of file
|
||||
diff -Naur Python-3.8.2.orig/config.sub Python-3.8.2/config.sub
|
||||
--- Python-3.8.2.orig/config.sub 2020-04-11 23:53:40.000000000 +0200
|
||||
+++ Python-3.8.2/config.sub 2020-04-11 23:51:41.000000000 +0200
|
||||
@@ -249,7 +249,7 @@
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arceb \
|
||||
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \
|
||||
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][armk] \
|
||||
| avr | avr32 \
|
||||
| ba \
|
||||
| be32 | be64 \
|
||||
@@ -1524,7 +1524,11 @@
|
||||
;;
|
||||
-nacl*)
|
||||
;;
|
||||
- -ios)
|
||||
+ -ios*)
|
||||
+ ;;
|
||||
+ -tvos*)
|
||||
+ ;;
|
||||
+ -watchos*)
|
||||
;;
|
||||
-none)
|
||||
;;
|
|
@ -1,90 +0,0 @@
|
|||
diff -Naur Python-3.8.2.orig/configure Python-3.8.2/configure
|
||||
--- Python-3.8.2.orig/configure 2020-04-12 00:00:42.000000000 +0200
|
||||
+++ Python-3.8.2/configure 2020-04-12 00:08:45.000000000 +0200
|
||||
@@ -3271,6 +3271,15 @@
|
||||
*-*-cygwin*)
|
||||
ac_sys_system=Cygwin
|
||||
;;
|
||||
+ *-apple-ios)
|
||||
+ ac_sys_system=iOS
|
||||
+ ;;
|
||||
+ *-apple-tvos)
|
||||
+ ac_sys_system=tvOS
|
||||
+ ;;
|
||||
+ *-apple-watchos)
|
||||
+ ac_sys_system=watchOS
|
||||
+ ;;
|
||||
*-*-vxworks*)
|
||||
ac_sys_system=VxWorks
|
||||
;;
|
||||
@@ -3318,6 +3327,15 @@
|
||||
_host_cpu=$host_cpu
|
||||
esac
|
||||
;;
|
||||
+ *-apple-*)
|
||||
+ case "$host_cpu" in
|
||||
+ arm*)
|
||||
+ _host_cpu=arm
|
||||
+ ;;
|
||||
+ *)
|
||||
+ _host_cpu=$host_cpu
|
||||
+ esac
|
||||
+ ;;
|
||||
*-*-cygwin*)
|
||||
_host_cpu=
|
||||
;;
|
||||
@@ -3396,6 +3414,13 @@
|
||||
define_xopen_source=no;;
|
||||
Darwin/1[0-9].*)
|
||||
define_xopen_source=no;;
|
||||
+ # On iOS, defining _POSIX_C_SOURCE also disables platform specific features.
|
||||
+ iOS/*)
|
||||
+ define_xopen_source=no;;
|
||||
+ tvOS/*)
|
||||
+ define_xopen_source=no;;
|
||||
+ watchOS/*)
|
||||
+ define_xopen_source=no;;
|
||||
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
|
||||
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
|
||||
# or has another value. By not (re)defining it, the defaults come in place.
|
||||
@@ -6165,10 +6190,16 @@
|
||||
fi
|
||||
|
||||
if test "$cross_compiling" = yes; then
|
||||
- case "$READELF" in
|
||||
- readelf|:)
|
||||
- as_fn_error $? "readelf for the host is required for cross builds" "$LINENO" 5
|
||||
- ;;
|
||||
+ case "$host" in
|
||||
+ *-apple-*os)
|
||||
+ # readelf not required for iOS cross builds.
|
||||
+ ;;
|
||||
+ *)
|
||||
+ case "$READELF" in
|
||||
+ readelf|:)
|
||||
+ as_fn_error $? "readelf for the host is required for cross builds" "$LINENO" 5
|
||||
+ ;;
|
||||
+ esac
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -6920,8 +6951,6 @@
|
||||
# tweak BASECFLAGS based on compiler and platform
|
||||
case $GCC in
|
||||
yes)
|
||||
- CFLAGS_NODIST="$CFLAGS_NODIST -std=c99"
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wextra" >&5
|
||||
$as_echo_n "checking for -Wextra... " >&6; }
|
||||
ac_save_cc="$CC"
|
||||
@@ -11438,6 +11467,10 @@
|
||||
;;
|
||||
hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
|
||||
+ # Dynamic loading on iOS
|
||||
+ iOS/*) DYNLOADFILE="dynload_shlib.o";;
|
||||
+ tvOS/*) DYNLOADFILE="dynload_shlib.o";;
|
||||
+ watchOS/*) DYNLOADFILE="dynload_shlib.o";;
|
||||
*)
|
||||
# use dynload_shlib.c and dlopen() if we have it; otherwise stub
|
||||
# out any dynamic loading
|
||||
if test "$ac_cv_func_dlopen" = yes
|
|
@ -1,19 +0,0 @@
|
|||
diff -Naur Python-3.8.2.orig/Modules/_ctypes/cfield.c Python-3.8.2/Modules/_ctypes/cfield.c
|
||||
--- Python-3.8.2.orig/Modules/_ctypes/cfield.c 2020-04-13 12:23:46.000000000 +0200
|
||||
+++ Python-3.8.2/Modules/_ctypes/cfield.c 2020-04-13 12:24:45.000000000 +0200
|
||||
@@ -1636,7 +1636,7 @@
|
||||
struct _ffi_type **elements;
|
||||
} ffi_type;
|
||||
*/
|
||||
-
|
||||
+#if 0
|
||||
/* align and size are bogus for void, but they must not be zero */
|
||||
ffi_type ffi_type_void = { 1, 1, FFI_TYPE_VOID };
|
||||
|
||||
@@ -1663,5 +1663,5 @@
|
||||
FFI_TYPE_LONGDOUBLE };
|
||||
|
||||
ffi_type ffi_type_pointer = { sizeof(void *), VOID_P_ALIGN, FFI_TYPE_POINTER };
|
||||
-
|
||||
+#endif
|
||||
/*---------------- EOF ----------------*/
|
|
@ -1,12 +0,0 @@
|
|||
diff -Naur Python-3.8.2.orig/Modules/_blake2/impl/blake2-impl.h Python-3.8.2/Modules/_blake2/impl/blake2-impl.h
|
||||
--- Python-3.8.2.orig/Modules/_blake2/impl/blake2-impl.h 2020-04-12 01:20:03.000000000 +0200
|
||||
+++ Python-3.8.2/Modules/_blake2/impl/blake2-impl.h 2020-04-12 01:21:11.000000000 +0200
|
||||
@@ -26,6 +26,8 @@
|
||||
#define BLAKE2_IMPL_EVAL(x,y) BLAKE2_IMPL_CAT(x,y)
|
||||
#define BLAKE2_IMPL_NAME(fun) BLAKE2_IMPL_EVAL(fun, SUFFIX)
|
||||
|
||||
+#undef HAVE_EXPLICIT_BZERO
|
||||
+#undef HAVE_EXPLICIT_MEMSET
|
||||
static inline uint32_t load32( const void *src )
|
||||
{
|
||||
#if defined(NATIVE_LITTLE_ENDIAN)
|
|
@ -1,34 +0,0 @@
|
|||
--- a/Modules/mmapmodule.c 2020-09-28 21:41:42.000000000 +0100
|
||||
+++ b/Modules/mmapmodule.c 2020-09-28 21:42:35.000000000 +0100
|
||||
@@ -527,11 +527,11 @@
|
||||
#endif /* MS_WINDOWS */
|
||||
|
||||
#ifdef UNIX
|
||||
-#ifndef HAVE_MREMAP
|
||||
+//#ifndef HAVE_MREMAP
|
||||
PyErr_SetString(PyExc_SystemError,
|
||||
"mmap: resizing not available--no mremap()");
|
||||
return NULL;
|
||||
-#else
|
||||
+/*#else
|
||||
void *newmap;
|
||||
|
||||
if (self->fd != -1 && ftruncate(self->fd, self->offset + new_size) == -1) {
|
||||
@@ -546,7 +546,7 @@
|
||||
newmap = mremap(self->data, self->size, self->data, new_size, 0);
|
||||
#else
|
||||
newmap = mremap(self->data, self->size, new_size, 0);
|
||||
-#endif /* __NetBSD__ */
|
||||
+#endif
|
||||
#endif
|
||||
if (newmap == (void *)-1)
|
||||
{
|
||||
@@ -556,7 +556,7 @@
|
||||
self->data = newmap;
|
||||
self->size = new_size;
|
||||
Py_RETURN_NONE;
|
||||
-#endif /* HAVE_MREMAP */
|
||||
+#endif */
|
||||
#endif /* UNIX */
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
__version__ = 'kivy-ios'
|
||||
from ._sqlite3 import * # noqa: F401, F403
|
|
@ -1,31 +0,0 @@
|
|||
diff -Naur Python-3.8.2.orig/Modules/posixmodule.c Python-3.8.2/Modules/posixmodule.c
|
||||
--- Python-3.8.2.orig/Modules/posixmodule.c 2020-04-12 00:11:47.000000000 +0200
|
||||
+++ Python-3.8.2/Modules/posixmodule.c 2020-04-12 00:13:21.000000000 +0200
|
||||
@@ -216,6 +216,27 @@
|
||||
#endif /* _MSC_VER */
|
||||
#endif /* ! __WATCOMC__ || __QNX__ */
|
||||
|
||||
+// iOS
|
||||
+#undef HAVE_EXECV
|
||||
+#undef HAVE_FORK
|
||||
+#undef HAVE_FORK1
|
||||
+#undef HAVE_FORKPTY
|
||||
+#undef HAVE_GETGROUPS
|
||||
+#undef HAVE_SCHED_H
|
||||
+#undef HAVE_SENDFILE
|
||||
+#undef HAVE_SETPRIORITY
|
||||
+#undef HAVE_SPAWNV
|
||||
+#undef HAVE_WAIT
|
||||
+#undef HAVE_WAIT3
|
||||
+#undef HAVE_WAIT4
|
||||
+#undef HAVE_WAITPID
|
||||
+#undef HAVE_SYSTEM
|
||||
+#undef HAVE_FEXECVE
|
||||
+#undef HAVE_RTPSPAWN
|
||||
+#undef HAVE_POSIX_SPAWN
|
||||
+#undef HAVE_POSIX_SPAWNP
|
||||
+#undef HAVE_FDWALK
|
||||
+#undef HAVE_COPY_FILE_RANGE
|
||||
|
||||
/*[clinic input]
|
||||
# one of the few times we lie about this name!
|
|
@ -1,25 +0,0 @@
|
|||
diff -Nru Python-3.8.2/Lib/site.py Python-3.8.2-new/Lib/site.py
|
||||
--- Python-3.8.2/Lib/site.py 2020-02-24 22:36:25.000000000 +0100
|
||||
+++ Python-3.8.2-new/Lib/site.py 2020-05-01 17:10:43.000000000 +0200
|
||||
@@ -458,9 +458,8 @@
|
||||
|
||||
env = os.environ
|
||||
if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in env:
|
||||
- executable = sys._base_executable = os.environ['__PYVENV_LAUNCHER__']
|
||||
- else:
|
||||
- executable = sys.executable
|
||||
+ print("Ignoring __PYVENV_LAUNCHER__")
|
||||
+ executable = sys.executable
|
||||
exe_dir, _ = os.path.split(os.path.abspath(executable))
|
||||
site_prefix = os.path.dirname(exe_dir)
|
||||
sys._home = None
|
||||
@@ -487,7 +486,8 @@
|
||||
if key == 'include-system-site-packages':
|
||||
system_site = value.lower()
|
||||
elif key == 'home':
|
||||
- sys._home = value
|
||||
+ # this is breaking pyconfig.h path detection with venv
|
||||
+ print('Ignoring "sys._home = value" override')
|
||||
|
||||
sys.prefix = sys.exec_prefix = site_prefix
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class SetuptoolsRecipe(PythonRecipe):
|
||||
version = "41.0.0"
|
||||
url = "https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.zip"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = SetuptoolsRecipe()
|
|
@ -1,22 +0,0 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
|
||||
|
||||
class YarlRecipe(PythonRecipe):
|
||||
version = "1.3.0"
|
||||
url = "https://pypi.python.org/packages/source/y/yarl/yarl-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = os.path.join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = os.path.join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = YarlRecipe()
|
|
@ -1,72 +0,0 @@
|
|||
import os
|
||||
from kivy_ios.toolchain import Recipe
|
||||
from os.path import join
|
||||
import sh
|
||||
import fnmatch
|
||||
from distutils.dir_util import copy_tree
|
||||
|
||||
|
||||
class ZbarLightRecipe(Recipe):
|
||||
version = '1.2'
|
||||
url = 'https://github.com/Polyconseil/zbarlight/archive/{version}.tar.gz'
|
||||
library = "zbarlight.a"
|
||||
depends = ['hostpython3', 'python3', 'libzbar']
|
||||
pbx_libraries = ["libz", "libbz2", 'libc++', 'libsqlite3', 'CoreMotion']
|
||||
include_per_arch = True
|
||||
|
||||
def get_zbar_env(self, arch):
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env["IOSROOT"] = self.ctx.root_dir
|
||||
build_env["IOSSDKROOT"] = arch.sysroot
|
||||
build_env["LDSHARED"] = join(self.ctx.root_dir, "tools", "liblink")
|
||||
build_env["ARM_LD"] = build_env["LD"]
|
||||
build_env["ARCH"] = arch.arch
|
||||
build_env["C_INCLUDE_PATH"] = join(arch.sysroot, "usr", "include")
|
||||
build_env["LIBRARY_PATH"] = join(arch.sysroot, "usr", "lib")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||
build_env["CFLAGS"] = " ".join([
|
||||
" -I{}".format(join(self.ctx.dist_dir, "include", arch.arch, "libzbar", 'zbar')) +
|
||||
" -arch {}".format(arch.arch)
|
||||
])
|
||||
build_env['LDFLAGS'] += " -lios -lpython -lzbar"
|
||||
return build_env
|
||||
|
||||
def build_arch(self, arch):
|
||||
build_env = self.get_zbar_env(arch)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
shprint(hostpython, "setup.py", "build", # noqa: F821
|
||||
_env=build_env)
|
||||
self.apply_patch("zbarlight_1_2.patch") # Issue getting the version, hard coding for now
|
||||
self.biglink()
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = join(self.get_build_dir(arch.arch), 'build',
|
||||
'lib.macosx-10.13-x86_64-2.7', 'zbarlight')
|
||||
dist_dir = join(self.ctx.dist_dir, 'root', 'python3', 'lib',
|
||||
'python3.7', 'site-packages', 'zbarlight')
|
||||
# Patch before Copying
|
||||
# self.apply_patch("zbarlight_1_2.patch")#Issue getting the version, hard coding for now
|
||||
copy_tree(build_dir, dist_dir)
|
||||
os.remove(join(dist_dir, '_zbarlight.c'))
|
||||
|
||||
def _patch__init__(self):
|
||||
init = join(self.ctx.dist_dir, 'root', 'python3', 'lib', 'python3.7',
|
||||
'site-packages', 'zbarlight', "__init__.py")
|
||||
shprint( # noqa: F821
|
||||
sh.sed, "-i.bak",
|
||||
"s/__version__ = pkg_resources.get_distribution('zbarlight').version'"
|
||||
"/__version__ = '{version}'/g",
|
||||
init)
|
||||
|
||||
def biglink(self):
|
||||
dirs = []
|
||||
for root, dirnames, filenames in os.walk(self.build_dir):
|
||||
if fnmatch.filter(filenames, "*.so.libs"):
|
||||
dirs.append(root)
|
||||
cmd = sh.Command(join(self.ctx.root_dir, "tools", "biglink"))
|
||||
shprint(cmd, join(self.build_dir, "zbarlight.a"), *dirs) # noqa: F821
|
||||
|
||||
|
||||
recipe = ZbarLightRecipe()
|
|
@ -1,6 +0,0 @@
|
|||
--- zbarlight-1.2/build/lib.macosx-10.13-x86_64-2.7/zbarlight/__init__.py
|
||||
+++ zbarlight-1.2/build/lib.macosx-10.13-x86_64-2.7/zbarlight/__init__.py
|
||||
@@ -10,1 +10,1 @@
|
||||
-__version__ = pkg_resources.get_distribution('zbarlight').version
|
||||
+__version__ = '1.2'
|
||||
|
File diff suppressed because it is too large
Load diff
0
kivy_ios/tools/external/__init__.py
vendored
0
kivy_ios/tools/external/__init__.py
vendored
698
kivy_ios/tools/external/xcassets.py
vendored
698
kivy_ios/tools/external/xcassets.py
vendored
|
@ -1,698 +0,0 @@
|
|||
"""
|
||||
Icon and LaunchImage generator for iOS
|
||||
======================================
|
||||
|
||||
.. author:: Mathieu Virbel <mat@meltingrocks.com>
|
||||
"""
|
||||
# flake8: noqa (E121 mainly)
|
||||
|
||||
__all__ = ["launchimage"]
|
||||
|
||||
import sh
|
||||
import json
|
||||
from PIL import Image
|
||||
from os.path import join, exists
|
||||
from os import makedirs
|
||||
|
||||
appicon_json = {
|
||||
"images": [
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"size": "20x20",
|
||||
"scale": "2x",
|
||||
"filename": "Icon40.png"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone",
|
||||
"size": "20x20",
|
||||
"scale": "3x",
|
||||
"filename": "Icon60.png"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon29.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon58.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon87.png",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon80.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon120.png",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"size": "57x57",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon57.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "57x57",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon114.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon120.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "60x60",
|
||||
"idiom": "iphone",
|
||||
"filename": "Icon180.png",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "20x20",
|
||||
"filename": "Icon20.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad",
|
||||
"size": "20x20",
|
||||
"filename": "Icon40.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon29.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon58.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon40.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon80.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "50x50",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon50.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "50x50",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon100.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "72x72",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon72.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "72x72",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon144.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon76.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "76x76",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon152.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
# If activated, we got a submission error:
|
||||
# "Error ITMS-9000: Invalid Image Path - No image found at the path
|
||||
# referenced under key 'CFBundleIcons': 'AppIcon120x120'"
|
||||
# {
|
||||
# "size": "120x120",
|
||||
# "idiom": "car",
|
||||
# "filename": "Icon120.png",
|
||||
# "scale": "1x"
|
||||
# },
|
||||
{
|
||||
"size": "24x24",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"filename": "Icon48.png",
|
||||
"role": "notificationCenter",
|
||||
"subtype": "38mm"
|
||||
},
|
||||
{
|
||||
"size": "27.5x27.5",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"filename": "Icon55.png",
|
||||
"role": "notificationCenter",
|
||||
"subtype": "42mm"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "watch",
|
||||
"filename": "Icon58.png",
|
||||
"role": "companionSettings",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"idiom": "watch",
|
||||
"filename": "Icon87.png",
|
||||
"role": "companionSettings",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"filename": "Icon80.png",
|
||||
"role": "appLauncher",
|
||||
"subtype": "38mm"
|
||||
},
|
||||
{
|
||||
"size": "44x44",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"filename": "Icon88.png",
|
||||
"role": "longLook",
|
||||
"subtype": "42mm"
|
||||
},
|
||||
{
|
||||
"size": "86x86",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"filename": "Icon172.png",
|
||||
"role": "quickLook",
|
||||
"subtype": "38mm"
|
||||
},
|
||||
{
|
||||
"size": "44x44",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"filename": "Icon88.png",
|
||||
"role": "appLauncher",
|
||||
"subtype": "40mm"
|
||||
},
|
||||
{
|
||||
"size": "50x50",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"filename": "Icon100.png",
|
||||
"role": "appLauncher",
|
||||
"subtype": "44mm"
|
||||
},
|
||||
{
|
||||
"size": "98x98",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"filename": "Icon196.png",
|
||||
"role": "quickLook",
|
||||
"subtype": "42mm"
|
||||
},
|
||||
{
|
||||
"size": "108x108",
|
||||
"idiom": "watch",
|
||||
"scale": "2x",
|
||||
"filename": "Icon216.png",
|
||||
"role": "quickLook",
|
||||
"subtype": "44mm"
|
||||
},
|
||||
{
|
||||
"size": "16x16",
|
||||
"idiom": "mac",
|
||||
"filename": "Icon16.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "16x16",
|
||||
"idiom": "mac",
|
||||
"filename": "Icon32.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "32x32",
|
||||
"idiom": "mac",
|
||||
"filename": "Icon32.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "32x32",
|
||||
"idiom": "mac",
|
||||
"filename": "Icon64.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "128x128",
|
||||
"idiom": "mac",
|
||||
"filename": "Icon128.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "128x128",
|
||||
"idiom": "mac",
|
||||
"filename": "Icon256.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "256x256",
|
||||
"idiom": "mac",
|
||||
"filename": "Icon256.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "256x256",
|
||||
"idiom": "mac",
|
||||
"filename": "Icon512.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "512x512",
|
||||
"idiom": "mac",
|
||||
"filename": "Icon512.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"size": "512x512",
|
||||
"idiom": "mac",
|
||||
"filename": "Icon1024.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"size": "83.5x83.5",
|
||||
"idiom": "ipad",
|
||||
"filename": "Icon167.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"idiom": "ios-marketing",
|
||||
"size": "1024x1024",
|
||||
"scale": "1x",
|
||||
"filename": "Icon1024.png"
|
||||
},
|
||||
{
|
||||
"idiom": "watch-marketing",
|
||||
"size": "1024x1024",
|
||||
"scale": "1x",
|
||||
"filename": "Icon1024.png"
|
||||
},
|
||||
],
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
},
|
||||
# "properties": {
|
||||
# "pre-rendered": True
|
||||
# }
|
||||
}
|
||||
|
||||
|
||||
launchimage_json = {
|
||||
"images": [
|
||||
{
|
||||
"extent": "full-screen",
|
||||
"idiom": "iphone",
|
||||
"subtype": "736h",
|
||||
"filename": "Default1242x2208.png",
|
||||
"minimum-system-version": "8.0",
|
||||
"orientation": "portrait",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"extent": "full-screen",
|
||||
"idiom": "iphone",
|
||||
"subtype": "736h",
|
||||
"filename": "Default2208x1242.png",
|
||||
"minimum-system-version": "8.0",
|
||||
"orientation": "landscape",
|
||||
"scale": "3x"
|
||||
},
|
||||
{
|
||||
"extent": "full-screen",
|
||||
"idiom": "iphone",
|
||||
"subtype": "667h",
|
||||
"filename": "Default750x1334.png",
|
||||
"minimum-system-version": "8.0",
|
||||
"orientation": "portrait",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"orientation": "portrait",
|
||||
"idiom": "iphone",
|
||||
"extent": "full-screen",
|
||||
"minimum-system-version": "7.0",
|
||||
"filename": "Default640x960.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"extent": "full-screen",
|
||||
"idiom": "iphone",
|
||||
"subtype": "retina4",
|
||||
"filename": "Default640x1136.png",
|
||||
"minimum-system-version": "7.0",
|
||||
"orientation": "portrait",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"orientation": "portrait",
|
||||
"idiom": "ipad",
|
||||
"extent": "full-screen",
|
||||
"minimum-system-version": "7.0",
|
||||
"filename": "Default768x1024.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"orientation": "landscape",
|
||||
"idiom": "ipad",
|
||||
"extent": "full-screen",
|
||||
"minimum-system-version": "7.0",
|
||||
"filename": "Default1024x768.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"orientation": "portrait",
|
||||
"idiom": "ipad",
|
||||
"extent": "full-screen",
|
||||
"minimum-system-version": "7.0",
|
||||
"filename": "Default1536x2048.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"orientation": "landscape",
|
||||
"idiom": "ipad",
|
||||
"extent": "full-screen",
|
||||
"minimum-system-version": "7.0",
|
||||
"filename": "Default2048x1536.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"orientation": "portrait",
|
||||
"idiom": "iphone",
|
||||
"extent": "full-screen",
|
||||
"filename": "Default320x480.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"orientation": "portrait",
|
||||
"idiom": "iphone",
|
||||
"extent": "full-screen",
|
||||
"filename": "Default640x960.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"orientation": "portrait",
|
||||
"idiom": "iphone",
|
||||
"extent": "full-screen",
|
||||
"filename": "Default640x1136.png",
|
||||
"subtype": "retina4",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"orientation": "portrait",
|
||||
"idiom": "ipad",
|
||||
"extent": "full-screen",
|
||||
"filename": "Default768x1024.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"orientation": "landscape",
|
||||
"idiom": "ipad",
|
||||
"extent": "full-screen",
|
||||
"filename": "Default1024x768.png",
|
||||
"scale": "1x"
|
||||
},
|
||||
{
|
||||
"orientation": "portrait",
|
||||
"idiom": "ipad",
|
||||
"extent": "full-screen",
|
||||
"filename": "Default1536x2048.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
{
|
||||
"orientation": "landscape",
|
||||
"idiom": "ipad",
|
||||
"extent": "full-screen",
|
||||
"filename": "Default2048x1536.png",
|
||||
"scale": "2x"
|
||||
},
|
||||
],
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def icon(image_xcassets, image_fn):
|
||||
"""Generate all the possible Icon from a single image_fn
|
||||
"""
|
||||
appicon_dir = join(image_xcassets, "AppIcon.appiconset")
|
||||
if not exists(appicon_dir):
|
||||
makedirs(appicon_dir)
|
||||
with open(join(appicon_dir, "Contents.json"), "w") as fd:
|
||||
json.dump(appicon_json, fd)
|
||||
|
||||
options = (
|
||||
# iPhone
|
||||
# Spotlight - iOS 5,6
|
||||
# Settings - iOS 5-8
|
||||
# 29pt - 1x,2x,3x
|
||||
("87", None, "Icon87.png"),
|
||||
("58", None, "Icon58.png"),
|
||||
("29", "Icon58.png", "Icon29.png"),
|
||||
|
||||
# iPhone notification
|
||||
# 20pt - 2x,3x
|
||||
# ("40", None, "Icon40.png"),
|
||||
("60", None, "Icon60.png"),
|
||||
|
||||
# iPhone
|
||||
# Spotlight - iOS 7-8
|
||||
# 40pt 2x,3x
|
||||
("120", None, "Icon120.png"),
|
||||
("80", None, "Icon80.png"),
|
||||
|
||||
# iPhone
|
||||
# App - iOS 5,6
|
||||
# 57pt 1x,2x
|
||||
("114", None, "Icon114.png"),
|
||||
("57", "Icon114.png", "Icon57.png"),
|
||||
|
||||
# iPhone
|
||||
# App - iOS 7,8
|
||||
# 60pt 2x,3x
|
||||
("180", None, "Icon180.png"),
|
||||
# ("120", None, "Icon120.png # duplicate"),
|
||||
|
||||
# iPad
|
||||
# Notifications
|
||||
# 20pt 1x,2x
|
||||
("20", "Icon80.png", "Icon20.png"),
|
||||
("40", "Icon80.png", "Icon40.png"),
|
||||
|
||||
# iPad
|
||||
# Settings iOS 5-8
|
||||
# ("58", None, "Icon58.png # duplicate"),
|
||||
# ("29", "Icon58.png", "Icon29.png # duplicate"),
|
||||
|
||||
# iPad
|
||||
# Spotlight iOS 7,8
|
||||
# 40pt 1x,2x
|
||||
# ("80", None, "Icon80.png # duplicate"),
|
||||
("40", "Icon80.png", "Icon40.png"),
|
||||
|
||||
# iPad
|
||||
# Spotlight iOS 5,6
|
||||
# 50pt 1x,2x
|
||||
("100", None, "Icon100.png"),
|
||||
("50", "Icon100.png", "Icon50.png"),
|
||||
|
||||
# iPad
|
||||
# App iOS 5,6
|
||||
# 72pt 1x,2x
|
||||
("144", None, "Icon144.png"),
|
||||
("72", "Icon144.png", "Icon72.png"),
|
||||
|
||||
# iPad
|
||||
# App iOS 7,8
|
||||
# 76pt 1x,2x
|
||||
("152", None, "Icon152.png"),
|
||||
("76", "Icon152.png", "Icon76.png"),
|
||||
|
||||
# iPad
|
||||
# App iOS 9
|
||||
# 83.5pt 2x
|
||||
("167", None, "Icon167.png"),
|
||||
|
||||
|
||||
# CarPlay
|
||||
# App iOS 8
|
||||
# 120pt 1x
|
||||
# ("120", None, "Icon120.png # duplicate"),
|
||||
|
||||
|
||||
# Apple Watch
|
||||
# Notification Center
|
||||
# 38mm, 42mm
|
||||
("48", None, "Icon48.png"),
|
||||
("55", None, "Icon55.png"),
|
||||
|
||||
# Apple Watch
|
||||
# Companion Settings
|
||||
# 29pt 2x,3x
|
||||
# ("58", None, "Icon58.png # duplicate"),
|
||||
# ("87", None, "Icon87.png # duplicate"),
|
||||
|
||||
# Apple Watch
|
||||
# Home Screen (All)
|
||||
# Long Look (38mm)
|
||||
# ("80", None, "Icon80.png # duplicate"),
|
||||
|
||||
# Apple Watch
|
||||
# Long Look (42mm)
|
||||
("88", None, "Icon88.png"),
|
||||
|
||||
# Apple Watch
|
||||
# Short Look
|
||||
# 38mm, 42mm, 44mm
|
||||
("172", None, "Icon172.png"),
|
||||
("196", None, "Icon196.png"),
|
||||
("216", None, "Icon216.png"),
|
||||
|
||||
|
||||
# OS X
|
||||
# 512pt 1x,2x
|
||||
("1024", None, "Icon1024.png"),
|
||||
("512", "Icon1024.png", "Icon512.png"),
|
||||
|
||||
# OS X
|
||||
# 256pt 1x,2x
|
||||
# ("512", "Icon1024.png", "Icon512.png # duplicate"),
|
||||
("256", "Icon512.png", "Icon256.png"),
|
||||
|
||||
# OS X
|
||||
# 128pt 1x,2x
|
||||
# ("256", "Icon512.png", "Icon256.png # duplicate"),
|
||||
("128", "Icon256.png", "Icon128.png"),
|
||||
|
||||
# OS X
|
||||
# 32pt 1x,2x
|
||||
("64", "Icon128.png", "Icon64.png"),
|
||||
("32", "Icon64.png", "Icon32.png"),
|
||||
|
||||
# OS X
|
||||
# 16pt 1x,2x
|
||||
# ("32", "Icon64.png", "Icon32.png # duplicate"),
|
||||
("16", "Icon32.png", "Icon16.png"))
|
||||
|
||||
_generate("AppIcon.appiconset", image_xcassets, image_fn, options, icon=True)
|
||||
|
||||
|
||||
def launchimage(image_xcassets, image_fn):
|
||||
"""Generate all the possible Launch Images from a single image_fn
|
||||
"""
|
||||
launchimage_dir = join(image_xcassets, "LaunchImage.launchimage")
|
||||
if not exists(launchimage_dir):
|
||||
makedirs(launchimage_dir)
|
||||
with open(join(launchimage_dir, "Contents.json"), "w") as fd:
|
||||
json.dump(launchimage_json, fd)
|
||||
|
||||
options = (
|
||||
# size, input, output
|
||||
# iPhone 3.5" @2x
|
||||
("640 960", None, "Default640x960.png"),
|
||||
# iPhone 3.5" @1x
|
||||
("320 480", None, "Default320x480.png"),
|
||||
# iPhone 4.0" @2x
|
||||
("640 1136", None, "Default640x1136.png"),
|
||||
# iPhone 5.5" @3x - landscape
|
||||
("2208 1242", None, "Default2208x1242.png"),
|
||||
# iPhone 5.5" @3x - portrait
|
||||
("1242 2208", None, "Default1242x2208.png"),
|
||||
# iPhone 4.7" @2x
|
||||
("750 1334", None, "Default750x1334.png"),
|
||||
# iPad @2x - landscape
|
||||
("2048 1536", None, "Default2048x1536.png"),
|
||||
# iPad @2x - portrait
|
||||
("1536 2048", None, "Default1536x2048.png"),
|
||||
# iPad @1x - landscape
|
||||
("1024 768", None, "Default1024x768.png"),
|
||||
# iPad @1x - portrait
|
||||
("768 1024", None, "Default768x1024.png"),
|
||||
)
|
||||
|
||||
_generate("LaunchImage.launchimage", image_xcassets, image_fn, options)
|
||||
|
||||
|
||||
def _buildimage(in_fn, out_fn, size, padcolor=None):
|
||||
im = Image.open(in_fn)
|
||||
|
||||
# read the first left/bottom pixel
|
||||
bgcolor = im.getpixel((0, 0))
|
||||
|
||||
# ensure the image fit in the destination size
|
||||
if im.size[0] > size[0] or im.size[1] > size[1]:
|
||||
f = max(im.size[0] / size[0], im.size[1] / size[1])
|
||||
newsize = int(im.size[0] / f), int(im.size[1] / f)
|
||||
im = im.resize(newsize)
|
||||
|
||||
# create final image
|
||||
outim = Image.new("RGB", size, bgcolor[:3])
|
||||
x = (size[0] - im.size[0]) // 2
|
||||
y = (size[1] - im.size[1]) // 2
|
||||
outim.paste(im, (x, y))
|
||||
|
||||
# save the image
|
||||
outim.save(out_fn)
|
||||
|
||||
|
||||
def _generate(d, image_xcassets, image_fn, options, icon=False):
|
||||
for c, in_fn, out_fn in options:
|
||||
args = []
|
||||
if in_fn is not None:
|
||||
filename = join(image_xcassets, d, in_fn)
|
||||
else:
|
||||
filename = image_fn
|
||||
|
||||
if icon:
|
||||
args += ["-Z", c]
|
||||
args += [
|
||||
"--out",
|
||||
join(image_xcassets, d, out_fn)
|
||||
]
|
||||
print("sips", " ".join(args))
|
||||
sh.sips(*args)
|
||||
else:
|
||||
size = [int(x) for x in c.split()]
|
||||
_buildimage(filename, join(image_xcassets, d, out_fn), size)
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"title": "",
|
||||
"project_name": "",
|
||||
"domain_name": "",
|
||||
"project_dir": "",
|
||||
"version": "1.0.0",
|
||||
"dist_dir": ""
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
build/lib.ios-x86_64-3.7
|
|
@ -1,14 +1,11 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
import os
|
||||
import sh
|
||||
from kivy_ios.toolchain import CythonRecipe, shprint
|
||||
from toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh, os
|
||||
|
||||
|
||||
class AioHttpRecipe(CythonRecipe):
|
||||
class AiohttpRecipe(PythonRecipe):
|
||||
version = "3.5.4"
|
||||
url = "https://pypi.python.org/packages/source/a/aiohttp/aiohttp-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
depends = ["python3", "setuptools", "attrs", "chardet", "multidict", "async_timeout", "yarl"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
|
@ -17,7 +14,7 @@ class AioHttpRecipe(CythonRecipe):
|
|||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = AioHttpRecipe()
|
||||
recipe = AiohttpRecipe()
|
|
@ -1,11 +1,11 @@
|
|||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
from toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh, os
|
||||
|
||||
class AppdirsRecipe(PythonRecipe):
|
||||
version = "1.4.3"
|
||||
url = "https://pypi.python.org/packages/source/a/appdirs/appdirs-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
depends = ["python3", "setuptools"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
|
@ -14,7 +14,7 @@ class AppdirsRecipe(PythonRecipe):
|
|||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = AppdirsRecipe()
|
20
recipes/argparse/__init__.py
Normal file
20
recipes/argparse/__init__.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh, os
|
||||
|
||||
class ArgparseRecipe(PythonRecipe):
|
||||
version = "1.2.1"
|
||||
url = "https://pypi.python.org/packages/source/a/argparse/argparse-{version}.tar.gz"
|
||||
depends = ["python", "setuptools"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = ArgparseRecipe()
|
|
@ -1,11 +1,11 @@
|
|||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
from toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh, os
|
||||
|
||||
class Asn1CryptoRecipe(PythonRecipe):
|
||||
version = "0.24.0"
|
||||
url = "https://pypi.python.org/packages/source/a/asn1crypto/asn1crypto-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
depends = ["python3", "setuptools"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
|
@ -14,7 +14,7 @@ class Asn1CryptoRecipe(PythonRecipe):
|
|||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = Asn1CryptoRecipe()
|
20
recipes/async_timeout/__init__.py
Normal file
20
recipes/async_timeout/__init__.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh, os
|
||||
|
||||
class AsyncTimeoutRecipe(PythonRecipe):
|
||||
version = "3.0.1"
|
||||
url = "https://pypi.python.org/packages/source/a/async-timeout/async-timeout-{version}.tar.gz"
|
||||
depends = ["python3", "setuptools"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = AsyncTimeoutRecipe()
|
21
recipes/attrs/__init__.py
Normal file
21
recipes/attrs/__init__.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh, os
|
||||
|
||||
class AttrsRecipe(PythonRecipe):
|
||||
version = "18.2.0"
|
||||
url = "https://pypi.python.org/packages/source/a/attrs/attrs-{version}.tar.gz"
|
||||
depends = ["python", "setuptools"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||
build_env['PYTHONUSERBASE'] = join(self.ctx.dist_dir, "root", "python3");
|
||||
shprint(hostpython, "setup.py", "install", "--user", _env=build_env)
|
||||
|
||||
recipe = AttrsRecipe()
|
|
@ -1,4 +1,4 @@
|
|||
from kivy_ios.toolchain import CythonRecipe
|
||||
from toolchain import CythonRecipe
|
||||
|
||||
|
||||
class AudiostreamRecipe(CythonRecipe):
|
||||
|
@ -10,3 +10,4 @@ class AudiostreamRecipe(CythonRecipe):
|
|||
|
||||
|
||||
recipe = AudiostreamRecipe()
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
from toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh, os
|
||||
|
||||
class Base58Recipe(PythonRecipe):
|
||||
version = "1.0.0"
|
||||
url = "https://pypi.python.org/packages/source/b/base58/base58-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
depends = ["python3", "setuptools"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
|
@ -14,7 +14,7 @@ class Base58Recipe(PythonRecipe):
|
|||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = Base58Recipe()
|
|
@ -1,4 +1,4 @@
|
|||
from kivy_ios.toolchain import CythonRecipe, shprint
|
||||
from toolchain import CythonRecipe, shprint
|
||||
from os.path import join
|
||||
import os
|
||||
import sh
|
||||
|
@ -6,10 +6,10 @@ import sh
|
|||
|
||||
class CffiRecipe(CythonRecipe):
|
||||
name = "cffi"
|
||||
version = "1.14.3"
|
||||
version = "1.12.1"
|
||||
url = "https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz"
|
||||
library = "libcffi.a"
|
||||
depends = ["host_cffi", "libffi", "pycparser"]
|
||||
depends = ["host_cffi", "libffi", "setuptools", "pycparser"]
|
||||
cythonize = False
|
||||
|
||||
def get_recipe_env(self, arch):
|
||||
|
@ -26,26 +26,23 @@ class CffiRecipe(CythonRecipe):
|
|||
os.chdir(build_dir)
|
||||
|
||||
# manually create expected directory in build directory
|
||||
scripts_dir = join("build", "scripts-3.8")
|
||||
scripts_dir = join("build", "scripts-2.7")
|
||||
if not os.path.exists(scripts_dir):
|
||||
os.makedirs(scripts_dir)
|
||||
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "build_ext", _env=build_env)
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
# hack: copy _cffi_backend.so from hostpython
|
||||
so_file = "_cffi_backend.cpython-38-darwin.so"
|
||||
egg_name = "cffi-1.14.3-py3.8-macosx-10.15-x86_64.egg" # harded - needs to change
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3", "lib", "python3.8", "site-packages", egg_name)
|
||||
dest_dir_main = join(self.ctx.dist_dir, "root", "python3", "lib", "python3.8", "site-packages")
|
||||
|
||||
src_dir = join(self.ctx.dist_dir, "hostpython3", "lib", "python3.8", "site-packages", egg_name)
|
||||
so_file = "_cffi_backend.cpython-37m-darwin.so"
|
||||
egg_name = "cffi-1.12.1-py3.7-macosx-10.14-x86_64.egg" # harded - needs to change
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3", "lib", "python3.7", "site-packages", egg_name)
|
||||
src_dir = join(self.ctx.dist_dir, "hostpython3", "lib", "python3.7", "site-packages", egg_name)
|
||||
sh.cp(join(src_dir, so_file), join(dest_dir, so_file))
|
||||
sh.cp(join(src_dir, so_file), join(dest_dir_main, so_file))
|
||||
|
||||
|
||||
recipe = CffiRecipe()
|
20
recipes/chardet/__init__.py
Normal file
20
recipes/chardet/__init__.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh, os
|
||||
|
||||
class ChardetRecipe(PythonRecipe):
|
||||
version = "3.0.4"
|
||||
url = "https://pypi.python.org/packages/source/c/chardet/chardet-{version}.tar.gz"
|
||||
depends = ["python3", "setuptools"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = ChardetRecipe()
|
|
@ -1,15 +1,13 @@
|
|||
# pure-python package, this can be removed when we'll support any python package
|
||||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
from toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh
|
||||
import os
|
||||
|
||||
import sh, os
|
||||
|
||||
class ClickRecipe(PythonRecipe):
|
||||
version = "7.1.2"
|
||||
version = "master"
|
||||
url = "https://github.com/mitsuhiko/click/archive/{version}.zip"
|
||||
depends = ["python"]
|
||||
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
|
@ -17,8 +15,10 @@ class ClickRecipe(PythonRecipe):
|
|||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||
cmd = sh.Command("sed")
|
||||
shprint(cmd, "-i", "", "s/setuptools/distutils.core/g", "./setup.py", _env=build_env)
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = ClickRecipe()
|
||||
|
51
recipes/coincurve/__init__.py
Normal file
51
recipes/coincurve/__init__.py
Normal file
|
@ -0,0 +1,51 @@
|
|||
from toolchain import Recipe, shprint
|
||||
from os.path import join
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class CoincurveRecipe(Recipe):
|
||||
name = "coincurve"
|
||||
version = "7.1.0"
|
||||
url = "https://github.com/ofek/coincurve/archive/{version}.tar.gz"
|
||||
depends = ["python3", "setuptools", "libffi", "cffi", "libsecp256k1"]
|
||||
cythonize = False
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
if self.has_marker("patched"):
|
||||
return
|
||||
|
||||
self.apply_patch("cross_compile.patch")
|
||||
self.apply_patch("drop_setup_requires.patch")
|
||||
self.apply_patch("find_lib.patch")
|
||||
self.apply_patch("no_download.patch")
|
||||
|
||||
# remove "tests_require=['pytest>=2.8.7']," string
|
||||
shprint(sh.sed,
|
||||
'-i.bak',
|
||||
's#tests_require=\[\'pytest>=2.8.7\'\],##g',
|
||||
join(self.get_build_dir(arch.arch), "setup.py"))
|
||||
|
||||
self.set_marker("patched")
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
|
||||
libsecp256k1 = self.get_recipe('libsecp256k1', self.ctx)
|
||||
libsecp256k1_dir = libsecp256k1.get_build_dir(arch.arch)
|
||||
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||
build_env['CFLAGS'] = '{} -I{}'.format(build_env['CFLAGS'], os.path.join(libsecp256k1_dir, 'include'))
|
||||
build_env['LDFLAGS'] = '{} -miphoneos-version-min=8.0 -L{}'.format(build_env['LDFLAGS'], os.path.join(libsecp256k1_dir, '.libs'))
|
||||
|
||||
print('*******{}'.format(build_env['CFLAGS']))
|
||||
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
|
||||
recipe = CoincurveRecipe()
|
|
@ -9,4 +9,4 @@ index c224fb2..bf925bd 100644
|
|||
+ "--host=%s" % os.environ['TOOLCHAIN_PREFIX'],
|
||||
'--disable-jni',
|
||||
'--prefix',
|
||||
os.path.abspath(self.build_clib),
|
||||
os.path.abspath(self.build_clib),
|
|
@ -1,12 +1,12 @@
|
|||
from kivy_ios.toolchain import PythonRecipe, shprint
|
||||
from toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh, os
|
||||
|
||||
class ColoramaRecipe(PythonRecipe):
|
||||
version = "0.3.7"
|
||||
url = "https://pypi.python.org/packages/source/c/colorama/colorama-{version}.tar.gz"
|
||||
depends = ["python"]
|
||||
|
||||
depends = ["python3"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
|
@ -14,7 +14,7 @@ class ColoramaRecipe(PythonRecipe):
|
|||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.8', 'site-packages')
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = ColoramaRecipe()
|
20
recipes/constantly/__init__.py
Normal file
20
recipes/constantly/__init__.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from toolchain import PythonRecipe, shprint
|
||||
from os.path import join
|
||||
import sh, os
|
||||
|
||||
class ConstantlyRecipe(PythonRecipe):
|
||||
version = "15.1.0"
|
||||
url = "https://pypi.python.org/packages/source/c/constantly/constantly-{version}.tar.gz"
|
||||
depends = ["python", "setuptools"]
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python2.7', 'site-packages')
|
||||
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
|
||||
|
||||
recipe = ConstantlyRecipe()
|
60
recipes/cryptography/__init__.py
Normal file
60
recipes/cryptography/__init__.py
Normal file
|
@ -0,0 +1,60 @@
|
|||
from os.path import join
|
||||
from toolchain import CythonRecipe, PythonRecipe, Recipe
|
||||
from toolchain import shprint
|
||||
import os
|
||||
import sh
|
||||
|
||||
|
||||
class CryptographyRecipe(CythonRecipe):
|
||||
name = "cryptography"
|
||||
version = "2.6"
|
||||
url = "https://pypi.python.org/packages/source/c/cryptography/cryptography-{version}.tar.gz"
|
||||
library = "libcryptography.a"
|
||||
depends = ["host_setuptools", "host_cffi", "setuptools", "asn1crypto",
|
||||
"cffi", "idna", "six"]
|
||||
cythonize = False
|
||||
|
||||
def prebuild_arch(self, arch):
|
||||
if self.has_marker("patched"):
|
||||
return
|
||||
self.apply_patch("getentropy.patch")
|
||||
#self.apply_patch("osrandom.patch")
|
||||
self.set_marker("patched")
|
||||
|
||||
def get_recipe_env(self, arch):
|
||||
env = super(CryptographyRecipe, self).get_recipe_env(arch)
|
||||
r = self.get_recipe('openssl', self.ctx)
|
||||
openssl_dir = r.get_build_dir(arch.arch)
|
||||
target_python = Recipe.get_recipe('python3', self.ctx).get_build_dir(arch.arch)
|
||||
|
||||
env['PYTHON_ROOT'] = join(self.ctx.dist_dir, "root", "python3")
|
||||
env["CC"] = "clang -Qunused-arguments -fcolor-diagnostics"
|
||||
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python3.7' + \
|
||||
' -I' + join(openssl_dir, 'include') + \
|
||||
' -I' + join(self.ctx.dist_dir, "include", arch.arch, "libffi")
|
||||
env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \
|
||||
' -L' + openssl_dir + \
|
||||
' -lpython3.7m' + \
|
||||
' -lssl' + r.version + \
|
||||
' -lcrypto' + r.version
|
||||
return env
|
||||
|
||||
def install(self):
|
||||
arch = list(self.filtered_archs)[0]
|
||||
build_dir = self.get_build_dir(arch.arch)
|
||||
os.chdir(build_dir)
|
||||
|
||||
# manually create expected directory in build directory
|
||||
scripts_dir = join("build", "scripts-2.7")
|
||||
if not os.path.exists(scripts_dir):
|
||||
os.makedirs(scripts_dir)
|
||||
|
||||
hostpython = sh.Command(self.ctx.hostpython)
|
||||
build_env = arch.get_env()
|
||||
dest_dir = join(self.ctx.dist_dir, "root", "python3")
|
||||
pythonpath = join(dest_dir, 'lib', 'python3.7', 'site-packages')
|
||||
build_env['PYTHONPATH'] = pythonpath
|
||||
args = [hostpython, "setup.py", "install", "--prefix", dest_dir]
|
||||
shprint(*args, _env=build_env)
|
||||
|
||||
recipe = CryptographyRecipe()
|
45
recipes/cryptography/getentropy.patch
Normal file
45
recipes/cryptography/getentropy.patch
Normal file
|
@ -0,0 +1,45 @@
|
|||
--- a/src/_cffi_src/openssl/src/osrandom_engine.c 2019-01-22 17:41:49.000000000 +0100
|
||||
+++ b/src/_cffi_src/openssl/src/osrandom_engine.c 2019-08-12 11:47:03.000000000 +0100
|
||||
@@ -243,14 +243,10 @@
|
||||
#if !defined(__APPLE__)
|
||||
getentropy_works = CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS;
|
||||
#else
|
||||
- if (&getentropy != NULL) {
|
||||
- getentropy_works = CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS;
|
||||
- } else {
|
||||
- getentropy_works = CRYPTOGRAPHY_OSRANDOM_GETENTROPY_FALLBACK;
|
||||
- int fd = dev_urandom_fd();
|
||||
- if (fd < 0) {
|
||||
- return 0;
|
||||
- }
|
||||
+ getentropy_works = CRYPTOGRAPHY_OSRANDOM_GETENTROPY_FALLBACK;
|
||||
+ int fd = dev_urandom_fd();
|
||||
+ if (fd < 0) {
|
||||
+ return 0;
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
@@ -266,22 +262,7 @@
|
||||
return dev_urandom_read(buffer, size);
|
||||
#endif
|
||||
case CRYPTOGRAPHY_OSRANDOM_GETENTROPY_WORKS:
|
||||
- while (size > 0) {
|
||||
- /* OpenBSD and macOS restrict maximum buffer size to 256. */
|
||||
- len = size > 256 ? 256 : size;
|
||||
- res = getentropy(buffer, (size_t)len);
|
||||
- if (res < 0) {
|
||||
- ERR_Cryptography_OSRandom_error(
|
||||
- CRYPTOGRAPHY_OSRANDOM_F_RAND_BYTES,
|
||||
- CRYPTOGRAPHY_OSRANDOM_R_GETENTROPY_FAILED,
|
||||
- __FILE__, __LINE__
|
||||
- );
|
||||
- return 0;
|
||||
- }
|
||||
- buffer += len;
|
||||
- size -= len;
|
||||
- }
|
||||
- return 1;
|
||||
+ return 0;
|
||||
}
|
||||
__builtin_unreachable();
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue