Compare commits

..

2 commits

Author SHA1 Message Date
akshayaurora
8655bf279b Update PIL and Libffi recipes to latest versions 2016-12-26 21:07:38 +05:30
akshayaurora
c74994eb14 fix pkgresources recipe 2016-12-10 04:08:27 +05:30
289 changed files with 34781 additions and 7658 deletions

View file

@ -1,4 +0,0 @@
BROKEN_RECIPES = set()
# recipes that were already built will be skipped
CORE_RECIPES = set(["kivy", "hostpython3", "python3"])

View file

@ -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()

View file

@ -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

View file

@ -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.

View file

@ -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

View file

@ -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 }}

View file

@ -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

3
.gitignore vendored
View file

@ -18,6 +18,3 @@ src/ios/iosbuild/
src/ios/ios.c
*.DS_Store*
*-ios/
__pycache__
.tox
venv

View file

@ -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

View file

@ -1,4 +1,4 @@
Copyright (c) 2010-2017 Kivy Team and other contributors
Copyright (c) 2010-2015 Kivy Team and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

327
README.md
View file

@ -1,327 +0,0 @@
# Kivy for iOS
[![kivy-ios](https://github.com/kivy/kivy-ios/workflows/kivy-ios/badge.svg)](https://github.com/kivy/kivy-ios/actions?query=workflow%3Akivy-ios)
[![PyPI version](https://badge.fury.io/py/kivy-ios.svg)](https://badge.fury.io/py/kivy-ios)
[![Backers on Open Collective](https://opencollective.com/kivy/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/kivy/sponsors/badge.svg)](#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>

223
README.rst Normal file
View file

@ -0,0 +1,223 @@
Kivy for iOS
============
This toolchain is designed to compile the necessary libraries for iOS to run
your application and manage the creation of the Xcode project.
Currently, we do not provide any binary distributions of this toolchain, but we
aim to. Until then, you do need to compile it at least once before creating
your Xcode project.
The toolchain supports:
- iPhone Simulator (x86 and x86_64)
- iPhone / iOS (armv7 and arm64)
These recipes are not ported to the new toolchain yet:
- lxml
Requirements
------------
Currently, the toolchain requires a few tools for compilation. You will need:
#. Xcode 6 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
#. Install Cython (0.23)::
# pip method if available (sudo might be needed.)
pip install cython==0.23
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.py recipes
freetype 2.5.5
hostpython 2.7.1
ios master
kivy ios-poly-arch
libffi 3.2.1
openssl 1.0.2e
pyobjus master
python 2.7.1
sdl2 iOS-improvements
sdl2_image 2.0.0
sdl2_mixer 2.0.0
sdl2_ttf 2.0.12
Then, start the compilation with::
$ ./toolchain.py build kivy
You can build recipes at the same time by adding them as parameters::
$ ./toolchain.py build openssl kivy
Recipe builds can be removed via the clean command e.g.::
$ ./toolchain.py clean openssl
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, 4x over (remember, 4 archs, 2 per platforms), will take time. (TODO:
provide a way to not compile for the simulator.).
For a complete list of available commands, type::
$ ./toolchain.py
Create the Xcode project
------------------------
The `toolchain.py` can create the initial Xcode project for you::
$ ./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.
You can open the Xcode project using::
$ open touchtracer-ios/touchtracer.xcodeproj
Then click on `Play`, and enjoy.
.. note::
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)
.. note::
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/python/lib/python27.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, x86_64, armv7 and arm64 as per the guidelines from
Apple. You can reduce the size of your ipa significantly by removing the
x86 and x86_64 architectures as they are usually used only for the emulator.
The procedure is to first compile/build all the host recipes as is::
./toolchain.py build hostpython
Then build all the rest of the recipes using --arch=armv7 --arch=arm64
arguments as follows::
./toolchain.py build kivy --arch=armv7 --arch=arm64
Note that these packages will not run in the iOS emulators, so use them
only for deployment.
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.
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 an IRC channel:
* Server : irc.freenode.net
* Port : 6667, 6697 (SSL only)
* Channel : #kivy
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
IRC channel:
* Server : irc.freenode.net
* Port : 6667, 6697 (SSL only)
* Channel : #kivy-dev
License
-------
Kivy for iOS is released under the terms of the MIT License. Please refer to the
LICENSE file.

View file

@ -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
[![kivy-ios](https://github.com/kivy/kivy-ios/workflows/kivy-ios/badge.svg)](https://github.com/kivy/kivy-ios/actions?query=workflow%3Akivy-ios)
[![PyPI version](https://badge.fury.io/py/kivy-ios.svg)](https://badge.fury.io/py/kivy-ios)
[![Backers on Open Collective](https://opencollective.com/kivy/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/kivy/sponsors/badge.svg)](#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

View file

@ -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

View file

@ -1 +0,0 @@

View file

@ -1,3 +0,0 @@
[console_scripts]
toolchain = kivy_ios.toolchain:main

View file

@ -1,5 +0,0 @@
cookiecutter
pbxproj
Pillow
requests
sh

View file

@ -1 +0,0 @@
kivy_ios

View file

@ -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

View file

@ -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 CythonRecipe, shprint
from os.path import join
class AioHttpRecipe(CythonRecipe):
version = "3.5.4"
url = "https://pypi.python.org/packages/source/a/aiohttp/aiohttp-{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 = 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 = AioHttpRecipe()

View file

@ -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()

View file

@ -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'
]
)

View file

@ -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]]]:

View file

@ -1,20 +0,0 @@
from kivy_ios.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"]
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 = AppdirsRecipe()

View file

@ -1,20 +0,0 @@
from kivy_ios.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"]
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 = Asn1CryptoRecipe()

View file

@ -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()

View file

@ -1,20 +0,0 @@
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class AttrsRecipe(PythonRecipe):
version = "18.1.0"
url = "https://pypi.python.org/packages/source/a/attrs/attrs-{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 = 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 = AttrsRecipe()

View file

@ -1,20 +0,0 @@
from kivy_ios.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"]
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 = Base58Recipe()

View file

@ -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()

View file

@ -1,51 +0,0 @@
from kivy_ios.toolchain import CythonRecipe, shprint
from os.path import join
import os
import sh
class CffiRecipe(CythonRecipe):
name = "cffi"
version = "1.14.3"
url = "https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz"
library = "libcffi.a"
depends = ["host_cffi", "libffi", "pycparser"]
cythonize = False
def get_recipe_env(self, arch):
env = super(CffiRecipe, self).get_recipe_env(arch)
env["CFLAGS"] += " -I{}".format(join(self.ctx.dist_dir, "include", arch.arch, "libffi"))
env["LDFLAGS"] = " ".join([
env.get('CFLAGS', '')
])
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-3.8")
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')
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)
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()

View file

@ -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()

View file

@ -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()

View file

@ -1,12 +0,0 @@
diff --git a/setup.py b/setup.py
index c224fb2..bf925bd 100644
--- a/setup.py
+++ b/setup.py
@@ -182,6 +182,7 @@ class build_clib(_build_clib):
'--disable-dependency-tracking',
'--with-pic',
'--enable-module-recovery',
+ "--host=%s" % os.environ['TOOLCHAIN_PREFIX'],
'--disable-jni',
'--prefix',
os.path.abspath(self.build_clib),

View file

@ -1,12 +0,0 @@
diff --git a/setup.py b/setup.py
index c224fb2..466e789 100644
--- a/setup.py
+++ b/setup.py
@@ -250,7 +250,6 @@ else:
def has_c_libraries(self):
return not has_system_lib()
setup_kwargs = dict(
- setup_requires=['cffi>=1.3.0', 'pytest-runner>=2.6.2'],
ext_package='coincurve',
cffi_modules=['_cffi_build/build.py:ffi'],
cmdclass={

View file

@ -1,13 +0,0 @@
diff --git a/setup_support.py b/setup_support.py
index e7a4f2e..72f0c4d 100644
--- a/setup_support.py
+++ b/setup_support.py
@@ -68,6 +69,8 @@ def build_flags(library, type_, path):
def _find_lib():
+ # we're picking up the recipe one
+ return True
from cffi import FFI
ffi = FFI()
try:

View file

@ -1,13 +0,0 @@
diff --git a/setup.py b/setup.py
index c224fb2..d5f6d1a 100644
--- a/setup.py
+++ b/setup.py
@@ -51,6 +51,8 @@ if [int(i) for i in setuptools_version.split('.', 2)[:2]] < [3, 3]:
def download_library(command):
+ # we will use the custom libsecp256k1 recipe
+ return
if command.dry_run:
return
libdir = absolute('libsecp256k1')

View file

@ -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,

View file

@ -1,20 +0,0 @@
from kivy_ios.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"]
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 = ColoramaRecipe()

View file

@ -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()

View file

@ -1,16 +0,0 @@
--- cryptography-2.2.2/src/_cffi_src/openssl/src/osrandom_engine.h 2018-03-27 15:12:05.000000000 +0100
+++ cryptography-2.2.2-patch/src/_cffi_src/openssl/src/osrandom_engine.h 2018-06-02 05:06:04.000000000 +0100
@@ -11,13 +11,6 @@
#include <sys/syscall.h>
#endif
- #ifdef __APPLE__
- #include <sys/random.h>
- /* To support weak linking we need to declare this as a weak import even if
- * it's not present in sys/random (e.g. macOS < 10.12). */
- extern int getentropy(void *buffer, size_t size) __attribute((weak_import));
- #endif
-
#ifdef __linux__
/* for SYS_getrandom */
#include <sys/syscall.h>

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -1,20 +0,0 @@
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class DocoptRecipe(PythonRecipe):
version = "0.6.2"
url = "https://pypi.python.org/packages/source/d/docopt/docopt-{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 = 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 = DocoptRecipe()

View file

@ -1,20 +0,0 @@
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class EcdsaRecipe(PythonRecipe):
version = "0.13"
url = "https://pypi.python.org/packages/source/e/ecdsa/ecdsa-{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 = 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 = EcdsaRecipe()

View file

@ -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;

View file

@ -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()

View file

@ -1,61 +0,0 @@
from os.path import join
from kivy_ios.toolchain import Recipe, shprint
import os
import sh
libffi_tpl = """
prefix=%PREFIX%
exec_prefix=${prefix}
libdir=${exec_prefix}/build/Release
includedir=${libdir}/build_macosx-x86_64/include
Name: libffi
Description: Library supporting Foreign Function Interfaces
Version: %VERSION%
Libs: -L${libdir} -lffi
Cflags: -I${includedir}
"""
class HostCffiRecipe(Recipe):
name = "host_cffi"
version = "1.14.3"
archs = ["x86_64"]
url = "https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz"
depends = ["hostlibffi", "pycparser"]
def get_recipe_env(self, arch):
sdk_path = sh.xcrun("--sdk", "macosx", "--show-sdk-path").strip()
env = super(HostCffiRecipe, self).get_recipe_env(arch)
env["CC"] = "clang -Qunused-arguments -fcolor-diagnostics"
env["LDFLAGS"] = " ".join([
"-undefined dynamic_lookup",
#"-shared",
"-L{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "lib"))
])
env["CFLAGS"] = " ".join([
"--sysroot={}".format(sdk_path),
"-I{}".format(join(self.ctx.dist_dir, "hostlibffi", "usr", "local", "include"))
])
return env
def prebuild_arch(self, arch):
hostpython = sh.Command(self.ctx.hostpython)
build_dir = self.get_build_dir(arch.arch)
build_env = self.get_recipe_env(arch)
os.chdir(build_dir)
# generate a fake libffi pkg-config to let cffi use it
hostlibffi = Recipe.get_recipe("hostlibffi", self.ctx)
with open("libffi.pc", "w") as fd:
tpl = libffi_tpl.replace("%PREFIX%",
hostlibffi.get_build_dir(arch.arch))
tpl = tpl.replace("%VERSION%", hostlibffi.version)
fd.write(tpl)
build_env["PKG_CONFIG"] = "/usr/local/bin/pkg-config"
build_env["PKG_CONFIG_PATH"] = build_dir
shprint(hostpython, "setup.py", "build_ext", _env=build_env)
shprint(hostpython, "setup.py", "install", _env=build_env)
recipe = HostCffiRecipe()

View file

@ -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()

View file

@ -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()

View file

@ -1 +0,0 @@
Make toolchain happy

View file

@ -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:

View file

@ -1,391 +0,0 @@
--- libffi-3.2.1.old/generate-darwin-source-and-headers.py 2018-10-26 17:08:07.000000000 +0200
+++ libffi-3.2.1/generate-darwin-source-and-headers.py 2018-10-26 17:08:50.000000000 +0200
@@ -174,23 +174,23 @@
if generate_ios:
make_tramp()
- copy_src_platform_files(simulator_platform)
+ #copy_src_platform_files(simulator_platform)
copy_src_platform_files(simulator64_platform)
copy_src_platform_files(device_platform)
copy_src_platform_files(device64_platform)
if generate_osx:
- copy_src_platform_files(desktop32_platform)
+ #copy_src_platform_files(desktop32_platform)
copy_src_platform_files(desktop64_platform)
platform_headers = collections.defaultdict(set)
if generate_ios:
- build_target(simulator_platform, platform_headers)
+ #build_target(simulator_platform, platform_headers)
build_target(simulator64_platform, platform_headers)
build_target(device_platform, platform_headers)
build_target(device64_platform, platform_headers)
if generate_osx:
- build_target(desktop32_platform, platform_headers)
+ #build_target(desktop32_platform, platform_headers)
build_target(desktop64_platform, platform_headers)
mkdir_p('darwin_common/include')
--- libffi-3.2.1.old/configure 2014-11-12 12:59:57.000000000 +0100
+++ libffi-3.2.1/configure 2018-10-26 09:02:12.000000000 +0200
@@ -18725,11 +18725,11 @@
toolexecdir="${libdir}"/gcc-lib/'$(target_alias)'
toolexeclibdir="${libdir}"
fi
- multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
- esac
+ # multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
+ # case $multi_os_directory in
+ # .) ;; # Avoid trailing /.
+ # ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+ # esac
else
toolexeclibdir="${libdir}"
--- libffi-3.2.1.old/configure.ac 2014-11-12 12:56:51.000000000 +0100
+++ libffi-3.2.1/configure.ac 2018-10-26 09:00:50.000000000 +0200
@@ -601,11 +601,11 @@
toolexecdir="${libdir}"/gcc-lib/'$(target_alias)'
toolexeclibdir="${libdir}"
fi
- multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
- esac
+ # multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
+ # case $multi_os_directory in
+ # .) ;; # Avoid trailing /.
+ # ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+ # esac
AC_SUBST(toolexecdir)
else
toolexeclibdir="${libdir}"
--- libffi-3.2.1.old/libffi.xcodeproj/project.pbxproj 2018-10-26 17:31:30.000000000 +0200
+++ libffi-3.2.1/libffi.xcodeproj/project.pbxproj 2018-10-26 17:30:17.000000000 +0200
@@ -24,20 +24,11 @@
DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716F187F1D9B00A76262 /* ffi_armv7.c */; };
DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7170187F1D9B00A76262 /* sysv_armv7.S */; };
DBFA717B187F1D9B00A76262 /* trampoline_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */; };
- DBFA717C187F1D9B00A76262 /* darwin64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */; };
- DBFA717D187F1D9B00A76262 /* darwin_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7174187F1D9B00A76262 /* darwin_i386.S */; };
- DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */; };
- DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7176187F1D9B00A76262 /* ffi_i386.c */; };
- DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7182187F1DA100A76262 /* ffi_i386.h */; settings = {ATTRIBUTES = (Private, ); }; };
DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7183187F1DA100A76262 /* ffi_x86_64.h */; settings = {ATTRIBUTES = (Private, ); }; };
- DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7184187F1DA100A76262 /* fficonfig_i386.h */; settings = {ATTRIBUTES = (Private, ); }; };
DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */; settings = {ATTRIBUTES = (Private, ); }; };
- DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7186187F1DA100A76262 /* ffitarget_i386.h */; settings = {ATTRIBUTES = (Private, ); }; };
DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */; settings = {ATTRIBUTES = (Private, ); }; };
DBFA7194187F1DA100A76262 /* darwin64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */; };
- DBFA7195187F1DA100A76262 /* darwin_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718B187F1DA100A76262 /* darwin_i386.S */; };
DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */; };
- DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718D187F1DA100A76262 /* ffi_i386.c */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -81,20 +72,11 @@
DBFA716F187F1D9B00A76262 /* ffi_armv7.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_armv7.c; sourceTree = "<group>"; };
DBFA7170187F1D9B00A76262 /* sysv_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_armv7.S; sourceTree = "<group>"; };
DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = trampoline_armv7.S; sourceTree = "<group>"; };
- DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64_x86_64.S; sourceTree = "<group>"; };
- DBFA7174187F1D9B00A76262 /* darwin_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin_i386.S; sourceTree = "<group>"; };
- DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = "<group>"; };
- DBFA7176187F1D9B00A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = "<group>"; };
- DBFA7182187F1DA100A76262 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
DBFA7183187F1DA100A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = "<group>"; };
- DBFA7184187F1DA100A76262 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = "<group>"; };
- DBFA7186187F1DA100A76262 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = "<group>"; };
DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64_x86_64.S; sourceTree = "<group>"; };
- DBFA718B187F1DA100A76262 /* darwin_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin_i386.S; sourceTree = "<group>"; };
DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = "<group>"; };
- DBFA718D187F1DA100A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
@@ -182,7 +164,6 @@
children = (
DBFA716B187F1D9B00A76262 /* aarch64 */,
DBFA716E187F1D9B00A76262 /* arm */,
- DBFA7172187F1D9B00A76262 /* x86 */,
);
path = src;
sourceTree = "<group>";
@@ -206,17 +187,6 @@
path = arm;
sourceTree = "<group>";
};
- DBFA7172187F1D9B00A76262 /* x86 */ = {
- isa = PBXGroup;
- children = (
- DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */,
- DBFA7174187F1D9B00A76262 /* darwin_i386.S */,
- DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */,
- DBFA7176187F1D9B00A76262 /* ffi_i386.c */,
- );
- path = x86;
- sourceTree = "<group>";
- };
DBFA7180187F1DA100A76262 /* darwin_osx */ = {
isa = PBXGroup;
children = (
@@ -229,11 +199,8 @@
DBFA7181187F1DA100A76262 /* include */ = {
isa = PBXGroup;
children = (
- DBFA7182187F1DA100A76262 /* ffi_i386.h */,
DBFA7183187F1DA100A76262 /* ffi_x86_64.h */,
- DBFA7184187F1DA100A76262 /* fficonfig_i386.h */,
DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */,
- DBFA7186187F1DA100A76262 /* ffitarget_i386.h */,
DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */,
);
path = include;
@@ -251,9 +218,7 @@
isa = PBXGroup;
children = (
DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */,
- DBFA718B187F1DA100A76262 /* darwin_i386.S */,
DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */,
- DBFA718D187F1DA100A76262 /* ffi_i386.c */,
);
path = x86;
sourceTree = "<group>";
@@ -269,12 +234,9 @@
DBFA714D187F1D8600A76262 /* ffitarget.h in Headers */,
DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */,
DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */,
- DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */,
- DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */,
DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */,
DBFA714C187F1D8600A76262 /* fficonfig.h in Headers */,
DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */,
- DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -321,7 +283,7 @@
DB13B15C1849DEB70010F42D /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0510;
+ LastUpgradeCheck = 1000;
};
buildConfigurationList = DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */;
compatibilityVersion = "Xcode 3.2";
@@ -366,7 +328,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-osx";
+ shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-osx\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -375,17 +337,13 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */,
DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */,
DBFA717B187F1D9B00A76262 /* trampoline_armv7.S in Sources */,
DBFA714E187F1D8600A76262 /* closures.c in Sources */,
DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */,
- DBFA717D187F1D9B00A76262 /* darwin_i386.S in Sources */,
DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */,
- DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */,
DBFA7158187F1D8600A76262 /* raw_api.c in Sources */,
DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */,
- DBFA717C187F1D9B00A76262 /* darwin64_x86_64.S in Sources */,
DBFA715A187F1D8600A76262 /* types.c in Sources */,
DBFA7177187F1D9B00A76262 /* ffi_arm64.c in Sources */,
);
@@ -396,9 +354,7 @@
buildActionMask = 2147483647;
files = (
DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */,
- DBFA7195187F1DA100A76262 /* darwin_i386.S in Sources */,
DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */,
- DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */,
DBFA715B187F1D8600A76262 /* types.c in Sources */,
DBFA7159187F1D8600A76262 /* raw_api.c in Sources */,
DBFA714F187F1D8600A76262 /* closures.c in Sources */,
@@ -412,21 +368,74 @@
DB13B1601849DEB70010F42D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
darwin_common/include,
);
ONLY_ACTIVE_ARCH = YES;
+ VALID_ARCHS = x86_64;
};
name = Debug;
};
DB13B1611849DEB70010F42D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
darwin_common/include,
);
+ VALID_ARCHS = x86_64;
};
name = Release;
};
@@ -434,7 +443,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -467,7 +475,7 @@
"$(inherited)",
darwin_ios/include,
);
- IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
"IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = ffi;
@@ -480,7 +488,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -507,7 +514,7 @@
"$(inherited)",
darwin_ios/include,
);
- IPHONEOS_DEPLOYMENT_TARGET = 5.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
"IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = ffi;
--- libffi-3.2.1.old/libffi.xcodeproj/project.pbxproj.orig 2018-10-26 17:31:30.000000000 +0200
+++ libffi-3.2.1/libffi.xcodeproj/project.pbxproj.orig 2018-10-26 17:27:16.000000000 +0200
@@ -54,7 +54,7 @@
/* Begin PBXFileReference section */
DB13B1661849DF1E0010F42D /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
- DB13B1911849DF510010F42D /* ffi.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = ffi.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+ DB13B1911849DF510010F42D /* libffi.a */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
DBFA713E187F1D8600A76262 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
DBFA713F187F1D8600A76262 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = "<group>"; };
DBFA7140187F1D8600A76262 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = "<group>"; };
@@ -112,7 +112,7 @@
isa = PBXGroup;
children = (
DB13B1661849DF1E0010F42D /* libffi.a */,
- DB13B1911849DF510010F42D /* ffi.dylib */,
+ DB13B1911849DF510010F42D /* libffi.a */,
);
name = Products;
sourceTree = "<group>";
@@ -312,7 +312,7 @@
);
name = "libffi-Mac";
productName = ffi;
- productReference = DB13B1911849DF510010F42D /* ffi.dylib */;
+ productReference = DB13B1911849DF510010F42D /* libffi.a */;
productType = "com.apple.product-type.library.dynamic";
};
/* End PBXNativeTarget section */
@@ -535,6 +535,7 @@
COPY_PHASE_STRIP = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
+ EXECUTABLE_EXTENSION = a;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -558,7 +559,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-Wl,-no_compact_unwind";
- PRODUCT_NAME = ffi;
+ PRODUCT_NAME = libffi;
SDKROOT = macosx;
};
name = Debug;
@@ -583,6 +584,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
ENABLE_NS_ASSERTIONS = NO;
+ EXECUTABLE_EXTENSION = a;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -598,7 +600,7 @@
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.6;
OTHER_LDFLAGS = "-Wl,-no_compact_unwind";
- PRODUCT_NAME = ffi;
+ PRODUCT_NAME = libffi;
SDKROOT = macosx;
};
name = Release;

View file

@ -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()

View file

@ -1,31 +0,0 @@
# -*- coding: utf-8 -*-
import sys
from kivy_ios.toolchain import Recipe
import logging
logger = logging.getLogger(__name__)
class HostpythonAliasRecipe(Recipe):
"""
Note this recipe was created to handle both hostpython2 and hostpython3.
As hostpython2 support was dropped, this could probably be simplified.
"""
is_alias = True
def init_after_import(self, ctx):
hostpython = ctx.state.get("hostpython")
if not hostpython:
# search in wanted_recipes if it's the first time
if "hostpython3" in ctx.wanted_recipes:
hostpython = "hostpython3"
else:
logger.error("No hostpython version set in the build.")
logger.error("Add python3 in your recipes:")
logger.error("./toolchain.py build python3 ...")
sys.exit(1)
if hostpython:
self.depends = [hostpython]
recipe = HostpythonAliasRecipe()

View file

@ -1 +0,0 @@
zlib zlibmodule.c -I$(prefix)/include -lz

View file

@ -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()

View file

@ -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

View file

@ -1,20 +0,0 @@
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class IdnaRecipe(PythonRecipe):
version = "2.6"
url = "https://pypi.python.org/packages/source/i/idna/idna-{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 = 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 = IdnaRecipe()

View file

@ -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()

View file

@ -1,41 +0,0 @@
/*
* Browser support
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#include <WebKit/WebKit.h>
#include "ios_wrapper.h"
void ios_open_url(char *url)
{
NSString *nsurl = [NSString stringWithCString:(char *)url encoding:NSUTF8StringEncoding];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: nsurl]];
}
/*
* Webview support
*/
void load_url_webview(char *url, int x, int y, int width, int height)
{
NSString *nsurl = [NSString stringWithCString:(char *)url encoding:NSUTF8StringEncoding];
WKWebView *webView = [[WKWebView alloc] initWithFrame: CGRectMake(x, y, width, height)];
UIWindow *window = [[UIApplication sharedApplication] keyWindow];
UIView *view = [window.rootViewController view];
[view addSubview:webView];
NSURL *ur = [[NSURL alloc] initWithString: nsurl];
NSURLRequest *req = [[NSURLRequest alloc] initWithURL: ur];
[webView loadRequest: req];
[req release];
[ur release];
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[button setTitle:@"X" forState:UIControlStateNormal];
button.frame = CGRectMake(0.0, 0.0, 40, 40);
[button addTarget:webView
action:@selector(removeFromSuperview) forControlEvents:UIControlEventTouchDown];
[webView addSubview:button];
[button release];
[webView release];
}

View file

@ -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

View file

@ -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;
}

View file

@ -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=[],
)
]
)

View file

@ -1,20 +0,0 @@
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class IpaddressRecipe(PythonRecipe):
version = "1.0.22"
url = "https://pypi.python.org/packages/source/i/ipaddress/ipaddress-{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 = 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 = IpaddressRecipe()

View file

@ -1,20 +0,0 @@
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class JsonschemaRecipe(PythonRecipe):
version = "2.6.0"
url = "https://pypi.python.org/packages/source/j/jsonschema/jsonschema-{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 = 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 = JsonschemaRecipe()

View file

@ -1,20 +0,0 @@
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class KeyringRecipe(PythonRecipe):
version = "10.4.0"
url = "https://pypi.python.org/packages/source/k/keyring/keyring-{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 = 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 = KeyringRecipe()

View file

@ -1,102 +0,0 @@
"""
Author: Lawrence Du
E-mail: larrydu88@gmail.com
"""
from kivy_ios.toolchain import CythonRecipe, shprint
import sh
from os.path import join
from os import chdir
import logging
logger = logging.getLogger(__name__)
class KiventCoreRecipe(CythonRecipe):
version = 'master'
url = 'https://github.com/kivy/kivent/archive/{version}.zip'
name = 'kivent_core'
depends = ['libffi', 'kivy'] # note: unsure if libffi is necessary here
pre_build_ext = False
subbuilddir = False
cythonize = True
pbx_frameworks = ["OpenGLES"] # note: This line may be unnecessary
def get_recipe_env(self, arch):
env = super(KiventCoreRecipe, self).get_recipe_env(arch)
env['CYTHONPATH'] = self.get_recipe(
'kivy', self.ctx).get_build_dir(arch.arch)
return env
def get_build_dir(self, arch, sub=False):
"""
Call this to get the correct build_dir, where setup.py is located which is
actually under modules/core/setup.py
"""
builddir = super(KiventCoreRecipe, self).get_build_dir(str(arch))
if sub or self.subbuilddir:
core_build_dir = join(builddir, 'modules', 'core')
logger.info("Core build directory is located at {}".format(core_build_dir))
return core_build_dir
else:
logger.info("Building in {}".format(builddir))
return builddir
def build_arch(self, arch):
"""
Override build.arch to avoid calling setup.py here (Call it in
install() instead).
"""
self.subbuildir = True
self.cythonize_build()
self.biglink()
self.subbuilddir = False
def install(self):
"""
This method simply builds the command line call for calling
kivent_core/modules/core/setup.py
This constructs the equivalent of the command
"$python setup.py build_ext install"
only with the environment variables altered for each different architecture
The appropriate version of kivy also needs to be added to the path, and this
differs for each architecture (i386, x86_64, armv7, etc)
Note: This method is called by build_all() in toolchain.py
"""
arch = list(self.filtered_archs)[0]
build_dir = self.get_build_dir(arch.arch, sub=True)
logger.info("Building kivent_core {} in {}".format(arch.arch, build_dir))
chdir(build_dir)
hostpython = sh.Command(self.ctx.hostpython)
# Get the appropriate environment for this recipe (including CYTHONPATH)
# build_env = arch.get_env()
build_env = self.get_recipe_env(arch)
dest_dir = join(self.ctx.dist_dir, "root", "python3")
build_env['PYTHONPATH'] = join(dest_dir, 'lib', 'python3.7', 'site-packages')
# Add Architecture specific kivy path for 'import kivy' to PYTHONPATH
arch_kivy_path = self.get_recipe('kivy', self.ctx).get_build_dir(arch.arch)
build_env['PYTHONPATH'] = join(build_env['PYTHONPATH'], ':', arch_kivy_path)
# Make sure you call kivent_core/modules/core/setup.py
subdir_path = self.get_build_dir(str(arch), sub=True)
setup_path = join(subdir_path, "setup.py")
# Print out directories for sanity check
logger.info("ENVS", build_env)
logger.info("ROOT", self.ctx.root_dir)
logger.info("BUILD", self.ctx.build_dir)
logger.info("INCLUDE", self.ctx.include_dir)
logger.info("DISTDIR", self.ctx.dist_dir)
logger.info("ARCH KIVY LOC", self.get_recipe('kivy', self.ctx).get_build_dir(arch.arch))
shprint(hostpython, setup_path, "build_ext", "install", _env=build_env)
recipe = KiventCoreRecipe()

View file

@ -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()

View file

@ -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',

View file

@ -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()

View file

@ -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:

View file

@ -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()

View file

@ -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()

View file

@ -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])

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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,

View file

@ -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()

View file

@ -1,20 +0,0 @@
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class Pbkdf2Recipe(PythonRecipe):
version = "1.3"
url = "https://pypi.python.org/packages/source/p/pbkdf2/pbkdf2-{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 = 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 = Pbkdf2Recipe()

View file

@ -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()

View file

@ -1,20 +0,0 @@
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class ProtobufRecipe(PythonRecipe):
version = "3.6.1"
url = "https://pypi.python.org/packages/source/p/protobuf/protobuf-{version}.tar.gz"
depends = ["python", "six"]
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 = ProtobufRecipe()

View file

@ -1,20 +0,0 @@
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class Pyasn1ModulesRecipe(PythonRecipe):
version = "0.2.1"
url = "https://pypi.python.org/packages/source/p/pyasn1-modules/pyasn1-modules-{version}.tar.gz"
depends = ["python", "pyasn1"]
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 = Pyasn1ModulesRecipe()

View file

@ -1,21 +0,0 @@
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh, os
class Pyasn1Recipe(PythonRecipe):
version = "0.4.3"
url = "https://pypi.python.org/packages/source/p/pyasn1/pyasn1-{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 = 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 = Pyasn1Recipe()

View file

@ -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()

View file

@ -1,13 +0,0 @@
from kivy_ios.toolchain import PythonRecipe
class PykkaRecipe(PythonRecipe):
version = '1.2.1'
url = 'https://github.com/jodal/pykka/archive/v{version}.zip'
depends = ['python', 'host_setuptools']
site_packages_name = 'pykka'
recipe = PykkaRecipe()

View file

@ -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()

View file

@ -1,12 +0,0 @@
from kivy_ios.toolchain import CythonRecipe
class PyobjusRecipe(CythonRecipe):
version = "master"
url = "https://github.com/kivy/pyobjus/archive/{version}.zip"
library = "libpyobjus.a"
depends = ["python"]
pre_build_ext = True
recipe = PyobjusRecipe()

View file

@ -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()

View file

@ -1,85 +0,0 @@
#####################################################################
# Static compilation instructions for all binary modules.
#####################################################################
*static*
_asyncio _asynciomodule.c
_bisect _bisectmodule.c
_blake2 _blake2/blake2module.c _blake2/blake2b_impl.c _blake2/blake2s_impl.c
_sqlite3 -I$(srcdir)/Modules/_sqlite -DMODULE_NAME='\"sqlite3\"' _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c
# _bz2 _bz2module.c -I$(srcdir)/../bzip2/include -L$(srcdir)/../Support/BZip2 -lbz2
_codecs_cn cjkcodecs/_codecs_cn.c
_codecs_hk cjkcodecs/_codecs_hk.c
_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
_codecs_jp cjkcodecs/_codecs_jp.c
_codecs_kr cjkcodecs/_codecs_kr.c
_codecs_tw cjkcodecs/_codecs_tw.c
_contextvars _contextvarsmodule.c
_crypt _cryptmodule.c
_csv _csv.c
_datetime _datetimemodule.c
_elementtree _elementtree.c \
-I$(srcdir)/Modules/expat
-DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
_hashlib _hashopenssl.c -lssl -DUSE_SSL
_heapq _heapqmodule.c
_json _json.c
_lsprof _lsprof.o rotatingtree.c
# _lzma _lzmamodule.c -I$(srcdir)/../xz/include -L$(srcdir)/../Support/XZ -llzma
_md5 md5module.c
_multibytecodec cjkcodecs/multibytecodec.c
#multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c
_opcode _opcode.c
_queue _queuemodule.c
_pickle _pickle.c
# _posixsubprocess _posixsubprocess.c
_random _randommodule.c
_sha1 sha1module.c
_sha3 _sha3/sha3module.c
_sha256 sha256module.c
_sha512 sha512module.c
_socket socketmodule.c
_ssl _ssl.c -lssl -DUSE_SSL
_struct _struct.c
array arraymodule.c
audioop audioop.c
binascii binascii.c
cmath cmathmodule.c _math.c
fcntl fcntlmodule.c
grp grpmodule.c
math mathmodule.c
mmap mmapmodule.c -I/usr/include
parser parsermodule.c
pyexpat expat/xmlparse.c \
expat/xmlrole.c \
expat/xmltok.c \
pyexpat.c \
-I$(srcdir)/Modules/expat \
-DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI -DXML_DEV_URANDOM
resource resource.c
select selectmodule.c
syslog syslogmodule.c
termios termios.c
unicodedata unicodedata.c
zlib zlibmodule.c -I$(prefix)/include -lz
#####################################################################
# Testing modules
#####################################################################
_ctypes_test _ctypes/_ctypes_test.c
_testbuffer _testbuffer.c
_testinternalcapi _testinternalcapi.c
_testimportmultiple _testimportmultiple.c
#####################################################################
# Modules that require additional frameworks
#####################################################################
#_curses _cursesmodule.c -lcurses -ltermcap
#_curses_panel _curses_panel.c -lpanel -lncurses
#_dbm _dbmmodule.c
#_gdbm _gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
#_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -I... -L...
#nis nismodule.c -lnsl
#ossaudiodev
#readline readline.c -lreadline -ltermcap
#spwd spwdmodule.c

View file

@ -1,205 +0,0 @@
from kivy_ios.toolchain import Recipe, shprint
from kivy_ios.context_managers import cd
from os.path import join
import sh
import shutil
import os
import logging
logger = logging.getLogger(__name__)
class Python3Recipe(Recipe):
version = "3.8.2"
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tgz"
depends = ["hostpython3", "libffi", "openssl"]
library = "libpython3.8.a"
pbx_libraries = ["libz", "libbz2", "libsqlite3"]
def init_with_ctx(self, ctx):
super().init_with_ctx(ctx)
self.set_python(self, "3.8")
ctx.python_ver_dir = "python3.8"
ctx.python_prefix = join(ctx.dist_dir, "root", "python3")
ctx.site_packages_dir = join(
ctx.python_prefix, "lib", ctx.python_ver_dir, "site-packages")
def prebuild_arch(self, arch):
# common to all archs
if self.has_marker("patched"):
return
self.apply_patch("config.sub.patch")
self.apply_patch("configure.patch")
self.apply_patch("posixmodule.patch")
self.apply_patch("dynload_shlib.patch")
self.apply_patch("disable_explicit_blake2.patch")
self.apply_patch("disable_mremap.patch")
self.apply_patch("pyconfig_detection.patch")
self.copy_file("ModulesSetup", "Modules/Setup.local")
self.append_file("ModulesSetup.mobile", "Modules/Setup.local")
self.set_marker("patched")
def postbuild_arch(self, arch):
# include _sqlite module to .a
py_arch = arch.arch
if py_arch == "armv7":
py_arch = "arm"
elif py_arch == "arm64":
py_arch = "aarch64"
tmp_folder = "temp.ios-{}-3.8{}".format(py_arch, self.build_dir)
build_env = self.get_build_env(arch)
for o_file in [
"cache.o",
"cursor.o",
"module.o",
"row.o",
"util.o",
"connection.o",
"microprotocols.o",
"prepare_protocol.o",
"statement.o",
]:
shprint(sh.Command(build_env['AR']),
"-r",
"{}/{}".format(self.build_dir, self.library),
"{}/build/{}/Modules/_sqlite/{}".format(self.build_dir, tmp_folder, o_file))
print("Added _sqlite to archive")
def get_build_env(self, arch):
build_env = arch.get_env()
build_env["PATH"] = "{}:{}".format(
join(self.ctx.dist_dir, "hostpython3", "bin"),
os.environ["PATH"])
build_env["CFLAGS"] += " --sysroot={}".format(arch.sysroot)
return build_env
def build_arch(self, arch):
build_env = self.get_build_env(arch)
configure = sh.Command(join(self.build_dir, "configure"))
py_arch = arch.arch
if py_arch == "armv7":
py_arch = "arm"
elif py_arch == "arm64":
py_arch = "aarch64"
prefix = join(self.ctx.dist_dir, "root", "python3")
shprint(configure,
"CC={}".format(build_env["CC"]),
"LD={}".format(build_env["LD"]),
"CFLAGS={}".format(build_env["CFLAGS"]),
"LDFLAGS={} -undefined dynamic_lookup".format(build_env["LDFLAGS"]),
"ac_cv_file__dev_ptmx=yes",
"ac_cv_file__dev_ptc=no",
"ac_cv_little_endian_double=yes",
"ac_cv_func_memrchr=no",
"ac_cv_func_getentropy=no",
"ac_cv_func_getresuid=no",
"ac_cv_func_getresgid=no",
"ac_cv_func_setresgid=no",
"ac_cv_func_setresuid=no",
"ac_cv_func_plock=no",
"ac_cv_func_dup3=no",
"ac_cv_func_pipe2=no",
"ac_cv_func_preadv=no",
"ac_cv_func_pwritev=no",
"ac_cv_func_preadv2=no",
"ac_cv_func_pwritev2=no",
"ac_cv_func_mkfifoat=no",
"ac_cv_func_mknodat=no",
"ac_cv_func_posix_fadvise=no",
"ac_cv_func_posix_fallocate=no",
"ac_cv_func_sigwaitinfo=no",
"ac_cv_func_sigtimedwait=no",
"ac_cv_func_clock_settime=no",
"ac_cv_func_pthread_getcpuclockid=no",
"ac_cv_func_sched_setscheduler=no",
"ac_cv_func_sched_setparam=no",
"ac_cv_func_clock_gettime=no",
"--host={}-apple-ios".format(py_arch),
"--build=x86_64-apple-darwin",
"--prefix={}".format(prefix),
"--without-ensurepip",
"--with-system-ffi",
"--enable-ipv6",
"PYTHON_FOR_BUILD=_PYTHON_PROJECT_BASE=$(abs_builddir) \
_PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) \
PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib\
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH)\
{}".format(sh.Command(self.ctx.hostpython)),
_env=build_env)
self.apply_patch("ctypes_duplicate.patch")
shprint(sh.make, self.ctx.concurrent_make)
def install(self):
arch = list(self.filtered_archs)[0]
build_env = self.get_build_env(arch)
build_dir = self.get_build_dir(arch.arch)
shprint(sh.make, self.ctx.concurrent_make,
"-C", build_dir,
"install",
"prefix={}".format(join(self.ctx.dist_dir, "root", "python3")),
_env=build_env)
self.reduce_python()
self.install_mock_modules()
def install_mock_modules(self):
logger.info("Install mock modules")
sqlite3_src = join(self.recipe_dir, 'mock_modules', '_sqlite3')
site_packages_folder = join(
self.ctx.dist_dir, "root", "python3", "lib", "python3.8", "site-packages", "_sqlite3")
shutil.rmtree(site_packages_folder, ignore_errors=True) # Needed in case of rebuild
shutil.copytree(sqlite3_src, site_packages_folder)
def reduce_python(self):
logger.info("Reduce python")
logger.info("Remove files unlikely to be used")
with cd(join(self.ctx.dist_dir, "root", "python3")):
sh.rm("-rf", "bin", "share")
# platform binaries and configuration
with cd(join(
self.ctx.dist_dir, "root", "python3", "lib",
"python3.8", "config-3.8-darwin")):
sh.rm(
"libpython3.8.a",
"python.o",
"config.c.in",
"makesetup",
"install-sh",
)
# cleanup pkgconfig and compiled lib
with cd(join(self.ctx.dist_dir, "root", "python3", "lib")):
sh.rm("-rf", "pkgconfig", "libpython3.8.a")
# cleanup python libraries
with cd(join(
self.ctx.dist_dir, "root", "python3", "lib", "python3.8")):
sh.rm("-rf", "curses", "idlelib", "lib2to3",
"ensurepip", "turtledemo", "lib-dynload", "venv",
"pydoc_data")
sh.find(".", "-path", "*/test*/*", "-delete")
sh.find(".", "-name", "*.exe", "-type", "f", "-delete")
sh.find(".", "-name", "test*", "-type", "d", "-delete")
sh.find(".", "-iname", "*.pyc", "-delete")
sh.find(".", "-path", "*/__pycache__/*", "-delete")
sh.find(".", "-name", "__pycache__", "-type", "d", "-delete")
# now precompile to Python bytecode
hostpython = sh.Command(self.ctx.hostpython)
shprint(hostpython, "-m", "compileall", "-f", "-b")
# sh.find(".", "-iname", "*.py", "-delete")
# some pycache are recreated after compileall
sh.find(".", "-path", "*/__pycache__/*", "-delete")
sh.find(".", "-name", "__pycache__", "-type", "d", "-delete")
# create the lib zip
logger.info("Create a python3.8.zip")
sh.mv("config-3.8-darwin", "..")
sh.mv("site-packages", "..")
sh.zip("-r", "../python38.zip", sh.glob("*"))
sh.rm("-rf", sh.glob("*"))
sh.mv("../config-3.8-darwin", ".")
sh.mv("../site-packages", ".")
recipe = Python3Recipe()

View file

@ -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)
;;

View file

@ -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

View file

@ -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 ----------------*/

View file

@ -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)

View file

@ -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 */
}
}

View file

@ -1,25 +0,0 @@
diff -Naur Python-3.8.2.orig/Python/dynload_shlib.c Python-3.8.2/Python/dynload_shlib.c
--- Python-3.8.2.orig/Python/dynload_shlib.c 2020-04-12 00:17:24.000000000 +0200
+++ Python-3.8.2/Python/dynload_shlib.c 2020-04-12 00:20:10.000000000 +0200
@@ -74,6 +74,15 @@
PyOS_snprintf(funcname, sizeof(funcname),
LEAD_UNDERSCORE "%.20s_%.200s", prefix, shortname);
+ /* On IOS, dlopen crash as soon as we try to open one of our library.
+ * Instead, we have done a redirection of linking to convert our .so into a
+ * .a. Then the main executable is linked with theses symbol. So, instead
+ * of trying to dlopen, directly do the dlsym.
+ * -- Mathieu
+ */
+ return (dl_funcptr) dlsym(RTLD_SELF, funcname);
+
+ #if 0
if (fp != NULL) {
int i;
@@ -129,4 +138,5 @@
handles[nhandles++].handle = handle;
p = (dl_funcptr) dlsym(handle, funcname);
return p;
+ #endif
}

View file

@ -1,2 +0,0 @@
__version__ = 'kivy-ios'
from ._sqlite3 import * # noqa: F401, F403

Some files were not shown because too many files have changed in this diff Show more