├── .coveragerc ├── .deepsource.toml ├── .dockerignore ├── .env ├── .github ├── ISSUE_TEMPLATE.md └── workflows │ ├── push.yml │ ├── pypi-release.yml │ └── support.yml ├── .gitignore ├── .projectile ├── CHANGELOG.md ├── Dockerfile ├── LICENSE ├── MANIFEST.in ├── Makefile ├── README.md ├── ci ├── __init__.py ├── constants.py ├── makefiles │ ├── android.mk │ └── osx.mk ├── osx_ci.sh └── rebuild_updated_recipes.py ├── distribute.sh ├── doc ├── Makefile ├── make.bat └── source │ ├── _static │ └── .empty │ ├── apis.rst │ ├── bootstraps.rst │ ├── buildoptions.rst │ ├── commands.rst │ ├── conf.py │ ├── contribute.rst │ ├── distutils.rst │ ├── docker.rst │ ├── ext │ └── sphinx_rtd_theme │ │ ├── .gitignore │ │ ├── Gemfile │ │ ├── Gemfile.lock │ │ ├── Gruntfile.js │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.rst │ │ ├── bower.json │ │ ├── demo_docs │ │ ├── Makefile │ │ └── source │ │ │ ├── __init__.py │ │ │ ├── conf.py │ │ │ ├── demo.rst │ │ │ ├── index.rst │ │ │ ├── list.rst │ │ │ ├── static │ │ │ └── yi_jing_01_chien.jpg │ │ │ └── test_py_module │ │ │ ├── __init__.py │ │ │ └── test.py │ │ ├── package.json │ │ ├── requirements.txt │ │ ├── sass │ │ ├── _theme_badge.sass │ │ ├── _theme_badge_fa.sass │ │ ├── _theme_breadcrumbs.sass │ │ ├── _theme_font_awesome_compatability.sass │ │ ├── _theme_layout.sass │ │ ├── _theme_mathjax.sass │ │ ├── _theme_rst.sass │ │ ├── _theme_variables.sass │ │ ├── badge_only.sass │ │ └── theme.sass │ │ ├── screen_desktop.png │ │ ├── screen_mobile.png │ │ ├── setup.py │ │ └── sphinx_rtd_theme │ │ ├── __init__.py │ │ ├── breadcrumbs.html │ │ ├── footer.html │ │ ├── layout.html │ │ ├── layout_old.html │ │ ├── search.html │ │ ├── searchbox.html │ │ ├── static │ │ ├── css │ │ │ ├── badge_only.css │ │ │ └── theme.css │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ │ └── js │ │ │ └── theme.js │ │ ├── theme.conf │ │ └── versions.html │ ├── index.rst │ ├── launcher.rst │ ├── quickstart.rst │ ├── recipes.rst │ ├── services.rst │ ├── testing_pull_requests.rst │ └── troubleshooting.rst ├── pythonforandroid ├── __init__.py ├── androidndk.py ├── archs.py ├── bdistapk.py ├── bootstrap.py ├── bootstraps │ ├── __init__.py │ ├── common │ │ └── build │ │ │ ├── ant.properties │ │ │ ├── build.py │ │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ ├── jni │ │ │ ├── Android.mk │ │ │ └── application │ │ │ │ ├── Android.mk │ │ │ │ └── src │ │ │ │ ├── Android.mk │ │ │ │ └── start.c │ │ │ ├── src │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── org │ │ │ │ ├── kamranzafar │ │ │ │ └── jtar │ │ │ │ │ ├── Octal.java │ │ │ │ │ ├── TarConstants.java │ │ │ │ │ ├── TarEntry.java │ │ │ │ │ ├── TarHeader.java │ │ │ │ │ ├── TarInputStream.java │ │ │ │ │ ├── TarOutputStream.java │ │ │ │ │ └── TarUtils.java │ │ │ │ ├── kivy │ │ │ │ └── android │ │ │ │ │ ├── PythonService.java │ │ │ │ │ └── PythonUtil.java │ │ │ │ └── renpy │ │ │ │ └── android │ │ │ │ ├── AssetExtract.java │ │ │ │ ├── Hardware.java │ │ │ │ └── ResourceManager.java │ │ │ ├── templates │ │ │ ├── Service.tmpl.java │ │ │ ├── build.properties │ │ │ ├── build.tmpl.gradle │ │ │ ├── build.tmpl.xml │ │ │ ├── custom_rules.tmpl.xml │ │ │ ├── gradle.tmpl.properties │ │ │ ├── kivy-icon.png │ │ │ ├── kivy-presplash.jpg │ │ │ └── lottie.xml │ │ │ └── whitelist.txt │ ├── empty │ │ ├── __init__.py │ │ └── build │ │ │ └── .gitkeep │ ├── sdl2 │ │ ├── __init__.py │ │ └── build │ │ │ ├── .gitignore │ │ │ ├── blacklist.txt │ │ │ ├── jni │ │ │ ├── Application.mk │ │ │ └── application │ │ │ │ └── src │ │ │ │ ├── Android_static.mk │ │ │ │ └── bootstrap_name.h │ │ │ ├── src │ │ │ ├── main │ │ │ │ ├── assets │ │ │ │ │ └── .gitkeep │ │ │ │ ├── java │ │ │ │ │ ├── .gitkeep │ │ │ │ │ └── org │ │ │ │ │ │ └── kivy │ │ │ │ │ │ └── android │ │ │ │ │ │ ├── GenericBroadcastReceiver.java │ │ │ │ │ │ ├── GenericBroadcastReceiverCallback.java │ │ │ │ │ │ ├── PythonActivity.java │ │ │ │ │ │ └── launcher │ │ │ │ │ │ ├── Project.java │ │ │ │ │ │ ├── ProjectAdapter.java │ │ │ │ │ │ └── ProjectChooser.java │ │ │ │ ├── jniLibs │ │ │ │ │ └── .gitkeep │ │ │ │ ├── libs │ │ │ │ │ └── .gitkeep │ │ │ │ └── res │ │ │ │ │ ├── drawable-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable │ │ │ │ │ └── .gitkeep │ │ │ │ │ ├── layout │ │ │ │ │ ├── chooser_item.xml │ │ │ │ │ ├── main.xml │ │ │ │ │ ├── project_chooser.xml │ │ │ │ │ └── project_empty.xml │ │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ └── .gitkeep │ │ │ │ │ └── mipmap │ │ │ │ │ └── .gitkeep │ │ │ └── patches │ │ │ │ └── SDLActivity.java.patch │ │ │ └── templates │ │ │ ├── AndroidManifest.tmpl.xml │ │ │ └── strings.tmpl.xml │ ├── service_library │ │ ├── __init__.py │ │ └── build │ │ │ ├── jni │ │ │ └── application │ │ │ │ └── src │ │ │ │ └── bootstrap_name.h │ │ │ ├── src │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── kivy │ │ │ │ │ └── android │ │ │ │ │ ├── GenericBroadcastReceiver.java │ │ │ │ │ ├── GenericBroadcastReceiverCallback.java │ │ │ │ │ └── PythonActivity.java │ │ │ │ └── res │ │ │ │ └── mipmap │ │ │ │ └── .gitkeep │ │ │ └── templates │ │ │ ├── AndroidManifest.tmpl.xml │ │ │ └── Service.tmpl.java │ ├── service_only │ │ ├── __init__.py │ │ └── build │ │ │ ├── blacklist.txt │ │ │ ├── jni │ │ │ ├── Android.mk │ │ │ ├── Application.mk │ │ │ └── application │ │ │ │ └── src │ │ │ │ ├── Android.mk │ │ │ │ ├── Android_static.mk │ │ │ │ ├── bootstrap_name.h │ │ │ │ └── pyjniusjni.c │ │ │ ├── src │ │ │ └── main │ │ │ │ ├── assets │ │ │ │ └── .gitkeep │ │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── kivy │ │ │ │ │ └── android │ │ │ │ │ └── PythonActivity.java │ │ │ │ ├── jniLibs │ │ │ │ └── .gitkeep │ │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── .gitkeep │ │ │ │ └── mipmap │ │ │ │ └── .gitkeep │ │ │ └── templates │ │ │ ├── AndroidManifest.tmpl.xml │ │ │ ├── Service.tmpl.java │ │ │ └── strings.tmpl.xml │ └── webview │ │ ├── __init__.py │ │ └── build │ │ ├── blacklist.txt │ │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ └── application │ │ │ └── src │ │ │ ├── Android.mk │ │ │ ├── Android_static.mk │ │ │ ├── bootstrap_name.h │ │ │ └── pyjniusjni.c │ │ ├── proguard-project.txt │ │ ├── src │ │ └── main │ │ │ ├── assets │ │ │ └── .gitkeep │ │ │ ├── java │ │ │ └── org │ │ │ │ └── kivy │ │ │ │ └── android │ │ │ │ ├── GenericBroadcastReceiver.java │ │ │ │ ├── GenericBroadcastReceiverCallback.java │ │ │ │ └── PythonActivity.java │ │ │ ├── jniLibs │ │ │ └── .gitkeep │ │ │ └── res │ │ │ ├── drawable │ │ │ ├── .gitkeep │ │ │ └── icon.png │ │ │ ├── layout │ │ │ └── main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ └── .gitkeep │ │ │ ├── mipmap │ │ │ └── .gitkeep │ │ │ └── values │ │ │ └── strings.xml │ │ ├── templates │ │ ├── AndroidManifest.tmpl.xml │ │ ├── WebViewLoader.tmpl.java │ │ ├── strings.tmpl.xml │ │ └── test │ │ │ ├── build.tmpl.xml │ │ │ └── build.xml.tmpl │ │ └── webview_includes │ │ ├── _load.html │ │ └── _loading_style.css ├── build.py ├── checkdependencies.py ├── distribution.py ├── entrypoints.py ├── graph.py ├── includes │ └── arm64-v8a │ │ └── machine │ │ └── cpu-features.h ├── logger.py ├── patching.py ├── prerequisites.py ├── pythonpackage.py ├── recipe.py ├── recipes │ ├── Pillow │ │ ├── __init__.py │ │ └── patches │ │ │ └── fix-setup.patch │ ├── __init__.py │ ├── aiohttp │ │ └── __init__.py │ ├── android │ │ ├── __init__.py │ │ └── src │ │ │ ├── android │ │ │ ├── __init__.py │ │ │ ├── _android.pyx │ │ │ ├── _android_billing.pyx │ │ │ ├── _android_billing_jni.c │ │ │ ├── _android_jni.c │ │ │ ├── _android_sound.pyx │ │ │ ├── _android_sound_jni.c │ │ │ ├── _ctypes_library_finder.py │ │ │ ├── activity.py │ │ │ ├── billing.py │ │ │ ├── broadcast.py │ │ │ ├── loadingscreen.py │ │ │ ├── mixer.py │ │ │ ├── permissions.py │ │ │ ├── runnable.py │ │ │ └── storage.py │ │ │ └── setup.py │ ├── apsw │ │ └── __init__.py │ ├── argon2-cffi │ │ └── __init__.py │ ├── atom │ │ └── __init__.py │ ├── audiostream │ │ └── __init__.py │ ├── av │ │ └── __init__.py │ ├── av_codecs │ │ └── __init__.py │ ├── bcrypt │ │ └── __init__.py │ ├── boost │ │ ├── __init__.py │ │ ├── disable-so-version.patch │ │ ├── fix-android-issues.patch │ │ ├── use-android-libs.patch │ │ └── user-config.jam │ ├── brokenrecipe │ │ └── __init__.py │ ├── cffi │ │ ├── __init__.py │ │ └── disable-pkg-config.patch │ ├── coverage │ │ ├── __init__.py │ │ └── fallback-utf8.patch │ ├── cppy │ │ └── __init__.py │ ├── cryptography │ │ └── __init__.py │ ├── cymunk │ │ └── __init__.py │ ├── cython │ │ └── __init__.py │ ├── decorator │ │ └── __init__.py │ ├── enaml │ │ ├── 0001-Update-setup.py.patch │ │ └── __init__.py │ ├── ethash │ │ └── __init__.py │ ├── evdev │ │ ├── __init__.py │ │ ├── evcnt.patch │ │ ├── evdev-permissions.patch │ │ ├── include-dir.patch │ │ ├── keycnt.patch │ │ └── remove-uinput.patch │ ├── feedparser │ │ └── __init__.py │ ├── ffmpeg │ │ ├── __init__.py │ │ └── patches │ │ │ └── configure.patch │ ├── ffpyplayer │ │ └── __init__.py │ ├── ffpyplayer_codecs │ │ └── __init__.py │ ├── flask │ │ └── __init__.py │ ├── fontconfig │ │ └── __init__.py │ ├── freetype-py │ │ ├── __init__.py │ │ └── fall-back-to-distutils.patch │ ├── freetype │ │ └── __init__.py │ ├── genericndkbuild │ │ └── __init__.py │ ├── gevent │ │ ├── __init__.py │ │ └── cross_compiling.patch │ ├── greenlet │ │ └── __init__.py │ ├── groestlcoin_hash │ │ └── __init__.py │ ├── harfbuzz │ │ └── __init__.py │ ├── hostpython3 │ │ ├── __init__.py │ │ └── patches │ │ │ └── pyconfig_detection.patch │ ├── icu │ │ ├── __init__.py │ │ └── disable-libs-version.patch │ ├── ifaddr │ │ ├── __init__.py │ │ └── getifaddrs.patch │ ├── ifaddrs │ │ └── __init__.py │ ├── jedi │ │ ├── __init__.py │ │ └── fix_MergedNamesDict_get.patch │ ├── jpeg │ │ ├── Application.mk │ │ ├── __init__.py │ │ ├── build-static.patch │ │ └── remove-version.patch │ ├── kivy │ │ ├── __init__.py │ │ └── sdl-gl-swapwindow-nogil.patch │ ├── kivy3 │ │ └── __init__.py │ ├── kiwisolver │ │ └── __init__.py │ ├── lapack │ │ └── __init__.py │ ├── leveldb │ │ └── __init__.py │ ├── libbz2 │ │ ├── __init__.py │ │ └── lib_android.patch │ ├── libcurl │ │ └── __init__.py │ ├── libexpat │ │ └── __init__.py │ ├── libffi │ │ ├── Application.mk │ │ ├── __init__.py │ │ ├── disable-mips-check.patch │ │ └── remove-version-info.patch │ ├── libgeos │ │ └── __init__.py │ ├── libglob │ │ ├── __init__.py │ │ └── glob.patch │ ├── libiconv │ │ └── __init__.py │ ├── liblzma │ │ └── __init__.py │ ├── libmysqlclient │ │ ├── Linux.cmake │ │ ├── __init__.py │ │ ├── add-custom-platform.patch │ │ ├── disable-soname.patch │ │ ├── disable-soversion.patch │ │ └── p4a.cmake │ ├── libogg │ │ └── __init__.py │ ├── libpcre │ │ └── __init__.py │ ├── libpq │ │ └── __init__.py │ ├── librt │ │ └── __init__.py │ ├── libsecp256k1 │ │ └── __init__.py │ ├── libshine │ │ └── __init__.py │ ├── libsodium │ │ ├── __init__.py │ │ └── size_max_fix.patch │ ├── libtorrent │ │ ├── __init__.py │ │ ├── disable-so-version.patch │ │ ├── setup-lib-name.patch │ │ ├── use-soname-python.patch │ │ └── user-config-openssl.patch │ ├── libtribler │ │ └── __init__.py │ ├── libvorbis │ │ └── __init__.py │ ├── libvpx │ │ ├── __init__.py │ │ └── patches │ │ │ └── 0001-android-force-neon-runtime.patch │ ├── libwebp │ │ └── __init__.py │ ├── libx264 │ │ └── __init__.py │ ├── libxml2 │ │ ├── __init__.py │ │ ├── add-glob.c.patch │ │ ├── glob.c │ │ └── glob.h │ ├── libxslt │ │ ├── __init__.py │ │ └── fix-dlopen.patch │ ├── libzbar │ │ ├── __init__.py │ │ └── werror.patch │ ├── libzmq │ │ └── __init__.py │ ├── lxml │ │ └── __init__.py │ ├── m2crypto │ │ └── __init__.py │ ├── matplotlib │ │ ├── __init__.py │ │ ├── libfreetype.pc.template │ │ └── setup.cfg.template │ ├── msgpack-python │ │ └── __init__.py │ ├── ndghttpsclient │ ├── netifaces │ │ ├── __init__.py │ │ └── fix-build.patch │ ├── numpy │ │ ├── __init__.py │ │ └── patches │ │ │ ├── add_libm_explicitly_to_build.patch │ │ │ ├── ranlib.patch │ │ │ └── remove-default-paths.patch │ ├── omemo-backend-signal │ │ └── __init__.py │ ├── omemo │ │ └── __init__.py │ ├── openal │ │ └── __init__.py │ ├── opencv │ │ ├── __init__.py │ │ └── patches │ │ │ └── p4a_build.patch │ ├── opencv_extras │ │ └── __init__.py │ ├── openssl │ │ ├── __init__.py │ │ └── disable-sover.patch │ ├── pandas │ │ ├── __init__.py │ │ └── fix_numpy_includes.patch │ ├── pil │ │ └── __init__.py │ ├── png │ │ ├── __init__.py │ │ └── build_shared_library.patch │ ├── preppy │ │ ├── __init__.py │ │ └── fix-setup.patch │ ├── protobuf_cpp │ │ ├── __init__.py │ │ └── fix-python3-compatibility.patch │ ├── psycopg2 │ │ └── __init__.py │ ├── py3dns │ │ ├── __init__.py │ │ └── patches │ │ │ └── android.patch │ ├── pyaml │ │ └── __init__.py │ ├── pybind11 │ │ └── __init__.py │ ├── pycparser │ │ └── __init__.py │ ├── pycrypto │ │ ├── __init__.py │ │ └── add_length.patch │ ├── pycryptodome │ │ └── __init__.py │ ├── pydantic │ │ └── __init__.py │ ├── pygame │ │ └── __init__.py │ ├── pyicu │ │ ├── __init__.py │ │ └── locale.patch │ ├── pyjnius │ │ ├── __init__.py │ │ └── genericndkbuild_jnienv_getter.patch │ ├── pyleveldb │ │ ├── __init__.py │ │ └── bindings-only.patch │ ├── pymunk │ │ └── __init__.py │ ├── pynacl │ │ └── __init__.py │ ├── pyogg │ │ ├── __init__.py │ │ └── patches │ │ │ └── fix-find-lib.patch │ ├── pyopenal │ │ ├── __init__.py │ │ └── patches │ │ │ └── fix-find-lib.patch │ ├── pyopenssl │ │ ├── __init__.py │ │ └── fix-dlfcn.patch │ ├── pyproj │ │ └── __init__.py │ ├── pyrxp │ │ └── __init__.py │ ├── pysdl2 │ │ └── __init__.py │ ├── pysha3 │ │ └── __init__.py │ ├── python3 │ │ ├── __init__.py │ │ └── patches │ │ │ ├── py3.7.1_fix-ctypes-util-find-library.patch │ │ │ ├── py3.7.1_fix-zlib-version.patch │ │ │ ├── py3.7.1_fix_cortex_a8.patch │ │ │ ├── py3.8.1.patch │ │ │ ├── py3.8.1_fix_cortex_a8.patch │ │ │ ├── pyconfig_detection.patch │ │ │ └── reproducible-buildinfo.diff │ ├── pyusb │ │ ├── __init__.py │ │ └── fix-android.patch │ ├── pyzbar │ │ └── __init__.py │ ├── pyzmq │ │ └── __init__.py │ ├── regex │ │ └── __init__.py │ ├── reportlab │ │ ├── __init__.py │ │ └── patches │ │ │ └── fix-setup.patch │ ├── ruamel.yaml │ │ ├── __init__.py │ │ └── disable-pip-req.patch │ ├── scipy │ │ └── __init__.py │ ├── scrypt │ │ ├── __init__.py │ │ └── remove_librt.patch │ ├── sdl2 │ │ ├── __init__.py │ │ └── sdl-orientation-pr-6984.diff │ ├── sdl2_image │ │ ├── __init__.py │ │ └── enable-webp.patch │ ├── sdl2_mixer │ │ └── __init__.py │ ├── sdl2_ttf │ │ └── __init__.py │ ├── secp256k1 │ │ ├── __init__.py │ │ ├── cross_compile.patch │ │ ├── drop_setup_requires.patch │ │ ├── find_lib.patch │ │ ├── no-download.patch │ │ └── pkg-config.patch │ ├── setuptools │ │ └── __init__.py │ ├── shapely │ │ ├── __init__.py │ │ └── setup.patch │ ├── six │ │ └── __init__.py │ ├── snappy │ │ └── __init__.py │ ├── spine │ │ └── __init__.py │ ├── sqlalchemy │ │ ├── __init__.py │ │ └── zipsafe.patch │ ├── sqlite3 │ │ ├── Android.mk │ │ └── __init__.py │ ├── storm │ │ └── __init__.py │ ├── sympy │ │ ├── __init__.py │ │ ├── fix_android_detection.patch │ │ ├── fix_pretty_print.patch │ │ └── fix_timeutils.patch │ ├── tflite-runtime │ │ ├── CMakeLists.patch │ │ ├── __init__.py │ │ └── build_with_cmake.patch │ ├── twisted │ │ ├── __init__.py │ │ ├── incremental.patch │ │ └── remove_tests.patch │ ├── ujson │ │ └── __init__.py │ ├── vispy │ │ ├── __init__.py │ │ ├── disable_font_triage.patch │ │ ├── disable_freetype.patch │ │ ├── disable_freetype.patch_backup │ │ ├── remove_ati_check.patch │ │ └── use_es2.patch │ ├── vlc │ │ └── __init__.py │ ├── wsaccel │ │ └── __init__.py │ ├── x3dh │ │ ├── __init__.py │ │ └── requires_fix.patch │ ├── xeddsa │ │ ├── __init__.py │ │ └── remove_dependencies.patch │ ├── zbar │ │ ├── __init__.py │ │ └── zbar-0.10-python-crash.patch │ ├── zbarlight │ │ └── __init__.py │ ├── zeroconf │ │ ├── __init__.py │ │ └── patches │ │ │ └── setup.patch │ ├── zope │ │ └── __init__.py │ └── zope_interface │ │ ├── __init__.py │ │ ├── fix-init.patch │ │ └── no_tests.patch ├── recommendations.py ├── toolchain.py ├── tools │ ├── biglink │ ├── liblink │ └── liblink.sh └── util.py ├── setup.py ├── testapps ├── on_device_unit_tests │ ├── README.rst │ ├── buildozer.spec │ ├── setup.py │ └── test_app │ │ ├── app_flask.py │ │ ├── app_kivy.py │ │ ├── app_service.py │ │ ├── constants.py │ │ ├── main.py │ │ ├── screen_keyboard.kv │ │ ├── screen_orientation.kv │ │ ├── screen_service.kv │ │ ├── screen_unittests.kv │ │ ├── static │ │ ├── Blanka-Regular.otf │ │ ├── colours.png │ │ ├── coloursinv.png │ │ └── flask.css │ │ ├── templates │ │ ├── base.html │ │ ├── index.html │ │ ├── page2.html │ │ └── unittests.html │ │ ├── tests │ │ ├── __init__.py │ │ ├── mixin.py │ │ └── test_requirements.py │ │ ├── tools.py │ │ ├── widgets.kv │ │ └── widgets.py ├── setup_testapp_python3_sqlite_openssl.py ├── setup_vispy.py ├── testapp_sqlite_openssl │ ├── colours.png │ └── main.py ├── testapp_vispy │ └── main.py ├── testlauncher_setup │ └── sdl2.py └── testlauncherreboot_setup │ └── sdl2.py ├── tests ├── recipes │ ├── recipe_ctx.py │ ├── recipe_lib_test.py │ ├── test_freetype.py │ ├── test_gevent.py │ ├── test_harfbuzz.py │ ├── test_hostpython3.py │ ├── test_icu.py │ ├── test_jpeg.py │ ├── test_leveldb.py │ ├── test_libbz2.py │ ├── test_libcurl.py │ ├── test_libexpat.py │ ├── test_libffi.py │ ├── test_libgeos.py │ ├── test_libiconv.py │ ├── test_liblzma.py │ ├── test_libmysqlclient.py │ ├── test_libogg.py │ ├── test_libpq.py │ ├── test_libsecp256k1.py │ ├── test_libshine.py │ ├── test_libvorbis.py │ ├── test_libvpx.py │ ├── test_libx264.py │ ├── test_libxml2.py │ ├── test_libxslt.py │ ├── test_openal.py │ ├── test_openssl.py │ ├── test_pandas.py │ ├── test_png.py │ ├── test_pyicu.py │ ├── test_python3.py │ ├── test_reportlab.py │ ├── test_sdl2_mixer.py │ └── test_snappy.py ├── test_androidmodule_ctypes_finder.py ├── test_androidndk.py ├── test_archs.py ├── test_bootstrap.py ├── test_bootstrap_build.py ├── test_build.py ├── test_distribution.py ├── test_graph.py ├── test_logger.py ├── test_prerequisites.py ├── test_pythonpackage.py ├── test_pythonpackage_basic.py ├── test_recipe.py ├── test_recommendations.py ├── test_toolchain.py └── test_util.py └── tox.ini /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | relative_files = True 3 | omit = 4 | *test* 5 | 6 | [report] 7 | exclude_lines = 8 | pragma: no cover 9 | def __repr__ 10 | raise NotImplementedError 11 | if __name__ == .__main__.: -------------------------------------------------------------------------------- /.deepsource.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | 3 | test_patterns = ["tests/**"] 4 | 5 | exclude_patterns = ["testapps/**"] 6 | 7 | [[analyzers]] 8 | name = "python" 9 | enabled = true 10 | 11 | [analyzers.meta] 12 | runtime_version = "3.x.x" -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | venv/ 2 | .buildozer/ 3 | **/.pytest_cache/ 4 | .tox/ 5 | bin/ 6 | *.pyc 7 | **/__pycache__ 8 | *.egg-info/ 9 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | # used by coveralls.io, refs: 2 | # https://coveralls-python.readthedocs.io/en/latest/usage/tox.html#github-actions 3 | CI 4 | GITHUB_ACTIONS 5 | GITHUB_REF 6 | GITHUB_SHA 7 | GITHUB_HEAD_REF 8 | GITHUB_REPOSITORY 9 | GITHUB_RUN_ID 10 | GITHUB_TOKEN 11 | -------------------------------------------------------------------------------- /.github/workflows/pypi-release.yml: -------------------------------------------------------------------------------- 1 | name: PyPI release 2 | on: [push] 3 | 4 | jobs: 5 | pypi_release: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v3 9 | - name: Set up Python 3.x 10 | uses: actions/setup-python@v4 11 | with: 12 | python-version: '3.x' 13 | - name: Install dependencies 14 | run: | 15 | python -m pip install --upgrade setuptools wheel twine 16 | - name: Build 17 | run: | 18 | python setup.py sdist bdist_wheel 19 | twine check dist/* 20 | - name: Publish package 21 | if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') 22 | uses: pypa/gh-action-pypi-publish@v1.4.2 23 | with: 24 | user: __token__ 25 | password: ${{ secrets.pypi_password }} -------------------------------------------------------------------------------- /.github/workflows/support.yml: -------------------------------------------------------------------------------- 1 | name: 'Support Requests' 2 | 3 | on: 4 | issues: 5 | types: [labeled, unlabeled, reopened] 6 | 7 | permissions: 8 | issues: write 9 | 10 | jobs: 11 | action: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: dessant/support-requests@v2 15 | with: 16 | github-token: ${{ github.token }} 17 | support-label: 'support' 18 | issue-comment: > 19 | 👋 We use the issue tracker exclusively for bug reports and feature requests. 20 | However, this issue appears to be a support request. Please use our 21 | [support channels](https://github.com/kivy/python-for-android/blob/master/README.md#support) 22 | to get help with the project. 23 | 24 | 25 | If you're having trouble installing or using python-for-android, 26 | maybe you could be interested in our [quickstart](https://python-for-android.readthedocs.io/en/latest/quickstart) guide. 27 | 28 | 29 | Let us know if this comment was made in error, and we'll be happy 30 | to reopen the issue. 31 | close-issue: true 32 | lock-issue: false -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.swo 3 | *~ 4 | 5 | #ECLIPSE + PYDEV 6 | .project 7 | .pydevproject 8 | 9 | .deps 10 | 11 | .optional-deps 12 | 13 | *.pyc 14 | *.pyo 15 | *.apk 16 | *.aab 17 | .packages 18 | python_for_android.egg-info 19 | /build/ 20 | doc/build 21 | __pycache__/ 22 | venv/ 23 | 24 | #idea/pycharm 25 | .idea/ 26 | 27 | # Unit test / coverage reports 28 | htmlcov/ 29 | .tox/ 30 | .coverage 31 | .coverage.* 32 | .cache 33 | coverage.xml 34 | *.cover 35 | .pytest_cache/ 36 | 37 | # testapp's build folder 38 | testapps/build/ 39 | 40 | # Dolphin (the KDE file manager autogenerates the file `.directory`) 41 | .directory 42 | -------------------------------------------------------------------------------- /.projectile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/.projectile -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2017 Kivy Team and other contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | 2 | include LICENSE README.md 3 | include *.toml 4 | 5 | recursive-include doc * 6 | prune doc/build 7 | 8 | recursive-include pythonforandroid *.py *.tmpl biglink liblink 9 | recursive-include pythonforandroid/recipes *.py *.patch *.diff *.c *.pyx Setup *.h 10 | 11 | recursive-include pythonforandroid/bootstraps *.properties *.xml *.java *.tmpl *.txt *.png *.aidl *.py *.sh *.c *.h *.html *.patch 12 | 13 | prune .git 14 | -------------------------------------------------------------------------------- /ci/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/ci/__init__.py -------------------------------------------------------------------------------- /ci/makefiles/osx.mk: -------------------------------------------------------------------------------- 1 | # installs Android's SDK/NDK, cython 2 | 3 | # The following variable/s can be override when running the file 4 | ANDROID_HOME ?= $(HOME)/.android 5 | 6 | all: upgrade_cython install_android_ndk_sdk 7 | 8 | upgrade_cython: 9 | pip3 install --upgrade Cython 10 | 11 | install_android_ndk_sdk: 12 | mkdir -p $(ANDROID_HOME) 13 | make -f ci/makefiles/android.mk 14 | -------------------------------------------------------------------------------- /ci/osx_ci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -x 3 | 4 | arm64_set_path_and_python_version(){ 5 | python_version="$1" 6 | if [[ $(/usr/bin/arch) = arm64 ]]; then 7 | export PATH=/opt/homebrew/bin:$PATH 8 | eval "$(pyenv init --path)" 9 | pyenv install $python_version -s 10 | pyenv global $python_version 11 | export PATH=$(pyenv prefix)/bin:$PATH 12 | fi 13 | } -------------------------------------------------------------------------------- /doc/source/_static/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/doc/source/_static/.empty -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.egg-info 3 | *.egg 4 | *build/ 5 | .tox 6 | .coverage 7 | *.DS_Store 8 | *.sass-cache 9 | .ruby-version 10 | dist/ 11 | bower_components/ 12 | node_modules/ 13 | npm-debug.log 14 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/Gemfile: -------------------------------------------------------------------------------- 1 | # A sample Gemfile 2 | source "https://rubygems.org" 3 | 4 | gem "compass" 5 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | chunky_png (1.2.9) 5 | compass (0.12.2) 6 | chunky_png (~> 1.2) 7 | fssm (>= 0.2.7) 8 | sass (~> 3.1) 9 | fssm (0.2.10) 10 | sass (3.2.12) 11 | 12 | PLATFORMS 13 | ruby 14 | 15 | DEPENDENCIES 16 | compass 17 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Dave Snider 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt 2 | include LICENSE 3 | recursive-include sphinx_rtd_theme *.conf 4 | recursive-include sphinx_rtd_theme *.css 5 | recursive-include sphinx_rtd_theme *.eot 6 | recursive-include sphinx_rtd_theme *.html 7 | recursive-include sphinx_rtd_theme *.js 8 | recursive-include sphinx_rtd_theme *.svg 9 | recursive-include sphinx_rtd_theme *.ttf 10 | recursive-include sphinx_rtd_theme *.woff 11 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sphinx-rtd-theme", 3 | "version": "1.0", 4 | "homepage": "https://github.com/snide/wyrm", 5 | "authors": [ 6 | "Dave Snider " 7 | ], 8 | "description": "Sphinx theme for readthedocs.org.", 9 | "license": "MIT", 10 | "main": [ 11 | "dist/**" 12 | ], 13 | "ignore": [ 14 | "docs", 15 | "demo_docs", 16 | ".gitignore", 17 | ".DS_Store", 18 | ".sass-cache*", 19 | ".bowerrc", 20 | "bower.json", 21 | "package.json", 22 | "Gruntfile.js", 23 | "node_modules", 24 | "bower_components", 25 | "test", 26 | "tests", 27 | "src" 28 | ], 29 | "dependencies": { 30 | "wyrm": "~0.0.x" 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/demo_docs/source/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/doc/source/ext/sphinx_rtd_theme/demo_docs/source/__init__.py -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/demo_docs/source/static/yi_jing_01_chien.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/doc/source/ext/sphinx_rtd_theme/demo_docs/source/static/yi_jing_01_chien.jpg -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/demo_docs/source/test_py_module/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/doc/source/ext/sphinx_rtd_theme/demo_docs/source/test_py_module/__init__.py -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sphinx_rtd_theme", 3 | "version": "0.0.11", 4 | "private": true, 5 | "dependencies": {}, 6 | "devDependencies": { 7 | "grunt": ">=1.3.0", 8 | "grunt-contrib-sass": "~0.7.2", 9 | "grunt-contrib-watch": "~0.4.3", 10 | "grunt-contrib-connect": "0.5.0", 11 | "grunt-contrib-clean": "0.5.0", 12 | "grunt-contrib-copy": "0.5.0", 13 | "connect-livereload": "~0.3.0", 14 | "grunt-exec": "~0.4.2", 15 | "grunt-open": "0.2.2", 16 | "matchdep": "~0.1.2" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx>=1.1 2 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sass/_theme_breadcrumbs.sass: -------------------------------------------------------------------------------- 1 | .wy-breadcrumbs li 2 | display: inline-block 3 | &.wy-breadcrumbs-aside 4 | float: right 5 | a 6 | display: inline-block 7 | padding: 5px 8 | &:first-child 9 | padding-left: 0 10 | .wy-breadcrumbs-extra 11 | margin-bottom: 0 12 | color: $text-light 13 | font-size: 80% 14 | display: inline-block 15 | 16 | 17 | +media($mobile) 18 | .wy-breadcrumbs-extra 19 | display: none 20 | .wy-breadcrumbs li.wy-breadcrumbs-aside 21 | display: none 22 | 23 | @media print 24 | .wy-breadcrumbs li.wy-breadcrumbs-aside 25 | display: none 26 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sass/_theme_font_awesome_compatability.sass: -------------------------------------------------------------------------------- 1 | .icon 2 | @extend .fa 3 | .icon-home 4 | @extend .fa-home 5 | .icon-search 6 | @extend .fa-search 7 | .icon-book 8 | @extend .fa-book 9 | .icon-caret-down 10 | @extend .fa-caret-down 11 | .icon-github 12 | @extend .fa-github 13 | .icon-bitbucket 14 | @extend .fa-bitbucket 15 | .icon-fire 16 | @extend .fa-fire 17 | .icon-circle-arrow-right 18 | @extend .fa-arrow-circle-right 19 | .icon-circle-arrow-left 20 | @extend .fa-arrow-circle-left 21 | .icon-link 22 | @extend .fa-link 23 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sass/_theme_mathjax.sass: -------------------------------------------------------------------------------- 1 | span[id*='MathJax-Span'] 2 | color: $mathjax-color 3 | 4 | .math 5 | text-align: center 6 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sass/_theme_variables.sass: -------------------------------------------------------------------------------- 1 | // In here are varibles used for sphinx_rtd_theme, they either add to or overwrite the default ones 2 | // that are set in wyrm_core/wy_variables.sass. You'll find wyrm in bower_components if you're looking 3 | // for a reference. 4 | 5 | $font-awesome-dir: "../font/" 6 | $static-img: "../img/" 7 | $mathjax-color: $text-color 8 | 9 | $base-font-family: "Lato", "proxima-nova", "Helvetica Neue", Arial, sans-serif 10 | $custom-font-family: "Roboto Slab", "ff-tisa-web-pro", "Georgia", Arial, sans-serif 11 | $custom-font-family2: Georgia, serif 12 | $code-font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace 13 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sass/badge_only.sass: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------ 2 | // CONTRIBUTORS, PLEASE READ THIS! 3 | // ------------------------------------------------------------ 4 | // This generates the RTD sticky badge for non RTD themes. As 5 | // always, only files labeled "theme_*.sass should be edited". 6 | // ------------------------------------------------------------ 7 | $border-box-sizing: false !default 8 | 9 | @import wyrm_core/wy_variables 10 | @import theme_variables 11 | @import bourbon 12 | @import neat 13 | @import wyrm_core/mixin 14 | @import wyrm_core/grid_settings 15 | @import _theme_badge_fa 16 | @import _theme_badge 17 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/screen_desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/doc/source/ext/sphinx_rtd_theme/screen_desktop.png -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/screen_mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/doc/source/ext/sphinx_rtd_theme/screen_mobile.png -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/__init__.py: -------------------------------------------------------------------------------- 1 | """Sphinx ReadTheDocs theme. 2 | 3 | From https://github.com/ryan-roemer/sphinx-bootstrap-theme. 4 | 5 | """ 6 | import os 7 | 8 | VERSION = (0, 1, 5) 9 | 10 | __version__ = ".".join(str(v) for v in VERSION) 11 | __version_full__ = __version__ 12 | 13 | 14 | def get_html_theme_path(): 15 | """Return list of HTML theme paths.""" 16 | cur_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) 17 | return cur_dir 18 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/breadcrumbs.html: -------------------------------------------------------------------------------- 1 |
2 | 18 |
19 |
20 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/searchbox.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 | 6 |
7 |
8 | -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /doc/source/ext/sphinx_rtd_theme/sphinx_rtd_theme/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = css/theme.css 4 | 5 | [options] 6 | typekit_id = hiw1hhg 7 | analytics_id = 8 | sticky_navigation = False 9 | -------------------------------------------------------------------------------- /pythonforandroid/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = '2023.05.21' 2 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/__init__.py -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/ant.properties: -------------------------------------------------------------------------------- 1 | # This file is used to override default values used by the Ant build system. 2 | # 3 | # This file must be checked into Version Control Systems, as it is 4 | # integral to the build system of your project. 5 | 6 | # This file is only used by the Ant script. 7 | 8 | # You can use this to override default values such as 9 | # 'source.dir' for the location of your java source folder and 10 | # 'out.dir' for the location of your output folder. 11 | 12 | # You can also use it define how the release builds are signed by declaring 13 | # the following properties: 14 | # 'key.store' for the location of your keystore and 15 | # 'key.alias' for the name of the key to use. 16 | # The password will be asked during the build when you use the 'release' target. 17 | 18 | source.absolute.dir = tmp-src 19 | 20 | resource.absolute.dir = src/main/res 21 | 22 | asset.absolute.dir = src/main/assets 23 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/common/build/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Mar 09 17:19:02 CET 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip 7 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/jni/Android.mk: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/jni/application/Android.mk: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/jni/application/src/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := main 6 | 7 | SDL_PATH := ../../SDL 8 | 9 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include 10 | 11 | # Add your application source files here... 12 | LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \ 13 | start.c 14 | 15 | LOCAL_CFLAGS += -I$(PYTHON_INCLUDE_ROOT) $(EXTRA_CFLAGS) 16 | 17 | LOCAL_SHARED_LIBRARIES := SDL2 python_shared 18 | 19 | LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog $(EXTRA_LDLIBS) 20 | 21 | LOCAL_LDFLAGS += -L$(PYTHON_LINK_ROOT) $(APPLICATION_ADDITIONAL_LDFLAGS) 22 | 23 | include $(BUILD_SHARED_LIBRARY) 24 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/src/main/java/org/kamranzafar/jtar/TarConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2012 Kamran Zafar 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package org.kamranzafar.jtar; 19 | 20 | /** 21 | * @author Kamran Zafar 22 | * 23 | */ 24 | public class TarConstants { 25 | public static final int EOF_BLOCK = 1024; 26 | public static final int DATA_BLOCK = 512; 27 | public static final int HEADER_BLOCK = 512; 28 | } 29 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/templates/build.properties: -------------------------------------------------------------------------------- 1 | # This file is used to override default values used by the Ant build system. 2 | # 3 | # This file must be checked in Version Control Systems, as it is 4 | # integral to the build system of your project. 5 | 6 | # This file is only used by the Ant script. 7 | 8 | # You can use this to override default values such as 9 | # 'source.dir' for the location of your java source folder and 10 | # 'out.dir' for the location of your output folder. 11 | 12 | # You can also use it define how the release builds are signed by declaring 13 | # the following properties: 14 | # 'key.store' for the location of your keystore and 15 | # 'key.alias' for the name of the key to use. 16 | # The password will be asked during the build when you use the 'release' target. 17 | 18 | key.store=${env.P4A_RELEASE_KEYSTORE} 19 | key.alias=${env.P4A_RELEASE_KEYALIAS} 20 | key.store.password=${env.P4A_RELEASE_KEYSTORE_PASSWD} 21 | key.alias.password=${env.P4A_RELEASE_KEYALIAS_PASSWD} 22 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/templates/custom_rules.tmpl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% if args.launcher %} 6 | 7 | {% else %} 8 | 9 | 10 | 11 | 12 | {% endif %} 13 | {% for dir, includes in args.extra_source_dirs %} 14 | 15 | {% endfor %} 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/templates/gradle.tmpl.properties: -------------------------------------------------------------------------------- 1 | {% if args.enable_androidx %} 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | {% endif %} -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/templates/kivy-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/common/build/templates/kivy-icon.png -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/templates/kivy-presplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/common/build/templates/kivy-presplash.jpg -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/templates/lottie.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/common/build/whitelist.txt: -------------------------------------------------------------------------------- 1 | # put files here that you need to un-blacklist 2 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/empty/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.toolchain import Bootstrap 2 | 3 | 4 | class EmptyBootstrap(Bootstrap): 5 | name = 'empty' 6 | 7 | recipe_depends = [] 8 | 9 | can_be_chosen_automatically = False 10 | 11 | def assemble_distribution(self): 12 | print('empty bootstrap has no distribute') 13 | exit(1) 14 | 15 | 16 | bootstrap = EmptyBootstrap() 17 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/empty/build/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | 4 | # Ignore Gradle GUI config 5 | gradle-app.setting 6 | 7 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 8 | !gradle-wrapper.jar 9 | 10 | # Cache of project 11 | .gradletasknamecache 12 | 13 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 14 | # gradle/wrapper/gradle-wrapper.properties 15 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/jni/Application.mk: -------------------------------------------------------------------------------- 1 | 2 | # Uncomment this if you're using STL in your project 3 | # See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information 4 | # APP_STL := stlport_static 5 | 6 | # APP_ABI := armeabi armeabi-v7a x86 7 | APP_ABI := $(ARCH) 8 | APP_PLATFORM := $(NDK_API) 9 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/jni/application/src/Android_static.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := main 6 | 7 | LOCAL_SRC_FILES := start.c 8 | 9 | LOCAL_STATIC_LIBRARIES := SDL2_static 10 | 11 | include $(BUILD_SHARED_LIBRARY) 12 | $(call import-module,SDL)LOCAL_PATH := $(call my-dir) 13 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/jni/application/src/bootstrap_name.h: -------------------------------------------------------------------------------- 1 | 2 | #define BOOTSTRAP_NAME_SDL2 3 | 4 | const char bootstrap_name[] = "SDL2"; // capitalized for historic reasons 5 | 6 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/sdl2/build/src/main/assets/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/java/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/sdl2/build/src/main/java/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/java/org/kivy/android/GenericBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package org.kivy.android; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Intent; 5 | import android.content.Context; 6 | 7 | public class GenericBroadcastReceiver extends BroadcastReceiver { 8 | 9 | GenericBroadcastReceiverCallback listener; 10 | 11 | public GenericBroadcastReceiver(GenericBroadcastReceiverCallback listener) { 12 | super(); 13 | this.listener = listener; 14 | } 15 | 16 | public void onReceive(Context context, Intent intent) { 17 | this.listener.onReceive(context, intent); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/java/org/kivy/android/GenericBroadcastReceiverCallback.java: -------------------------------------------------------------------------------- 1 | package org.kivy.android; 2 | 3 | import android.content.Intent; 4 | import android.content.Context; 5 | 6 | public interface GenericBroadcastReceiverCallback { 7 | void onReceive(Context context, Intent intent); 8 | }; 9 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/java/org/kivy/android/launcher/ProjectAdapter.java: -------------------------------------------------------------------------------- 1 | package org.kivy.android.launcher; 2 | 3 | import android.app.Activity; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.widget.ArrayAdapter; 7 | import android.widget.TextView; 8 | import android.widget.ImageView; 9 | 10 | import org.renpy.android.ResourceManager; 11 | 12 | public class ProjectAdapter extends ArrayAdapter { 13 | 14 | private ResourceManager resourceManager; 15 | 16 | public ProjectAdapter(Activity context) { 17 | super(context, 0); 18 | resourceManager = new ResourceManager(context); 19 | } 20 | 21 | public View getView(int position, View convertView, ViewGroup parent) { 22 | Project p = getItem(position); 23 | 24 | View v = resourceManager.inflateView("chooser_item"); 25 | TextView title = (TextView) resourceManager.getViewById(v, "title"); 26 | TextView author = (TextView) resourceManager.getViewById(v, "author"); 27 | ImageView icon = (ImageView) resourceManager.getViewById(v, "icon"); 28 | 29 | title.setText(p.title); 30 | author.setText(p.author); 31 | icon.setImageBitmap(p.icon); 32 | 33 | return v; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/jniLibs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/sdl2/build/src/main/jniLibs/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/libs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/sdl2/build/src/main/libs/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/sdl2/build/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/sdl2/build/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/sdl2/build/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/sdl2/build/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/res/drawable/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/sdl2/build/src/main/res/drawable/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/res/layout/chooser_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 21 | 22 | 30 | 31 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/res/layout/project_chooser.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 14 | 15 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/res/layout/project_empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/res/mipmap-anydpi-v26/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/sdl2/build/src/main/res/mipmap-anydpi-v26/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/src/main/res/mipmap/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/sdl2/build/src/main/res/mipmap/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/sdl2/build/templates/strings.tmpl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ args.name }} 4 | {{ private_version }} 5 | {{ args.presplash_color }} 6 | {{ url_scheme }} 7 | 8 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_library/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.bootstraps.service_only import ServiceOnlyBootstrap 2 | 3 | 4 | class ServiceLibraryBootstrap(ServiceOnlyBootstrap): 5 | 6 | name = 'service_library' 7 | 8 | 9 | bootstrap = ServiceLibraryBootstrap() 10 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_library/build/jni/application/src/bootstrap_name.h: -------------------------------------------------------------------------------- 1 | 2 | #define BOOTSTRAP_NAME_LIBRARY 3 | #define BOOTSTRAP_USES_NO_SDL_HEADERS 4 | 5 | const char bootstrap_name[] = "service_library"; 6 | 7 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_library/build/src/main/java/org/kivy/android/GenericBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package org.kivy.android; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Intent; 5 | import android.content.Context; 6 | 7 | public class GenericBroadcastReceiver extends BroadcastReceiver { 8 | 9 | GenericBroadcastReceiverCallback listener; 10 | 11 | public GenericBroadcastReceiver(GenericBroadcastReceiverCallback listener) { 12 | super(); 13 | this.listener = listener; 14 | } 15 | 16 | public void onReceive(Context context, Intent intent) { 17 | this.listener.onReceive(context, intent); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_library/build/src/main/java/org/kivy/android/GenericBroadcastReceiverCallback.java: -------------------------------------------------------------------------------- 1 | package org.kivy.android; 2 | 3 | import android.content.Intent; 4 | import android.content.Context; 5 | 6 | public interface GenericBroadcastReceiverCallback { 7 | void onReceive(Context context, Intent intent); 8 | }; 9 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_library/build/src/main/java/org/kivy/android/PythonActivity.java: -------------------------------------------------------------------------------- 1 | package org.kivy.android; 2 | 3 | import android.app.Activity; 4 | 5 | // Required by PythonService class 6 | public class PythonActivity extends Activity { 7 | public static PythonActivity mActivity = null; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_library/build/src/main/res/mipmap/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/service_library/build/src/main/res/mipmap/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_library/build/templates/AndroidManifest.tmpl.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | {% for name in service_names %} 12 | 15 | {% endfor %} 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_only/build/jni/Android.mk: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_only/build/jni/Application.mk: -------------------------------------------------------------------------------- 1 | 2 | # Uncomment this if you're using STL in your project 3 | # See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information 4 | # APP_STL := stlport_static 5 | 6 | # APP_ABI := armeabi armeabi-v7a x86 7 | APP_ABI := $(ARCH) 8 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_only/build/jni/application/src/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := main 6 | 7 | # Add your application source files here... 8 | LOCAL_SRC_FILES := start.c pyjniusjni.c 9 | 10 | LOCAL_CFLAGS += -I$(PYTHON_INCLUDE_ROOT) $(EXTRA_CFLAGS) 11 | 12 | LOCAL_SHARED_LIBRARIES := python_shared 13 | 14 | LOCAL_LDLIBS := -llog $(EXTRA_LDLIBS) 15 | 16 | LOCAL_LDFLAGS += -L$(PYTHON_LINK_ROOT) $(APPLICATION_ADDITIONAL_LDFLAGS) 17 | 18 | include $(BUILD_SHARED_LIBRARY) 19 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_only/build/jni/application/src/Android_static.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := main 6 | 7 | LOCAL_SRC_FILES := YourSourceHere.c 8 | 9 | include $(BUILD_SHARED_LIBRARY) 10 | $(call import-module,SDL)LOCAL_PATH := $(call my-dir) 11 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_only/build/jni/application/src/bootstrap_name.h: -------------------------------------------------------------------------------- 1 | 2 | #define BOOTSTRAP_NAME_SERVICEONLY 3 | #define BOOTSTRAP_USES_NO_SDL_HEADERS 4 | 5 | const char bootstrap_name[] = "service_only"; 6 | 7 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_only/build/src/main/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/service_only/build/src/main/assets/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_only/build/src/main/jniLibs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/service_only/build/src/main/jniLibs/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_only/build/src/main/res/drawable/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/service_only/build/src/main/res/drawable/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_only/build/src/main/res/mipmap/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/service_only/build/src/main/res/mipmap/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/service_only/build/templates/strings.tmpl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ args.name }} 4 | {{ private_version }} 5 | 6 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/jni/Android.mk: -------------------------------------------------------------------------------- 1 | include $(call all-subdir-makefiles) 2 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/jni/Application.mk: -------------------------------------------------------------------------------- 1 | 2 | # Uncomment this if you're using STL in your project 3 | # See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information 4 | # APP_STL := stlport_static 5 | 6 | # APP_ABI := armeabi armeabi-v7a x86 7 | APP_ABI := $(ARCH) 8 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/jni/application/src/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := main 6 | 7 | # LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include 8 | 9 | # Add your application source files here... 10 | LOCAL_SRC_FILES := start.c pyjniusjni.c 11 | 12 | LOCAL_CFLAGS += -I$(PYTHON_INCLUDE_ROOT) $(EXTRA_CFLAGS) 13 | 14 | LOCAL_SHARED_LIBRARIES := python_shared 15 | 16 | LOCAL_LDLIBS := -llog $(EXTRA_LDLIBS) 17 | 18 | LOCAL_LDFLAGS += -L$(PYTHON_LINK_ROOT) $(APPLICATION_ADDITIONAL_LDFLAGS) 19 | 20 | include $(BUILD_SHARED_LIBRARY) 21 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/jni/application/src/Android_static.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := main 6 | 7 | LOCAL_SRC_FILES := YourSourceHere.c 8 | 9 | LOCAL_STATIC_LIBRARIES := SDL2_static 10 | 11 | include $(BUILD_SHARED_LIBRARY) 12 | $(call import-module,SDL)LOCAL_PATH := $(call my-dir) 13 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/jni/application/src/bootstrap_name.h: -------------------------------------------------------------------------------- 1 | 2 | #define BOOTSTRAP_NAME_WEBVIEW 3 | #define BOOTSTRAP_USES_NO_SDL_HEADERS 4 | 5 | const char bootstrap_name[] = "webview"; 6 | 7 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/src/main/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/webview/build/src/main/assets/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/src/main/java/org/kivy/android/GenericBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package org.kivy.android; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Intent; 5 | import android.content.Context; 6 | 7 | public class GenericBroadcastReceiver extends BroadcastReceiver { 8 | 9 | GenericBroadcastReceiverCallback listener; 10 | 11 | public GenericBroadcastReceiver(GenericBroadcastReceiverCallback listener) { 12 | super(); 13 | this.listener = listener; 14 | } 15 | 16 | public void onReceive(Context context, Intent intent) { 17 | this.listener.onReceive(context, intent); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/src/main/java/org/kivy/android/GenericBroadcastReceiverCallback.java: -------------------------------------------------------------------------------- 1 | package org.kivy.android; 2 | 3 | import android.content.Intent; 4 | import android.content.Context; 5 | 6 | public interface GenericBroadcastReceiverCallback { 7 | void onReceive(Context context, Intent intent); 8 | }; 9 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/src/main/jniLibs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/webview/build/src/main/jniLibs/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/src/main/res/drawable/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/webview/build/src/main/res/drawable/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/src/main/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/webview/build/src/main/res/drawable/icon.png -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/src/main/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/src/main/res/mipmap-anydpi-v26/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/webview/build/src/main/res/mipmap-anydpi-v26/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/src/main/res/mipmap/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/bootstraps/webview/build/src/main/res/mipmap/.gitkeep -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | SDL App 4 | 0.1 5 | 6 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/templates/strings.tmpl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ args.name }} 4 | {{ private_version }} 5 | {{ args.presplash_color }} 6 | 7 | -------------------------------------------------------------------------------- /pythonforandroid/bootstraps/webview/build/webview_includes/_load.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Python WebView loader 9 | 10 | 11 | 12 |
13 |
Loading...
14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /pythonforandroid/entrypoints.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recommendations import check_python_version 2 | from pythonforandroid.util import BuildInterruptingException, handle_build_exception 3 | 4 | 5 | def main(): 6 | """ 7 | Main entrypoint for running python-for-android as a script. 8 | """ 9 | 10 | try: 11 | # Check the Python version before importing anything heavier than 12 | # the util functions. This lets us provide a nice message about 13 | # incompatibility rather than having the interpreter crash if it 14 | # reaches unsupported syntax from a newer Python version. 15 | check_python_version() 16 | 17 | from pythonforandroid.toolchain import ToolchainCL 18 | ToolchainCL() 19 | except BuildInterruptingException as exc: 20 | handle_build_exception(exc) 21 | -------------------------------------------------------------------------------- /pythonforandroid/includes/arm64-v8a/machine/cpu-features.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARM64_CPU_FEATURES 2 | #define _ARM64_CPU_FEATURES 3 | 4 | #define __ARM_ARCH__ 8 5 | #define __ARM_HAVE_HALFWORD_MULTIPLY 1 6 | 7 | #endif // _ARM64_CPU_FEATURES 8 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/pythonforandroid/recipes/__init__.py -------------------------------------------------------------------------------- /pythonforandroid/recipes/aiohttp/__init__.py: -------------------------------------------------------------------------------- 1 | """Build AIOHTTP""" 2 | from typing import List 3 | from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe 4 | 5 | 6 | class AIOHTTPRecipe(CppCompiledComponentsPythonRecipe): # type: ignore # pylint: disable=R0903 7 | version = "3.8.3" 8 | url = "https://pypi.python.org/packages/source/a/aiohttp/aiohttp-{version}.tar.gz" 9 | name = "aiohttp" 10 | depends: List[str] = ["setuptools"] 11 | call_hostpython_via_targetpython = False 12 | install_in_hostpython = True 13 | 14 | def get_recipe_env(self, arch): 15 | env = super().get_recipe_env(arch) 16 | env['LDFLAGS'] += ' -lc++_shared' 17 | return env 18 | 19 | 20 | recipe = AIOHTTPRecipe() 21 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/android/src/android/__init__.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Android module 3 | ============== 4 | 5 | ''' 6 | 7 | # legacy import 8 | from android._android import * # noqa: F401, F403 9 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/android/src/android/billing.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Android Billing API 3 | =================== 4 | 5 | ''' 6 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/android/src/android/loadingscreen.py: -------------------------------------------------------------------------------- 1 | 2 | from jnius import autoclass 3 | 4 | from android.config import ACTIVITY_CLASS_NAME 5 | 6 | 7 | def hide_loading_screen(): 8 | mActivity = autoclass(ACTIVITY_CLASS_NAME).mActivity 9 | mActivity.removeLoadingScreen() 10 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/android/src/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup, Extension 2 | import os 3 | 4 | library_dirs = ['libs/' + os.environ['ARCH']] 5 | lib_dict = { 6 | 'sdl2': ['SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL2_ttf'] 7 | } 8 | sdl_libs = lib_dict.get(os.environ['BOOTSTRAP'], ['main']) 9 | 10 | modules = [Extension('android._android', 11 | ['android/_android.c', 'android/_android_jni.c'], 12 | libraries=sdl_libs + ['log'], 13 | library_dirs=library_dirs), 14 | Extension('android._android_billing', 15 | ['android/_android_billing.c', 'android/_android_billing_jni.c'], 16 | libraries=['log'], 17 | library_dirs=library_dirs)] 18 | 19 | setup(name='android', 20 | version='1.0', 21 | packages=['android'], 22 | package_dir={'android': 'android'}, 23 | ext_modules=modules 24 | ) 25 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/argon2-cffi/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe 2 | 3 | 4 | class Argon2Recipe(CompiledComponentsPythonRecipe): 5 | version = '20.1.0' 6 | url = 'git+https://github.com/hynek/argon2-cffi' 7 | depends = ['setuptools', 'cffi'] 8 | call_hostpython_via_targetpython = False 9 | build_cmd = 'build' 10 | 11 | def get_recipe_env(self, arch): 12 | env = super().get_recipe_env(arch) 13 | env['ARGON2_CFFI_USE_SSE2'] = '0' 14 | return env 15 | 16 | 17 | recipe = Argon2Recipe() 18 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/atom/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe 2 | 3 | 4 | class AtomRecipe(CppCompiledComponentsPythonRecipe): 5 | site_packages_name = 'atom' 6 | version = '0.3.10' 7 | url = 'https://github.com/nucleic/atom/archive/master.zip' 8 | depends = ['setuptools'] 9 | 10 | 11 | recipe = AtomRecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/av/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.toolchain import Recipe 2 | from pythonforandroid.recipe import CythonRecipe 3 | 4 | 5 | class PyAVRecipe(CythonRecipe): 6 | 7 | name = "av" 8 | version = "10.0.0" 9 | url = "https://github.com/PyAV-Org/PyAV/archive/v{version}.zip" 10 | 11 | depends = ["python3", "cython", "ffmpeg", "av_codecs"] 12 | opt_depends = ["openssl"] 13 | 14 | def get_recipe_env(self, arch, with_flags_in_cc=True): 15 | env = super().get_recipe_env(arch) 16 | 17 | build_dir = Recipe.get_recipe("ffmpeg", self.ctx).get_build_dir( 18 | arch.arch 19 | ) 20 | self.setup_extra_args = ["--ffmpeg-dir={}".format(build_dir)] 21 | 22 | return env 23 | 24 | 25 | recipe = PyAVRecipe() 26 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/av_codecs/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.toolchain import Recipe 2 | 3 | 4 | class PyAVCodecsRecipe(Recipe): 5 | depends = ["libx264", "libshine", "libvpx"] 6 | 7 | def build_arch(self, arch): 8 | pass 9 | 10 | 11 | recipe = PyAVCodecsRecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/bcrypt/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe 2 | 3 | 4 | class BCryptRecipe(CompiledComponentsPythonRecipe): 5 | name = 'bcrypt' 6 | version = '3.1.7' 7 | url = 'https://github.com/pyca/bcrypt/archive/{version}.tar.gz' 8 | depends = ['openssl', 'cffi'] 9 | call_hostpython_via_targetpython = False 10 | 11 | def get_recipe_env(self, arch): 12 | env = super().get_recipe_env(arch) 13 | 14 | openssl_recipe = Recipe.get_recipe('openssl', self.ctx) 15 | env['CFLAGS'] += openssl_recipe.include_flags(arch) 16 | env['LDFLAGS'] += openssl_recipe.link_dirs_flags(arch) 17 | env['LIBS'] = openssl_recipe.link_libs_flags() 18 | 19 | return env 20 | 21 | 22 | recipe = BCryptRecipe() 23 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/boost/disable-so-version.patch: -------------------------------------------------------------------------------- 1 | --- boost/boostcpp.jam 2015-12-14 03:30:09.000000000 +0100 2 | +++ boost-patch/boostcpp.jam 2016-02-08 16:38:40.510859612 +0100 3 | @@ -155,8 +155,9 @@ 4 | if $(type) = SHARED_LIB && 5 | ! [ $(property-set).get ] in windows cygwin darwin aix && 6 | ! [ $(property-set).get ] in pgi 7 | { 8 | + return $(result) ; # disable version suffix for android 9 | result = $(result).$(BOOST_VERSION) ; 10 | } 11 | 12 | return $(result) ; 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/boost/use-android-libs.patch: -------------------------------------------------------------------------------- 1 | --- boost/tools/build/src/tools/python.jam 2015-10-16 20:55:36.000000000 +0200 2 | +++ boost-patch/tools/build/src/tools/python.jam 2016-02-09 13:16:09.519261546 +0100 3 | @@ -646,6 +646,7 @@ 4 | 5 | case aix : return pthread dl ; 6 | 7 | + case * : return ; # use Android builtin libs 8 | case * : return pthread dl 9 | gcc:util linux:util ; 10 | } 11 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/brokenrecipe/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.toolchain import Recipe 2 | 3 | 4 | class BrokenRecipe(Recipe): 5 | def __init__(self): 6 | print('This is a broken recipe, not a real one!') 7 | 8 | 9 | recipe = BrokenRecipe() 10 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/cffi/disable-pkg-config.patch: -------------------------------------------------------------------------------- 1 | diff --git a/setup.py b/setup copy.py 2 | index 4ce0007..9be4a6d 100644 3 | --- a/setup.py 4 | +++ b/setup 5 | @@ -9,8 +9,7 @@ if sys.platform == "win32": 6 | 7 | sources = ['c/_cffi_backend.c'] 8 | libraries = ['ffi'] 9 | -include_dirs = ['/usr/include/ffi', 10 | - '/usr/include/libffi'] # may be changed by pkg-config 11 | +include_dirs = os.environ['FFI_INC'].split(',') if 'FFI_INC' in os.environ else [] 12 | define_macros = [('FFI_BUILDING', '1')] # for linking with libffi static library 13 | library_dirs = [] 14 | extra_compile_args = [] 15 | @@ -105,14 +104,7 @@ def uses_msvc(): 16 | return config.try_compile('#ifndef _MSC_VER\n#error "not MSVC"\n#endif') 17 | 18 | def use_pkg_config(): 19 | - if sys.platform == 'darwin' and os.path.exists('/usr/local/bin/brew'): 20 | - use_homebrew_for_libffi() 21 | - 22 | - _ask_pkg_config(include_dirs, '--cflags-only-I', '-I', sysroot=True) 23 | - _ask_pkg_config(extra_compile_args, '--cflags-only-other') 24 | - _ask_pkg_config(library_dirs, '--libs-only-L', '-L', sysroot=True) 25 | - _ask_pkg_config(extra_link_args, '--libs-only-other') 26 | - _ask_pkg_config(libraries, '--libs-only-l', '-l') 27 | + pass 28 | 29 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/coverage/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class CoverageRecipe(PythonRecipe): 5 | 6 | version = '4.1' 7 | 8 | url = 'https://pypi.python.org/packages/2d/10/6136c8e10644c16906edf4d9f7c782c0f2e7ed47ff2f41f067384e432088/coverage-{version}.tar.gz' 9 | 10 | depends = ['hostpython3', 'setuptools'] 11 | 12 | patches = ['fallback-utf8.patch'] 13 | 14 | site_packages_name = 'coverage' 15 | 16 | call_hostpython_via_targetpython = False 17 | 18 | 19 | recipe = CoverageRecipe() 20 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/coverage/fallback-utf8.patch: -------------------------------------------------------------------------------- 1 | --- coverage-4.1/coverage/misc.py 2016-02-13 20:04:35.000000000 +0100 2 | +++ patch/coverage/misc.py 2016-07-11 17:07:22.656603295 +0200 3 | @@ -166,7 +166,8 @@ 4 | encoding = ( 5 | getattr(outfile, "encoding", None) or 6 | getattr(sys.__stdout__, "encoding", None) or 7 | - locale.getpreferredencoding() 8 | + locale.getpreferredencoding() or 9 | + 'utf-8' 10 | ) 11 | return encoding 12 | 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/cppy/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class CppyRecipe(PythonRecipe): 5 | site_packages_name = 'cppy' 6 | version = '1.1.0' 7 | url = 'https://github.com/nucleic/cppy/archive/{version}.zip' 8 | call_hostpython_via_targetpython = False 9 | # to be detected by the matplotlib install script 10 | install_in_hostpython = True 11 | depends = ['setuptools'] 12 | 13 | 14 | recipe = CppyRecipe() 15 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/cryptography/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe, Recipe 2 | 3 | 4 | class CryptographyRecipe(CompiledComponentsPythonRecipe): 5 | name = 'cryptography' 6 | version = '2.8' 7 | url = 'https://github.com/pyca/cryptography/archive/{version}.tar.gz' 8 | depends = ['openssl', 'six', 'setuptools', 'cffi'] 9 | call_hostpython_via_targetpython = False 10 | 11 | def get_recipe_env(self, arch): 12 | env = super().get_recipe_env(arch) 13 | 14 | openssl_recipe = Recipe.get_recipe('openssl', self.ctx) 15 | env['CFLAGS'] += openssl_recipe.include_flags(arch) 16 | env['LDFLAGS'] += openssl_recipe.link_dirs_flags(arch) 17 | env['LIBS'] = openssl_recipe.link_libs_flags() 18 | 19 | return env 20 | 21 | 22 | recipe = CryptographyRecipe() 23 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/cymunk/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CythonRecipe 2 | 3 | 4 | class CymunkRecipe(CythonRecipe): 5 | version = 'master' 6 | url = 'https://github.com/tito/cymunk/archive/{version}.zip' 7 | name = 'cymunk' 8 | 9 | 10 | recipe = CymunkRecipe() 11 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/cython/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe 2 | 3 | 4 | class CythonRecipe(CompiledComponentsPythonRecipe): 5 | 6 | version = '0.29.28' 7 | url = 'https://github.com/cython/cython/archive/{version}.tar.gz' 8 | site_packages_name = 'cython' 9 | depends = ['setuptools'] 10 | call_hostpython_via_targetpython = False 11 | install_in_hostpython = True 12 | 13 | 14 | recipe = CythonRecipe() 15 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/decorator/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class DecoratorPyRecipe(PythonRecipe): 5 | version = '4.2.1' 6 | url = 'https://pypi.python.org/packages/source/d/decorator/decorator-{version}.tar.gz' 7 | url = 'https://github.com/micheles/decorator/archive/{version}.tar.gz' 8 | depends = ['setuptools'] 9 | site_packages_name = 'decorator' 10 | call_hostpython_via_targetpython = False 11 | 12 | 13 | recipe = DecoratorPyRecipe() 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/enaml/0001-Update-setup.py.patch: -------------------------------------------------------------------------------- 1 | From 156a0426f7350bf49bdfae1aad555e13c9494b9a Mon Sep 17 00:00:00 2001 2 | From: frmdstryr 3 | Date: Thu, 23 Jun 2016 22:04:32 -0400 4 | Subject: [PATCH] Update setup.py 5 | 6 | --- 7 | setup.py | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/setup.py b/setup.py 11 | index 3bfd2a2..99817e5 100644 12 | --- a/setup.py 13 | +++ b/setup.py 14 | @@ -72,7 +72,7 @@ setup( 15 | url='https://github.com/nucleic/enaml', 16 | description='Declarative DSL for building rich user interfaces in Python', 17 | long_description=open('README.rst').read(), 18 | - requires=['atom', 'PyQt', 'ply', 'kiwisolver'], 19 | + requires=['atom', 'ply', 'kiwisolver'], 20 | install_requires=['distribute', 'atom >= 0.3.8', 'kiwisolver >= 0.1.2', 'ply >= 3.4'], 21 | packages=find_packages(), 22 | package_data={ 23 | -- 24 | 2.7.4 25 | 26 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/enaml/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe 2 | 3 | 4 | class EnamlRecipe(CppCompiledComponentsPythonRecipe): 5 | site_packages_name = 'enaml' 6 | version = '0.9.8' 7 | url = 'https://github.com/nucleic/enaml/archive/{version}.zip' 8 | patches = ['0001-Update-setup.py.patch'] # Remove PyQt dependency 9 | depends = ['setuptools', 'atom', 'kiwisolver'] 10 | 11 | 12 | recipe = EnamlRecipe() 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/ethash/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class EthashRecipe(PythonRecipe): 5 | 6 | url = 'https://github.com/ethereum/ethash/archive/master.zip' 7 | 8 | depends = ['setuptools'] 9 | 10 | 11 | recipe = EthashRecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/evdev/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe 2 | 3 | 4 | class EvdevRecipe(CompiledComponentsPythonRecipe): 5 | name = 'evdev' 6 | version = 'v0.4.7' 7 | url = 'https://github.com/gvalkov/python-evdev/archive/{version}.zip' 8 | call_hostpython_via_targetpython = False 9 | 10 | depends = [] 11 | 12 | build_cmd = 'build' 13 | 14 | patches = ['evcnt.patch', 15 | 'keycnt.patch', 16 | 'remove-uinput.patch', 17 | 'include-dir.patch', 18 | 'evdev-permissions.patch'] 19 | 20 | def get_recipe_env(self, arch=None): 21 | env = super().get_recipe_env(arch) 22 | env['SYSROOT'] = self.ctx.ndk.sysroot 23 | return env 24 | 25 | 26 | recipe = EvdevRecipe() 27 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/evdev/evcnt.patch: -------------------------------------------------------------------------------- 1 | diff -Naur orig/evdev/input.c v0.4.7/evdev/input.c 2 | --- orig/evdev/input.c 2015-06-11 13:56:43.483891914 -0500 3 | +++ v0.4.7/evdev/input.c 2015-06-11 13:57:29.079529095 -0500 4 | @@ -24,6 +24,8 @@ 5 | #include 6 | #endif 7 | 8 | +#define EV_CNT (EV_MAX+1) 9 | + 10 | #define MAX_NAME_SIZE 256 11 | 12 | extern char* EV_NAME[EV_CNT]; 13 | @@ -190,7 +192,7 @@ 14 | absinfo.maximum, 15 | absinfo.fuzz, 16 | absinfo.flat, 17 | - absinfo.resolution); 18 | + 0); 19 | 20 | evlong = PyLong_FromLong(ev_code); 21 | absitem = Py_BuildValue("(OO)", evlong, py_absinfo); 22 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/evdev/include-dir.patch: -------------------------------------------------------------------------------- 1 | diff -Naur orig/setup.py v0.4.7/setup.py 2 | --- orig/setup.py 2015-06-11 14:16:31.315765908 -0500 3 | +++ v0.4.7/setup.py 2015-06-11 14:17:05.800263536 -0500 4 | @@ -64,7 +64,7 @@ 5 | 6 | #----------------------------------------------------------------------------- 7 | def create_ecodes(): 8 | - header = '/usr/include/linux/input.h' 9 | + header = os.environ['SYSROOT'] + '/usr/include/linux/input.h' 10 | 11 | if not os.path.isfile(header): 12 | msg = '''\ 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/evdev/keycnt.patch: -------------------------------------------------------------------------------- 1 | diff -Naur orig/evdev/genecodes.py v0.4.7/evdev/genecodes.py 2 | --- orig/evdev/genecodes.py 2015-06-12 11:18:39.460538902 -0500 3 | +++ v0.4.7/evdev/genecodes.py 2015-06-12 11:20:49.004337615 -0500 4 | @@ -17,6 +17,8 @@ 5 | #include 6 | #endif 7 | 8 | +#define KEY_CNT (KEY_MAX+1) 9 | + 10 | /* Automatically generated by evdev.genecodes */ 11 | /* Generated on %s */ 12 | 13 | @@ -88,6 +88,7 @@ 14 | macro = regex.search(line) 15 | if macro: 16 | yield ' PyModule_AddIntMacro(m, %s);' % macro.group(1) 17 | + yield ' PyModule_AddIntMacro(m, KEY_CNT);' 18 | 19 | uname = list(os.uname()); del uname[1] 20 | uname = ' '.join(uname) 21 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/feedparser/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class FeedparserPyRecipe(PythonRecipe): 5 | version = '5.2.1' 6 | url = 'https://github.com/kurtmckee/feedparser/archive/{version}.tar.gz' 7 | depends = ['setuptools'] 8 | site_packages_name = 'feedparser' 9 | call_hostpython_via_targetpython = False 10 | 11 | 12 | recipe = FeedparserPyRecipe() 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/ffmpeg/patches/configure.patch: -------------------------------------------------------------------------------- 1 | --- ./configure 2020-10-11 19:12:16.759760904 +0200 2 | +++ ./configure.patch 2020-10-11 19:15:49.059533563 +0200 3 | @@ -6361,7 +6361,7 @@ 4 | enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo 5 | enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket 6 | enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++" 7 | -enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer 8 | +enabled libshine && require "shine" shine/layer3.h shine_encode_buffer -lshine -lm 9 | enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init || 10 | require libsmbclient libsmbclient.h smbc_init -lsmbclient; } 11 | enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ -------------------------------------------------------------------------------- /pythonforandroid/recipes/ffpyplayer_codecs/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.toolchain import Recipe 2 | 3 | 4 | class FFPyPlayerCodecsRecipe(Recipe): 5 | depends = ['libx264', 'libshine', 'libvpx'] 6 | 7 | def build_arch(self, arch): 8 | pass 9 | 10 | 11 | recipe = FFPyPlayerCodecsRecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/flask/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from pythonforandroid.recipe import PythonRecipe 3 | 4 | 5 | class FlaskRecipe(PythonRecipe): 6 | version = '2.0.3' 7 | url = 'https://github.com/pallets/flask/archive/{version}.zip' 8 | 9 | depends = ['setuptools'] 10 | 11 | python_depends = ['jinja2', 'werkzeug', 'markupsafe', 'itsdangerous', 'click'] 12 | 13 | call_hostpython_via_targetpython = False 14 | install_in_hostpython = False 15 | 16 | 17 | recipe = FlaskRecipe() 18 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/fontconfig/__init__.py: -------------------------------------------------------------------------------- 1 | from os.path import join 2 | 3 | from pythonforandroid.recipe import BootstrapNDKRecipe 4 | from pythonforandroid.toolchain import current_directory, shprint 5 | import sh 6 | 7 | 8 | class FontconfigRecipe(BootstrapNDKRecipe): 9 | version = "really_old" 10 | url = 'https://github.com/vault/fontconfig/archive/androidbuild.zip' 11 | depends = ['sdl2'] 12 | dir_name = 'fontconfig' 13 | 14 | def build_arch(self, arch): 15 | env = self.get_recipe_env(arch) 16 | 17 | with current_directory(self.get_jni_dir()): 18 | shprint( 19 | sh.Command(join(self.ctx.ndk_dir, "ndk-build")), 20 | "V=1", 21 | "APP_ALLOW_MISSING_DEPS=true", 22 | "fontconfig", 23 | _env=env, 24 | ) 25 | 26 | 27 | recipe = FontconfigRecipe() 28 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/freetype-py/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class FreetypePyRecipe(PythonRecipe): 5 | version = '2.2.0' 6 | url = 'https://github.com/rougier/freetype-py/archive/refs/tags/v{version}.tar.gz' 7 | depends = ['freetype'] 8 | patches = ['fall-back-to-distutils.patch'] 9 | site_packages_name = 'freetype' 10 | 11 | 12 | recipe = FreetypePyRecipe() 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/freetype-py/fall-back-to-distutils.patch: -------------------------------------------------------------------------------- 1 | diff -ruN freetype-py.orig/setup.py freetype-py/setup.py 2 | --- freetype-py.orig/setup.py 2020-07-09 20:58:51.000000000 +0700 3 | +++ freetype-py/setup.py 2022-03-02 19:28:17.948831134 +0700 4 | @@ -12,7 +12,10 @@ 5 | from io import open 6 | from os import path 7 | 8 | -from setuptools import setup 9 | +try: 10 | + from setuptools import setup 11 | +except ImportError: 12 | + from distutils.core import setup 13 | 14 | if os.environ.get("FREETYPEPY_BUNDLE_FT"): 15 | print("# Will build and bundle FreeType.") 16 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/genericndkbuild/__init__.py: -------------------------------------------------------------------------------- 1 | from os.path import join 2 | 3 | from pythonforandroid.recipe import BootstrapNDKRecipe 4 | from pythonforandroid.toolchain import current_directory, shprint 5 | import sh 6 | 7 | 8 | class GenericNDKBuildRecipe(BootstrapNDKRecipe): 9 | version = None 10 | url = None 11 | 12 | depends = ['python3'] 13 | conflicts = ['sdl2'] 14 | 15 | def should_build(self, arch): 16 | return True 17 | 18 | def get_recipe_env(self, arch=None, with_flags_in_cc=True, with_python=True): 19 | env = super().get_recipe_env( 20 | arch=arch, with_flags_in_cc=with_flags_in_cc, 21 | with_python=with_python, 22 | ) 23 | env['APP_ALLOW_MISSING_DEPS'] = 'true' 24 | return env 25 | 26 | def build_arch(self, arch): 27 | env = self.get_recipe_env(arch) 28 | 29 | with current_directory(self.get_jni_dir()): 30 | shprint(sh.Command(join(self.ctx.ndk_dir, "ndk-build")), "V=1", _env=env) 31 | 32 | 33 | recipe = GenericNDKBuildRecipe() 34 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/gevent/cross_compiling.patch: -------------------------------------------------------------------------------- 1 | diff --git a/_setupares.py b/_setupares.py 2 | index dd184de6..bb16bebe 100644 3 | --- a/_setupares.py 4 | +++ b/_setupares.py 5 | @@ -43,7 +43,7 @@ else: 6 | ares_configure_command = ' '.join([ 7 | "(cd ", quoted_dep_abspath('c-ares'), 8 | " && if [ -r ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi ", 9 | - " && sh ./configure --disable-dependency-tracking " + _m32 + "CONFIG_COMMANDS= ", 10 | + " && sh ./configure --host={} --disable-dependency-tracking ".format(os.environ['TOOLCHAIN_PREFIX']) + _m32 + "CONFIG_COMMANDS= ", 11 | " && cp ares_config.h ares_build.h \"$OLDPWD\" ", 12 | " && cat ares_build.h ", 13 | " && if [ -r ares_build.h.orig ]; then mv ares_build.h.orig ares_build.h; fi)", 14 | diff --git a/_setuplibev.py b/_setuplibev.py 15 | index 2a5841bf..b6433c94 100644 16 | --- a/_setuplibev.py 17 | +++ b/_setuplibev.py 18 | @@ -31,7 +31,7 @@ LIBEV_EMBED = should_embed('libev') 19 | # and the PyPy branch will clean it up. 20 | libev_configure_command = ' '.join([ 21 | "(cd ", quoted_dep_abspath('libev'), 22 | - " && sh ./configure ", 23 | + " && sh ./configure --host={} ".format(os.environ['TOOLCHAIN_PREFIX']), 24 | " && cp config.h \"$OLDPWD\"", 25 | ")", 26 | '> configure-output.txt' 27 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/greenlet/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe 2 | 3 | 4 | class GreenletRecipe(CompiledComponentsPythonRecipe): 5 | version = '0.4.15' 6 | url = 'https://pypi.python.org/packages/source/g/greenlet/greenlet-{version}.tar.gz' 7 | depends = ['setuptools'] 8 | call_hostpython_via_targetpython = False 9 | 10 | 11 | recipe = GreenletRecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/groestlcoin_hash/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CythonRecipe 2 | 3 | 4 | class GroestlcoinHashRecipe(CythonRecipe): 5 | version = '1.0.3' 6 | url = 'https://github.com/Groestlcoin/groestlcoin-hash-python/archive/{version}.tar.gz' 7 | depends = ['setuptools'] 8 | cythonize = False 9 | 10 | 11 | recipe = GroestlcoinHashRecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/hostpython3/patches/pyconfig_detection.patch: -------------------------------------------------------------------------------- 1 | diff -Nru Python-3.8.2/Lib/site.py Python-3.8.2-new/Lib/site.py 2 | --- Python-3.8.2/Lib/site.py 2020-04-28 12:48:38.000000000 -0700 3 | +++ Python-3.8.2-new/Lib/site.py 2020-04-28 12:52:46.000000000 -0700 4 | @@ -487,7 +487,8 @@ 5 | if key == 'include-system-site-packages': 6 | system_site = value.lower() 7 | elif key == 'home': 8 | - sys._home = value 9 | + # this is breaking pyconfig.h path detection with venv 10 | + print('Ignoring "sys._home = value" override', file=sys.stderr) 11 | 12 | sys.prefix = sys.exec_prefix = site_prefix 13 | 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/ifaddr/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class IfaddrRecipe(PythonRecipe): 5 | name = 'ifaddr' 6 | version = '0.1.7' 7 | url = 'https://pypi.python.org/packages/source/i/ifaddr/ifaddr-{version}.tar.gz' 8 | depends = ['setuptools', 'ifaddrs', 'ipaddress;python_version<"3.3"'] 9 | call_hostpython_via_targetpython = False 10 | patches = ["getifaddrs.patch"] 11 | 12 | 13 | recipe = IfaddrRecipe() 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/ifaddr/getifaddrs.patch: -------------------------------------------------------------------------------- 1 | diff --git a/ifaddr/_posix.py b/ifaddr/_posix.py 2 | index 2903ee7..546e3ce 100644 3 | --- a/ifaddr/_posix.py 4 | +++ b/ifaddr/_posix.py 5 | @@ -39,6 +39,10 @@ ifaddrs._fields_ = [('ifa_next', ctypes.POINTER(ifaddrs)), 6 | 7 | libc = ctypes.CDLL(ctypes.util.find_library("socket" if os.uname()[0] == "SunOS" else "c"), use_errno=True) 8 | 9 | +# On old Androids getifaddrs is not available in libc => use libifaddrs instead 10 | +if not hasattr(libc, 'getifaddrs'): 11 | + libc = ctypes.CDLL(ctypes.util.find_library('ifaddrs'), use_errno=True) 12 | + 13 | def get_adapters(): 14 | 15 | addr0 = addr = ctypes.POINTER(ifaddrs)() 16 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/jedi/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class JediRecipe(PythonRecipe): 5 | version = 'v0.9.0' 6 | url = 'https://github.com/davidhalter/jedi/archive/{version}.tar.gz' 7 | 8 | patches = ['fix_MergedNamesDict_get.patch'] 9 | # This apparently should be fixed in jedi 0.10 (not released to 10 | # pypi yet), but it still occurs on Android, I could not reproduce 11 | # on desktop. 12 | 13 | call_hostpython_via_targetpython = False 14 | 15 | 16 | recipe = JediRecipe() 17 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/jedi/fix_MergedNamesDict_get.patch: -------------------------------------------------------------------------------- 1 | diff --git a/jedi/parser/fast.py b/jedi/parser/fast.py 2 | index 35bb855..bc43359 100644 3 | --- a/jedi/parser/fast.py 4 | +++ b/jedi/parser/fast.py 5 | @@ -75,7 +75,8 @@ class MergedNamesDict(object): 6 | return iter(set(key for dct in self.dicts for key in dct)) 7 | 8 | def __getitem__(self, value): 9 | - return list(chain.from_iterable(dct.get(value, []) for dct in self.dicts)) 10 | + return list(chain.from_iterable((dct[value] if value in dct else []) for dct in self.dicts)) 11 | + # return list(chain.from_iterable(dct.get(value, []) for dct in self.dicts)) 12 | 13 | def items(self): 14 | dct = {} 15 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/jpeg/Application.mk: -------------------------------------------------------------------------------- 1 | APP_OPTIM := release 2 | APP_ABI := all # or armeabi 3 | APP_MODULES := libjpeg 4 | APP_ALLOW_MISSING_DEPS := true 5 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/jpeg/remove-version.patch: -------------------------------------------------------------------------------- 1 | --- jpeg/CMakeLists.txt.orig 2018-11-12 20:20:28.000000000 +0100 2 | +++ jpeg/CMakeLists.txt 2018-12-14 12:43:45.338704504 +0100 3 | @@ -573,6 +573,9 @@ 4 | add_library(turbojpeg SHARED ${TURBOJPEG_SOURCES}) 5 | set_property(TARGET turbojpeg PROPERTY COMPILE_FLAGS 6 | "-DBMP_SUPPORTED -DPPM_SUPPORTED") 7 | + set_property(TARGET jpeg PROPERTY NO_SONAME 1) 8 | + set_property(TARGET turbojpeg PROPERTY NO_SONAME 1) 9 | + set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "") 10 | if(WIN32) 11 | set_target_properties(turbojpeg PROPERTIES DEFINE_SYMBOL DLLDEFINE) 12 | endif() 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/kivy3/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | import shutil 3 | 4 | 5 | class Kivy3Recipe(PythonRecipe): 6 | version = 'master' 7 | url = 'https://github.com/kivy/kivy3/archive/{version}.zip' 8 | 9 | depends = ['kivy'] 10 | site_packages_name = 'kivy3' 11 | 12 | '''Due to setuptools.''' 13 | call_hostpython_via_targetpython = False 14 | 15 | def build_arch(self, arch): 16 | super().build_arch(arch) 17 | suffix = '/kivy3/default.glsl' 18 | shutil.copyfile(self.get_build_dir(arch.arch) + suffix, self.ctx.get_python_install_dir(arch.arch) + suffix) 19 | 20 | 21 | recipe = Kivy3Recipe() 22 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/kiwisolver/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe 2 | 3 | 4 | class KiwiSolverRecipe(CppCompiledComponentsPythonRecipe): 5 | site_packages_name = 'kiwisolver' 6 | version = '1.3.2' 7 | url = 'https://github.com/nucleic/kiwi/archive/{version}.zip' 8 | depends = ['cppy'] 9 | 10 | 11 | recipe = KiwiSolverRecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libbz2/lib_android.patch: -------------------------------------------------------------------------------- 1 | Set default compiler to `clang` and disable versioned shared library 2 | --- bzip2-1.0.8/Makefile-libbz2_so.orig 2019-07-13 19:50:05.000000000 +0200 3 | +++ bzip2-1.0.8/Makefile-libbz2_so 2020-03-13 20:10:32.336990786 +0100 4 | @@ -22,7 +22,7 @@ 5 | 6 | 7 | SHELL=/bin/sh 8 | -CC=gcc 9 | +CC=clang 10 | BIGFILES=-D_FILE_OFFSET_BITS=64 11 | CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES) 12 | 13 | @@ -35,13 +35,11 @@ OBJS= blocksort.o \ 14 | bzlib.o 15 | 16 | all: $(OBJS) 17 | - $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS) 18 | - $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8 19 | - rm -f libbz2.so.1.0 20 | - ln -s libbz2.so.1.0.8 libbz2.so.1.0 21 | + $(CC) -shared -Wl,-soname=libbz2.so -o libbz2.so $(OBJS) 22 | + $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so 23 | 24 | clean: 25 | - rm -f $(OBJS) bzip2.o libbz2.so.1.0.8 libbz2.so.1.0 bzip2-shared 26 | + rm -f $(OBJS) bzip2.o libbz2.so bzip2-shared 27 | 28 | blocksort.o: blocksort.c 29 | $(CC) $(CFLAGS) -c blocksort.c 30 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libexpat/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | import sh 3 | from pythonforandroid.recipe import Recipe 4 | from pythonforandroid.util import current_directory 5 | from pythonforandroid.logger import shprint 6 | from os.path import join 7 | from multiprocessing import cpu_count 8 | 9 | 10 | class LibexpatRecipe(Recipe): 11 | version = 'master' 12 | url = 'https://github.com/libexpat/libexpat/archive/{version}.zip' 13 | built_libraries = {'libexpat.so': 'dist/lib'} 14 | depends = [] 15 | 16 | def build_arch(self, arch): 17 | env = self.get_recipe_env(arch) 18 | with current_directory(join(self.get_build_dir(arch.arch), 'expat')): 19 | dst_dir = join(self.get_build_dir(arch.arch), 'dist') 20 | shprint(sh.Command('./buildconf.sh'), _env=env) 21 | shprint( 22 | sh.Command('./configure'), 23 | '--host={}'.format(arch.command_prefix), 24 | '--enable-shared', 25 | '--without-xmlwf', 26 | '--prefix={}'.format(dst_dir), 27 | _env=env) 28 | shprint(sh.make, '-j', str(cpu_count()), _env=env) 29 | shprint(sh.make, 'install', _env=env) 30 | 31 | 32 | recipe = LibexpatRecipe() 33 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libffi/Application.mk: -------------------------------------------------------------------------------- 1 | APP_OPTIM := release 2 | APP_ABI := all # or armeabi 3 | APP_MODULES := libffi 4 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libffi/disable-mips-check.patch: -------------------------------------------------------------------------------- 1 | diff -Naur libffi/Android.mk b/Android.mk 2 | --- libffi/Android.mk 2015-12-22 17:00:48.025478556 -0600 3 | +++ b/Android.mk 2015-12-22 17:02:23.999249390 -0600 4 | @@ -23,23 +23,20 @@ 5 | # Build rules for the target. 6 | # 7 | 8 | -# We only build ffi for mips. 9 | -ifeq ($(TARGET_ARCH),mips) 10 | 11 | - include $(CLEAR_VARS) 12 | +include $(CLEAR_VARS) 13 | 14 | - ffi_arch := $(TARGET_ARCH) 15 | - ffi_os := $(TARGET_OS) 16 | +ffi_arch := $(TARGET_ARCH) 17 | +ffi_os := $(TARGET_OS) 18 | 19 | - # This include just keeps the nesting a bit saner. 20 | - include $(LOCAL_PATH)/Libffi.mk 21 | +# This include just keeps the nesting a bit saner. 22 | +include $(LOCAL_PATH)/Libffi.mk 23 | 24 | - LOCAL_MODULE_TAGS := optional 25 | - LOCAL_MODULE := libffi 26 | +LOCAL_MODULE_TAGS := optional 27 | +LOCAL_MODULE := libffi 28 | 29 | - include $(BUILD_SHARED_LIBRARY) 30 | +include $(BUILD_SHARED_LIBRARY) 31 | 32 | -endif 33 | 34 | # Also include the rules for the test suite. 35 | include external/libffi/testsuite/Android.mk 36 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libffi/remove-version-info.patch: -------------------------------------------------------------------------------- 1 | --- libffi/Makefile.am.orig 2018-12-21 16:11:26.159181262 +0100 2 | +++ libffi/Makefile.am 2018-12-21 16:14:44.075179374 +0100 3 | @@ -156,7 +156,7 @@ 4 | libffi.map: $(top_srcdir)/libffi.map.in 5 | $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $< 6 | 7 | -libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) 8 | +libffi_la_LDFLAGS = -no-undefined -avoid-version $(LTLDFLAGS) $(AM_LTLDFLAGS) 9 | libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) 10 | 11 | AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libiconv/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.logger import shprint 2 | from pythonforandroid.util import current_directory 3 | from pythonforandroid.recipe import Recipe 4 | from multiprocessing import cpu_count 5 | import sh 6 | 7 | 8 | class LibIconvRecipe(Recipe): 9 | 10 | version = '1.16' 11 | 12 | url = 'https://ftp.gnu.org/pub/gnu/libiconv/libiconv-{version}.tar.gz' 13 | 14 | built_libraries = {'libiconv.so': 'lib/.libs'} 15 | 16 | def build_arch(self, arch): 17 | env = self.get_recipe_env(arch) 18 | with current_directory(self.get_build_dir(arch.arch)): 19 | shprint( 20 | sh.Command('./configure'), 21 | '--host=' + arch.command_prefix, 22 | '--prefix=' + self.ctx.get_python_install_dir(arch.arch), 23 | _env=env) 24 | shprint(sh.make, '-j' + str(cpu_count()), _env=env) 25 | 26 | 27 | recipe = LibIconvRecipe() 28 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libmysqlclient/Linux.cmake: -------------------------------------------------------------------------------- 1 | asdgasdgasdg 2 | asdg 3 | asdg 4 | include(${CMAKE_ROOT}/Modules/Platform/Linux.cmake) 5 | set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "") 6 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libmysqlclient/add-custom-platform.patch: -------------------------------------------------------------------------------- 1 | --- libmysqlclient/libmysqlclient/libmysql/CMakeLists.txt 2013-02-27 00:25:45.000000000 -0600 2 | +++ b/libmysqlclient/libmysql/CMakeLists.txt 2016-01-11 13:28:51.142356988 -0600 3 | @@ -152,3 +152,5 @@ 4 | ${CMAKE_SOURCE_DIR}/libmysql/libmysqlclient_r${CMAKE_SHARED_LIBRARY_SUFFIX} 5 | DESTINATION "lib") 6 | ENDIF(WIN32) 7 | + 8 | +LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_PREFIX}") 9 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libmysqlclient/disable-soname.patch: -------------------------------------------------------------------------------- 1 | --- libmysqlclient/libmysqlclient/CMakeLists.txt 2013-02-27 00:25:45.000000000 -0600 2 | +++ b/libmysqlclient/CMakeLists.txt 2016-01-11 13:48:41.672323738 -0600 3 | @@ -24,6 +24,8 @@ 4 | SET(CMAKE_BUILD_TYPE "Release") 5 | ENDIF(NOT CMAKE_BUILD_TYPE) 6 | 7 | +SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "") 8 | + 9 | # This reads user configuration, generated by configure.js. 10 | IF(WIN32 AND EXISTS ${CMAKE_SOURCE_DIR}/win/configure.data) 11 | INCLUDE(${CMAKE_SOURCE_DIR}/win/configure.data) 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libmysqlclient/disable-soversion.patch: -------------------------------------------------------------------------------- 1 | --- libmysqlclient/libmysqlclient/libmysql/CMakeLists.txt 2013-02-27 00:25:45.000000000 -0600 2 | +++ b/libmysqlclient/libmysql/CMakeLists.txt 2016-01-11 14:00:26.729332913 -0600 3 | @@ -97,9 +97,6 @@ 4 | ADD_LIBRARY(libmysql SHARED ${CLIENT_SOURCES} libmysql.def) 5 | TARGET_LINK_LIBRARIES(libmysql ${CMAKE_THREAD_LIBS_INIT}) 6 | STRING(REGEX REPLACE "\\..+" "" LIBMYSQL_SOVERSION ${SHARED_LIB_VERSION}) 7 | -SET_TARGET_PROPERTIES(libmysql 8 | - PROPERTIES VERSION ${SHARED_LIB_VERSION} 9 | - SOVERSION ${LIBMYSQL_SOVERSION}) 10 | IF(OPENSSL_LIBRARIES) 11 | TARGET_LINK_LIBRARIES(libmysql ${OPENSSL_LIBRARIES} ${OPENSSL_LIBCRYPTO}) 12 | ENDIF(OPENSSL_LIBRARIES) 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libmysqlclient/p4a.cmake: -------------------------------------------------------------------------------- 1 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) 2 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 3 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 4 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libogg/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import Recipe 2 | from pythonforandroid.toolchain import current_directory, shprint 3 | import sh 4 | 5 | 6 | class OggRecipe(Recipe): 7 | version = '1.3.3' 8 | url = 'http://downloads.xiph.org/releases/ogg/libogg-{version}.tar.gz' 9 | built_libraries = {'libogg.so': 'src/.libs'} 10 | 11 | def build_arch(self, arch): 12 | with current_directory(self.get_build_dir(arch.arch)): 13 | env = self.get_recipe_env(arch) 14 | flags = [ 15 | '--host=' + arch.command_prefix, 16 | ] 17 | configure = sh.Command('./configure') 18 | shprint(configure, *flags, _env=env) 19 | shprint(sh.make, _env=env) 20 | 21 | 22 | recipe = OggRecipe() 23 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libpcre/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import Recipe 2 | from pythonforandroid.util import current_directory 3 | from pythonforandroid.logger import shprint 4 | import sh 5 | from multiprocessing import cpu_count 6 | from os.path import join 7 | 8 | 9 | class LibpcreRecipe(Recipe): 10 | version = '8.44' 11 | url = 'https://ftp.pcre.org/pub/pcre/pcre-{version}.tar.bz2' 12 | 13 | built_libraries = {'libpcre.so': '.libs'} 14 | 15 | def build_arch(self, arch): 16 | env = self.get_recipe_env(arch) 17 | 18 | with current_directory(self.get_build_dir(arch.arch)): 19 | shprint( 20 | sh.Command('./configure'), 21 | *'''--host=arm-linux-androideabi 22 | --disable-cpp --enable-jit --enable-utf8 23 | --enable-unicode-properties'''.split(), 24 | _env=env) 25 | shprint(sh.make, '-j', str(cpu_count()), _env=env) 26 | 27 | def get_lib_dir(self, arch): 28 | return join(self.get_build_dir(arch), '.libs') 29 | 30 | 31 | recipe = LibpcreRecipe() 32 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libpq/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.toolchain import Recipe, current_directory, shprint 2 | import sh 3 | import os.path 4 | 5 | 6 | class LibpqRecipe(Recipe): 7 | version = '10.12' 8 | url = 'http://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.bz2' 9 | depends = [] 10 | 11 | def get_recipe_env(self, arch): 12 | env = super().get_recipe_env(arch) 13 | env['USE_DEV_URANDOM'] = '1' 14 | 15 | return env 16 | 17 | def should_build(self, arch): 18 | return not os.path.isfile('{}/libpq.a'.format(self.ctx.get_libs_dir(arch.arch))) 19 | 20 | def build_arch(self, arch): 21 | env = self.get_recipe_env(arch) 22 | 23 | with current_directory(self.get_build_dir(arch.arch)): 24 | configure = sh.Command('./configure') 25 | shprint(configure, '--without-readline', '--host=arm-linux', 26 | _env=env) 27 | shprint(sh.make, 'submake-libpq', _env=env) 28 | shprint(sh.cp, '-a', 'src/interfaces/libpq/libpq.a', 29 | self.ctx.get_libs_dir(arch.arch)) 30 | 31 | 32 | recipe = LibpqRecipe() 33 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libsecp256k1/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.logger import shprint 2 | from pythonforandroid.util import current_directory 3 | from pythonforandroid.recipe import Recipe 4 | from multiprocessing import cpu_count 5 | from os.path import exists 6 | import sh 7 | 8 | 9 | class LibSecp256k1Recipe(Recipe): 10 | 11 | built_libraries = {'libsecp256k1.so': '.libs'} 12 | 13 | url = 'https://github.com/bitcoin-core/secp256k1/archive/master.zip' 14 | 15 | def build_arch(self, arch): 16 | env = self.get_recipe_env(arch) 17 | with current_directory(self.get_build_dir(arch.arch)): 18 | if not exists('configure'): 19 | shprint(sh.Command('./autogen.sh'), _env=env) 20 | shprint( 21 | sh.Command('./configure'), 22 | '--host=' + arch.command_prefix, 23 | '--prefix=' + self.ctx.get_python_install_dir(arch.arch), 24 | '--enable-shared', 25 | '--enable-module-recovery', 26 | '--enable-experimental', 27 | '--enable-module-ecdh', 28 | _env=env) 29 | shprint(sh.make, '-j' + str(cpu_count()), _env=env) 30 | 31 | 32 | recipe = LibSecp256k1Recipe() 33 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libsodium/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import Recipe 2 | from pythonforandroid.util import current_directory 3 | from pythonforandroid.logger import shprint 4 | from multiprocessing import cpu_count 5 | import sh 6 | 7 | 8 | class LibsodiumRecipe(Recipe): 9 | version = '1.0.16' 10 | url = 'https://github.com/jedisct1/libsodium/releases/download/{version}/libsodium-{version}.tar.gz' 11 | depends = [] 12 | patches = ['size_max_fix.patch'] 13 | built_libraries = {'libsodium.so': 'src/libsodium/.libs'} 14 | 15 | def build_arch(self, arch): 16 | env = self.get_recipe_env(arch) 17 | with current_directory(self.get_build_dir(arch.arch)): 18 | bash = sh.Command('bash') 19 | shprint( 20 | bash, 21 | 'configure', 22 | '--disable-soname-versions', 23 | '--host={}'.format(arch.command_prefix), 24 | '--enable-shared', 25 | _env=env, 26 | ) 27 | shprint(sh.make, '-j', str(cpu_count()), _env=env) 28 | 29 | def get_recipe_env(self, arch): 30 | env = super().get_recipe_env(arch) 31 | env['CFLAGS'] += ' -Os' 32 | return env 33 | 34 | 35 | recipe = LibsodiumRecipe() 36 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libsodium/size_max_fix.patch: -------------------------------------------------------------------------------- 1 | diff -urN libsodium-1.0.16.ori/src/libsodium/include/sodium/export.h libsodium-1.0.16/src/libsodium/include/sodium/export.h 2 | --- libsodium-1.0.16.ori/src/libsodium/include/sodium/export.h 2017-12-12 00:03:07.000000000 +0100 3 | +++ libsodium-1.0.16/src/libsodium/include/sodium/export.h 2018-10-31 09:46:06.051189444 +0100 4 | @@ -47,6 +47,8 @@ 5 | # endif 6 | #endif 7 | 8 | +#include 9 | + 10 | #define SODIUM_MIN(A, B) ((A) < (B) ? (A) : (B)) 11 | #define SODIUM_SIZE_MAX SODIUM_MIN(UINT64_MAX, SIZE_MAX) 12 | 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libtorrent/disable-so-version.patch: -------------------------------------------------------------------------------- 1 | --- libtorrent/Jamfile 2016-01-17 23:52:45.000000000 +0100 2 | +++ libtorrent-patch/Jamfile 2016-02-09 13:37:57.499561750 +0100 3 | @@ -325,6 +325,7 @@ 4 | if $(type) = SHARED_LIB && 5 | ( ! ( [ $(property-set).get ] in windows cygwin ) ) 6 | { 7 | + return "libtorrent_rasterbar.so" ; # linked by python bindings .so 8 | name = $(name).$(VERSION) ; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libtorrent/setup-lib-name.patch: -------------------------------------------------------------------------------- 1 | --- libtorrent/bindings/python/setup.py.orig 2018-11-26 22:21:48.772142135 +0100 2 | +++ libtorrent/bindings/python/setup.py 2018-11-26 22:23:23.092141235 +0100 3 | @@ -167,7 +167,7 @@ 4 | extra_compile = flags.parse(extra_cmd) 5 | 6 | ext = [Extension( 7 | - 'libtorrent', 8 | + 'libtorrent_rasterbar', 9 | sources=sorted(source_list), 10 | language='c++', 11 | include_dirs=flags.include_dirs, 12 | @@ -178,7 +178,7 @@ 13 | ] 14 | 15 | setup( 16 | - name='python-libtorrent', 17 | + name='libtorrent', 18 | version='1.2.1', 19 | author='Arvid Norberg', 20 | author_email='arvid@libtorrent.org', 21 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libtorrent/use-soname-python.patch: -------------------------------------------------------------------------------- 1 | --- libtorrent/bindings/python/Jamfile.orig 2018-12-07 16:46:50.851838981 +0100 2 | +++ libtorrent/bindings/python/Jamfile 2018-12-07 16:49:09.099837663 +0100 3 | @@ -113,7 +113,7 @@ 4 | 5 | if ( gcc in $(properties) ) 6 | { 7 | - result += -Wl,-Bsymbolic ; 8 | + result += -Wl,-soname=libtorrent.so,-Bsymbolic ; 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libtorrent/user-config-openssl.patch: -------------------------------------------------------------------------------- 1 | --- boost/user-config.jam.orig 2018-12-07 14:16:45.911924859 +0100 2 | +++ boost/user-config.jam 2018-12-07 14:20:16.243922853 +0100 3 | @@ -9,6 +9,8 @@ 4 | local PYTHON_INCLUDE = [ os.environ PYTHON_INCLUDE ] ; 5 | local PYTHON_LINK_VERSION = [ os.environ PYTHON_LINK_VERSION ] ; 6 | local PYTHON_MAJOR_MINOR = [ os.environ PYTHON_MAJOR_MINOR ] ; 7 | +local OPENSSL_BUILD_PATH = [ os.environ OPENSSL_BUILD_PATH ] ; 8 | +local OPENSSL_VERSION = [ os.environ OPENSSL_VERSION ] ; 9 | 10 | #using clang : $(ARCH) : $(ANDROID_BINARIES_PATH)/clang++ : 11 | #$(ANDROID_BINARIES_PATH)/llvm-ar 12 | @@ -56,6 +58,9 @@ 13 | -Wl,-z,relro 14 | -Wl,-z,now 15 | -lc++_shared 16 | +-L$(OPENSSL_BUILD_PATH) 17 | +-lcrypto$(OPENSSL_VERSION) 18 | +-lssl$(OPENSSL_VERSION) 19 | -L$(PYTHON_ROOT) 20 | -lpython$(PYTHON_LINK_VERSION) 21 | -Wl,-O1 22 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libtribler/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | """ 4 | Privacy with BitTorrent and resilient to shut down 5 | 6 | http://www.tribler.org 7 | """ 8 | 9 | 10 | class LibTriblerRecipe(PythonRecipe): 11 | 12 | version = 'devel' 13 | 14 | url = 'git+https://github.com/Tribler/tribler.git' 15 | 16 | depends = ['apsw', 'cryptography', 'ffmpeg', 'libsodium', 'libtorrent', 'm2crypto', 17 | 'netifaces', 'openssl', 'pil', 'pycrypto', 'pyleveldb', 'twisted', 18 | ] 19 | 20 | conflicts = ['python3'] 21 | 22 | python_depends = ['chardet', 'cherrypy', 'configobj', 'decorator', 'feedparser', 23 | 'libnacl', 'pyasn1', 'requests', 'six', 24 | ] 25 | 26 | site_packages_name = 'Tribler' 27 | 28 | 29 | recipe = LibTriblerRecipe() 30 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libvpx/patches/0001-android-force-neon-runtime.patch: -------------------------------------------------------------------------------- 1 | diff -u -r ../libvpx-1.6.1/vpx_ports/arm_cpudetect.c ./vpx_ports/arm_cpudetect.c 2 | --- ../libvpx-1.6.1/vpx_ports/arm_cpudetect.c 2017-01-12 21:27:27.000000000 +0100 3 | +++ ./vpx_ports/arm_cpudetect.c 2017-01-29 23:55:05.399283897 +0100 4 | @@ -92,20 +92,17 @@ 5 | } 6 | 7 | #elif defined(__ANDROID__) /* end _MSC_VER */ 8 | -#include 9 | 10 | int arm_cpu_caps(void) { 11 | int flags; 12 | int mask; 13 | - uint64_t features; 14 | if (!arm_cpu_env_flags(&flags)) { 15 | return flags; 16 | } 17 | mask = arm_cpu_env_mask(); 18 | - features = android_getCpuFeatures(); 19 | 20 | #if HAVE_NEON || HAVE_NEON_ASM 21 | - if (features & ANDROID_CPU_ARM_FEATURE_NEON) flags |= HAS_NEON; 22 | + flags |= HAS_NEON; 23 | #endif /* HAVE_NEON || HAVE_NEON_ASM */ 24 | return flags & mask; 25 | } 26 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libx264/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import Recipe 2 | from pythonforandroid.util import current_directory 3 | from pythonforandroid.logger import shprint 4 | from multiprocessing import cpu_count 5 | from os.path import realpath 6 | import sh 7 | 8 | 9 | class LibX264Recipe(Recipe): 10 | version = '5db6aa6cab1b146e07b60cc1736a01f21da01154' # commit of latest known stable version 11 | url = 'https://code.videolan.org/videolan/x264/-/archive/{version}/x264-{version}.zip' 12 | built_libraries = {'libx264.a': 'lib'} 13 | 14 | def build_arch(self, arch): 15 | with current_directory(self.get_build_dir(arch.arch)): 16 | env = self.get_recipe_env(arch) 17 | configure = sh.Command('./configure') 18 | shprint(configure, 19 | f'--host={arch.command_prefix}', 20 | '--disable-asm', 21 | '--disable-cli', 22 | '--enable-pic', 23 | '--enable-static', 24 | '--prefix={}'.format(realpath('.')), 25 | _env=env) 26 | shprint(sh.make, '-j', str(cpu_count()), _env=env) 27 | shprint(sh.make, 'install', _env=env) 28 | 29 | 30 | recipe = LibX264Recipe() 31 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libxslt/fix-dlopen.patch: -------------------------------------------------------------------------------- 1 | --- libxslt-1.1.27.orig/python/libxsl.py 2012-09-04 16:26:23.000000000 +0200 2 | +++ libxslt-1.1.27/python/libxsl.py 2013-07-29 15:11:04.182227378 +0200 3 | @@ -4,7 +4,7 @@ 4 | # loader to work in that mode if feasible 5 | # 6 | import sys 7 | -if not hasattr(sys,'getdlopenflags'): 8 | +if True: 9 | import libxml2mod 10 | import libxsltmod 11 | import libxml2 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/libzbar/werror.patch: -------------------------------------------------------------------------------- 1 | diff --git a/configure.ac b/configure.ac 2 | index 256aedb..727caba 100644 3 | --- a/configure.ac 4 | +++ b/configure.ac 5 | @@ -3,7 +3,7 @@ AC_PREREQ([2.61]) 6 | AC_INIT([zbar], [0.10], [spadix@users.sourceforge.net]) 7 | AC_CONFIG_AUX_DIR(config) 8 | AC_CONFIG_MACRO_DIR(config) 9 | -AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects std-options dist-bzip2]) 10 | +AM_INIT_AUTOMAKE([1.10 -Wall foreign subdir-objects std-options dist-bzip2]) 11 | AC_CONFIG_HEADERS([include/config.h]) 12 | AC_CONFIG_SRCDIR(zbar/scanner.c) 13 | LT_PREREQ([2.2]) 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/matplotlib/libfreetype.pc.template: -------------------------------------------------------------------------------- 1 | prefix=path_to_built 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${exec_prefix}/objs/.libs 5 | 6 | Name: freetype2 7 | Description: The freetype2 library 8 | Version: library_version 9 | Cflags: -I${includedir} 10 | Libs: -L${libdir} -lfreetype 11 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/msgpack-python/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CythonRecipe 2 | 3 | 4 | class MsgPackRecipe(CythonRecipe): 5 | version = '0.4.7' 6 | url = 'https://pypi.python.org/packages/source/m/msgpack-python/msgpack-python-{version}.tar.gz' 7 | depends = ["setuptools"] 8 | call_hostpython_via_targetpython = False 9 | 10 | 11 | recipe = MsgPackRecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/ndghttpsclient: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | class NdgHttpsClientRecipe(PythonRecipe): 4 | version = '0.5.1' 5 | url = 'https://pypi.python.org/packages/source/n/ndg-httpsclient/ndg_httpsclient-{version}.tar.gz' 6 | depends = ['python3', 'pyopenssl', 'cryptography'] 7 | call_hostpython_via_targetpython = False 8 | 9 | recipe = NdgHttpsClientRecipe() 10 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/netifaces/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe 2 | 3 | 4 | class NetifacesRecipe(CompiledComponentsPythonRecipe): 5 | 6 | version = '0.10.9' 7 | 8 | url = 'https://files.pythonhosted.org/packages/source/n/netifaces/netifaces-{version}.tar.gz' 9 | 10 | depends = ['setuptools'] 11 | 12 | patches = ['fix-build.patch'] 13 | 14 | site_packages_name = 'netifaces' 15 | 16 | call_hostpython_via_targetpython = False 17 | 18 | 19 | recipe = NetifacesRecipe() 20 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/netifaces/fix-build.patch: -------------------------------------------------------------------------------- 1 | --- netifaces/setup.py.orig 2018-05-02 09:45:09.000000000 +0200 2 | +++ netifaces/setup.py 2018-12-11 14:12:02.785808692 +0100 3 | @@ -55,7 +55,7 @@ 4 | self.check_requirements() 5 | build_ext.build_extensions(self) 6 | 7 | - def test_build(self, contents, link=True, execute=False, libraries=None, 8 | + def test_build(self, contents, link=False, execute=False, libraries=None, 9 | include_dirs=None, library_dirs=None): 10 | name = os.path.join(self.build_temp, 'conftest-%s.c' % self.conftestidx) 11 | self.conftestidx += 1 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/numpy/patches/add_libm_explicitly_to_build.patch: -------------------------------------------------------------------------------- 1 | diff --git a/numpy/linalg/setup.py b/numpy/linalg/setup.py 2 | index 66c07c9..d34bd93 100644 3 | --- a/numpy/linalg/setup.py 4 | +++ b/numpy/linalg/setup.py 5 | @@ -46,6 +46,7 @@ def configuration(parent_package='', top_path=None): 6 | sources=['lapack_litemodule.c', get_lapack_lite_sources], 7 | depends=['lapack_lite/f2c.h'], 8 | extra_info=lapack_info, 9 | + libraries=['m'], 10 | ) 11 | 12 | # umath_linalg module 13 | @@ -54,7 +54,7 @@ def configuration(parent_package='', top_path=None): 14 | sources=['umath_linalg.c.src', get_lapack_lite_sources], 15 | depends=['lapack_lite/f2c.h'], 16 | extra_info=lapack_info, 17 | - libraries=['npymath'], 18 | + libraries=['npymath', 'm'], 19 | ) 20 | return config 21 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/numpy/patches/ranlib.patch: -------------------------------------------------------------------------------- 1 | diff -Naur numpy.orig/numpy/distutils/unixccompiler.py numpy/numpy/distutils/unixccompiler.py 2 | --- numpy.orig/numpy/distutils/unixccompiler.py 2022-05-28 10:22:10.000000000 +0200 3 | +++ numpy/numpy/distutils/unixccompiler.py 2022-05-28 10:22:24.000000000 +0200 4 | @@ -124,6 +124,7 @@ 5 | # platform intelligence here to skip ranlib if it's not 6 | # needed -- or maybe Python's configure script took care of 7 | # it for us, hence the check for leading colon. 8 | + self.ranlib = [os.environ.get('RANLIB')] 9 | if self.ranlib: 10 | display = '%s:@ %s' % (os.path.basename(self.ranlib[0]), 11 | output_filename) 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/omemo-backend-signal/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class OmemoBackendSignalRecipe(PythonRecipe): 5 | name = 'omemo-backend-signal' 6 | version = '0.2.5' 7 | url = 'https://pypi.python.org/packages/source/o/omemo-backend-signal/omemo-backend-signal-{version}.tar.gz' 8 | site_packages_name = 'omemo-backend-signal' 9 | depends = [ 10 | 'setuptools', 11 | 'protobuf_cpp', 12 | 'x3dh', 13 | 'DoubleRatchet', 14 | 'hkdf==0.0.3', 15 | 'cryptography', 16 | 'omemo', 17 | ] 18 | call_hostpython_via_targetpython = False 19 | 20 | 21 | recipe = OmemoBackendSignalRecipe() 22 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/omemo/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class OmemoRecipe(PythonRecipe): 5 | name = 'omemo' 6 | version = '0.11.0' 7 | url = 'https://pypi.python.org/packages/source/O/OMEMO/OMEMO-{version}.tar.gz' 8 | site_packages_name = 'omemo' 9 | depends = [ 10 | 'setuptools', 11 | 'x3dh', 12 | 'cryptography', 13 | ] 14 | call_hostpython_via_targetpython = False 15 | 16 | 17 | recipe = OmemoRecipe() 18 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/openal/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import NDKRecipe 2 | from pythonforandroid.toolchain import current_directory, shprint 3 | from os.path import join 4 | import sh 5 | 6 | 7 | class OpenALRecipe(NDKRecipe): 8 | version = '1.21.1' 9 | url = 'https://github.com/kcat/openal-soft/archive/refs/tags/{version}.tar.gz' 10 | 11 | generated_libraries = ['libopenal.so'] 12 | 13 | def build_arch(self, arch): 14 | with current_directory(self.get_build_dir(arch.arch)): 15 | env = self.get_recipe_env(arch) 16 | cmake_args = [ 17 | "-DANDROID_STL=" + self.stl_lib_name, 18 | "-DCMAKE_TOOLCHAIN_FILE={}".format( 19 | join(self.ctx.ndk_dir, "build", "cmake", "android.toolchain.cmake") 20 | ), 21 | ] 22 | shprint( 23 | sh.cmake, '.', 24 | *cmake_args, 25 | _env=env 26 | ) 27 | shprint(sh.make, _env=env) 28 | self.install_libs(arch, 'libopenal.so') 29 | 30 | 31 | recipe = OpenALRecipe() 32 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/opencv_extras/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import Recipe 2 | 3 | 4 | class OpenCVExtrasRecipe(Recipe): 5 | """ 6 | OpenCV extras recipe allows us to build extra modules from the 7 | `opencv_contrib` repository. It depends on opencv recipe and all the build 8 | of the modules will be performed inside opencv recipe build directory. 9 | 10 | .. note:: the version of this recipe should be the same than opencv recipe. 11 | 12 | .. warning:: Be aware that these modules are experimental, some of them 13 | maybe included in opencv future releases and removed from extras. 14 | 15 | .. seealso:: https://github.com/opencv/opencv_contrib 16 | 17 | """ 18 | version = '4.5.1' 19 | url = 'https://github.com/opencv/opencv_contrib/archive/{version}.zip' 20 | depends = ['opencv'] 21 | 22 | 23 | recipe = OpenCVExtrasRecipe() 24 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/openssl/disable-sover.patch: -------------------------------------------------------------------------------- 1 | --- openssl/Makefile.orig 2018-10-20 22:49:40.418310423 +0200 2 | +++ openssl/Makefile 2018-10-20 22:50:23.347322403 +0200 3 | @@ -19,7 +19,7 @@ 4 | SHLIB_MAJOR=1 5 | SHLIB_MINOR=1 6 | SHLIB_TARGET=linux-shared 7 | -SHLIB_EXT=.so.$(SHLIB_VERSION_NUMBER) 8 | +SHLIB_EXT=$(SHLIB_VERSION_NUMBER).so 9 | SHLIB_EXT_SIMPLE=.so 10 | SHLIB_EXT_IMPORT= 11 | 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pil/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipes.Pillow import PillowRecipe 2 | from pythonforandroid.logger import warning 3 | 4 | 5 | class PilRecipe(PillowRecipe): 6 | """A transparent wrapper around the Pillow recipe, it should build 7 | Pillow automatically as if "pillow" were specified in the 8 | requirements. 9 | """ 10 | 11 | name = 'Pillow' # ensures the Pillow recipe directory is used where necessary 12 | 13 | conflicts = ['pillow'] 14 | 15 | def build_arch(self, arch): 16 | warning('PIL is no longer supported, building Pillow instead. ' 17 | 'This should be a drop-in replacement.') 18 | warning('It is recommended to change "pil" to "pillow" in your requirements, ' 19 | 'to ensure future compatibility') 20 | super().build_arch(arch) 21 | 22 | 23 | recipe = PilRecipe() 24 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/png/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import Recipe 2 | from pythonforandroid.logger import shprint 3 | from pythonforandroid.util import current_directory 4 | from multiprocessing import cpu_count 5 | import sh 6 | 7 | 8 | class PngRecipe(Recipe): 9 | name = 'png' 10 | version = '1.6.37' 11 | url = 'https://github.com/glennrp/libpng/archive/v{version}.zip' 12 | built_libraries = {'libpng16.so': '.libs'} 13 | 14 | def build_arch(self, arch): 15 | build_dir = self.get_build_dir(arch.arch) 16 | with current_directory(build_dir): 17 | env = self.get_recipe_env(arch) 18 | shprint( 19 | sh.Command('./configure'), 20 | '--host=' + arch.command_prefix, 21 | '--target=' + arch.command_prefix, 22 | '--disable-static', 23 | '--enable-shared', 24 | '--prefix={}/install'.format(self.get_build_dir(arch.arch)), 25 | _env=env, 26 | ) 27 | shprint(sh.make, '-j', str(cpu_count()), _env=env) 28 | 29 | 30 | recipe = PngRecipe() 31 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/png/build_shared_library.patch: -------------------------------------------------------------------------------- 1 | diff --git a/jni/Android.mk b/jni/Android.mk 2 | index df2ff1a..2f70985 100644 3 | --- a/jni/Android.mk 4 | +++ b/jni/Android.mk 5 | @@ -26,8 +26,9 @@ LOCAL_SRC_FILES :=\ 6 | arm/filter_neon_intrinsics.c 7 | 8 | #LOCAL_SHARED_LIBRARIES := -lz 9 | -LOCAL_EXPORT_LDLIBS := -lz 10 | +# LOCAL_EXPORT_LDLIBS := -lz 11 | +LOCAL_LDLIBS := -lz 12 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/. 13 | 14 | -#include $(BUILD_SHARED_LIBRARY) 15 | -include $(BUILD_STATIC_LIBRARY) 16 | +include $(BUILD_SHARED_LIBRARY) 17 | +# include $(BUILD_STATIC_LIBRARY) 18 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/preppy/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class PreppyRecipe(PythonRecipe): 5 | version = '27b7085' 6 | url = 'https://bitbucket.org/rptlab/preppy/get/{version}.tar.gz' 7 | depends = [] 8 | patches = ['fix-setup.patch'] 9 | call_hostpython_via_targetpython = False 10 | 11 | 12 | recipe = PreppyRecipe() 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/py3dns/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class Py3DNSRecipe(PythonRecipe): 5 | site_packages_name = 'DNS' 6 | version = '3.2.1' 7 | url = 'https://launchpad.net/py3dns/trunk/{version}/+download/py3dns-{version}.tar.gz' 8 | depends = ['setuptools'] 9 | patches = ['patches/android.patch'] 10 | call_hostpython_via_targetpython = False 11 | 12 | 13 | recipe = Py3DNSRecipe() 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/py3dns/patches/android.patch: -------------------------------------------------------------------------------- 1 | diff --git a/DNS/Base.py b/DNS/Base.py 2 | index 34a6da7..a558889 100644 3 | --- a/DNS/Base.py 4 | +++ b/DNS/Base.py 5 | @@ -15,6 +15,7 @@ import socket, string, types, time, select 6 | import errno 7 | from . import Type,Class,Opcode 8 | import asyncore 9 | +import os 10 | # 11 | # This random generator is used for transaction ids and port selection. This 12 | # is important to prevent spurious results from lost packets, and malicious 13 | @@ -50,8 +51,12 @@ defaults= { 'protocol':'udp', 'port':53, 'opcode':Opcode.QUERY, 14 | 15 | def ParseResolvConf(resolv_path="/etc/resolv.conf"): 16 | "parses the /etc/resolv.conf file and sets defaults for name servers" 17 | - with open(resolv_path, 'r') as stream: 18 | - return ParseResolvConfFromIterable(stream) 19 | + if os.path.exists(resolv_path): 20 | + with open(resolv_path, 'r') as stream: 21 | + return ParseResolvConfFromIterable(stream) 22 | + else: 23 | + defaults['server'].append('127.0.0.1') 24 | + return 25 | 26 | def ParseResolvConfFromIterable(lines): 27 | "parses a resolv.conf formatted stream and sets defaults for name servers" 28 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyaml/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class PyamlRecipe(PythonRecipe): 5 | version = "15.8.2" 6 | url = 'https://pypi.python.org/packages/source/p/pyaml/pyaml-{version}.tar.gz' 7 | depends = ["setuptools"] 8 | site_packages_name = 'yaml' 9 | call_hostpython_via_targetpython = False 10 | 11 | 12 | recipe = PyamlRecipe() 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pybind11/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | from os.path import join 3 | 4 | 5 | class Pybind11Recipe(PythonRecipe): 6 | 7 | version = '2.9.0' 8 | url = 'https://github.com/pybind/pybind11/archive/refs/tags/v{version}.zip' 9 | depends = ['setuptools'] 10 | call_hostpython_via_targetpython = False 11 | install_in_hostpython = True 12 | 13 | def get_include_dir(self, arch): 14 | return join(self.get_build_dir(arch.arch), 'include') 15 | 16 | 17 | recipe = Pybind11Recipe() 18 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pycparser/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class PycparserRecipe(PythonRecipe): 5 | name = 'pycparser' 6 | version = '2.14' 7 | url = 'https://pypi.python.org/packages/source/p/pycparser/pycparser-{version}.tar.gz' 8 | 9 | depends = ['setuptools'] 10 | 11 | call_hostpython_via_targetpython = False 12 | 13 | install_in_hostpython = True 14 | 15 | 16 | recipe = PycparserRecipe() 17 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pycrypto/add_length.patch: -------------------------------------------------------------------------------- 1 | --- pycrypto-2.6.1/src/hash_SHA2_template.c.orig 2013-10-14 14:38:10.000000000 -0700 2 | +++ pycrypto-2.6.1/src/hash_SHA2_template.c 2014-05-19 10:15:51.000000000 -0700 3 | @@ -87,7 +87,7 @@ 4 | * return 1 on success 5 | * return 0 if the length overflows 6 | */ 7 | -int add_length(hash_state *hs, sha2_word_t inc) { 8 | +static int add_length(hash_state *hs, sha2_word_t inc) { 9 | sha2_word_t overflow_detector; 10 | overflow_detector = hs->length_lower; 11 | hs->length_lower += inc; 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pycryptodome/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class PycryptodomeRecipe(PythonRecipe): 5 | version = '3.6.3' 6 | url = 'https://github.com/Legrandin/pycryptodome/archive/v{version}.tar.gz' 7 | depends = ['setuptools', 'cffi'] 8 | 9 | 10 | recipe = PycryptodomeRecipe() 11 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pydantic/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class PydanticRecipe(PythonRecipe): 5 | version = '1.10.4' 6 | url = 'https://github.com/pydantic/pydantic/archive/refs/tags/v{version}.zip' 7 | depends = ['setuptools'] 8 | python_depends = ['Cython', 'devtools', 'email-validator', 'typing-extensions', 'python-dotenv'] 9 | call_hostpython_via_targetpython = False 10 | 11 | 12 | recipe = PydanticRecipe() 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyicu/__init__.py: -------------------------------------------------------------------------------- 1 | from os.path import join 2 | from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe 3 | 4 | 5 | class PyICURecipe(CppCompiledComponentsPythonRecipe): 6 | version = '1.9.2' 7 | url = ('https://pypi.python.org/packages/source/P/PyICU/' 8 | 'PyICU-{version}.tar.gz') 9 | depends = ["icu"] 10 | patches = ['locale.patch'] 11 | 12 | def get_recipe_env(self, arch): 13 | env = super().get_recipe_env(arch) 14 | 15 | icu_include = join( 16 | self.ctx.get_python_install_dir(arch.arch), "include", "icu") 17 | 18 | icu_recipe = self.get_recipe('icu', self.ctx) 19 | icu_link_libs = icu_recipe.built_libraries.keys() 20 | env["PYICU_LIBRARIES"] = ":".join(lib[3:-3] for lib in icu_link_libs) 21 | env["CPPFLAGS"] += " -I" + icu_include 22 | env["LDFLAGS"] += " -L" + join( 23 | icu_recipe.get_build_dir(arch.arch), "icu_build", "lib" 24 | ) 25 | 26 | return env 27 | 28 | 29 | recipe = PyICURecipe() 30 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyicu/locale.patch: -------------------------------------------------------------------------------- 1 | diff -Naur locale.cpp locale1.cpp 2 | --- pyicu/locale.cpp 2015-04-29 07:32:39.000000000 +0200 3 | +++ locale1.cpp 2016-05-12 17:13:08.990059346 +0200 4 | @@ -27,7 +27,7 @@ 5 | #if defined(_MSC_VER) || defined(__WIN32) 6 | #include 7 | #else 8 | -#include 9 | +#include 10 | #include 11 | #include 12 | #endif 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyjnius/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CythonRecipe 2 | from pythonforandroid.toolchain import shprint, current_directory, info 3 | from pythonforandroid.patching import will_build 4 | import sh 5 | from os.path import join 6 | 7 | 8 | class PyjniusRecipe(CythonRecipe): 9 | version = '1.5.0' 10 | url = 'https://github.com/kivy/pyjnius/archive/{version}.zip' 11 | name = 'pyjnius' 12 | depends = [('genericndkbuild', 'sdl2'), 'six'] 13 | site_packages_name = 'jnius' 14 | 15 | patches = [('genericndkbuild_jnienv_getter.patch', will_build('genericndkbuild'))] 16 | 17 | def get_recipe_env(self, arch): 18 | env = super().get_recipe_env(arch) 19 | # NDKPLATFORM is our switch for detecting Android platform, so can't be None 20 | env['NDKPLATFORM'] = "NOTNONE" 21 | return env 22 | 23 | def postbuild_arch(self, arch): 24 | super().postbuild_arch(arch) 25 | info('Copying pyjnius java class to classes build dir') 26 | with current_directory(self.get_build_dir(arch.arch)): 27 | shprint(sh.cp, '-a', join('jnius', 'src', 'org'), self.ctx.javaclass_dir) 28 | 29 | 30 | recipe = PyjniusRecipe() 31 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyjnius/genericndkbuild_jnienv_getter.patch: -------------------------------------------------------------------------------- 1 | diff -Naur pyjnius.orig/jnius/env.py pyjnius/jnius/env.py 2 | --- pyjnius.orig/jnius/env.py 2022-05-28 11:16:02.000000000 +0200 3 | +++ pyjnius/jnius/env.py 2022-05-28 11:18:30.000000000 +0200 4 | @@ -268,7 +268,7 @@ 5 | 6 | class AndroidJavaLocation(UnixJavaLocation): 7 | def get_libraries(self): 8 | - return ['SDL2', 'log'] 9 | + return ['main', 'log'] 10 | 11 | def get_include_dirs(self): 12 | # When cross-compiling for Android, we should not use the include dirs 13 | diff -Naur pyjnius.orig/jnius/jnius_jvm_android.pxi pyjnius/jnius/jnius_jvm_android.pxi 14 | --- pyjnius.orig/jnius/jnius_jvm_android.pxi 2022-05-28 11:16:02.000000000 +0200 15 | +++ pyjnius/jnius/jnius_jvm_android.pxi 2022-05-28 11:17:17.000000000 +0200 16 | @@ -1,6 +1,6 @@ 17 | # on android, rely on SDL to get the JNI env 18 | -cdef extern JNIEnv *SDL_AndroidGetJNIEnv() 19 | +cdef extern JNIEnv *WebView_AndroidGetJNIEnv() 20 | 21 | 22 | cdef JNIEnv *get_platform_jnienv() except NULL: 23 | - return SDL_AndroidGetJNIEnv() 24 | + return WebView_AndroidGetJNIEnv() 25 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyleveldb/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe 2 | 3 | 4 | class PyLevelDBRecipe(CppCompiledComponentsPythonRecipe): 5 | version = '0.194' 6 | url = ('https://pypi.python.org/packages/source/l/leveldb/' 7 | 'leveldb-{version}.tar.gz') 8 | depends = ['snappy', 'leveldb', 'setuptools'] 9 | patches = ['bindings-only.patch'] 10 | site_packages_name = 'leveldb' 11 | 12 | def get_recipe_env(self, arch): 13 | env = super().get_recipe_env(arch) 14 | 15 | snappy_recipe = self.get_recipe('snappy', self.ctx) 16 | leveldb_recipe = self.get_recipe('leveldb', self.ctx) 17 | 18 | env["LDFLAGS"] += " -L" + snappy_recipe.get_build_dir(arch.arch) 19 | env["LDFLAGS"] += " -L" + leveldb_recipe.get_build_dir(arch.arch) 20 | 21 | env["SNAPPY_BUILD_PATH"] = snappy_recipe.get_build_dir(arch.arch) 22 | env["LEVELDB_BUILD_PATH"] = leveldb_recipe.get_build_dir(arch.arch) 23 | 24 | return env 25 | 26 | 27 | recipe = PyLevelDBRecipe() 28 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pymunk/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe 2 | 3 | 4 | class PymunkRecipe(CompiledComponentsPythonRecipe): 5 | name = "pymunk" 6 | version = "6.0.0" 7 | url = "https://pypi.python.org/packages/source/p/pymunk/pymunk-{version}.zip" 8 | depends = ["cffi", "setuptools"] 9 | call_hostpython_via_targetpython = False 10 | 11 | def get_recipe_env(self, arch): 12 | env = super().get_recipe_env(arch) 13 | env["LDFLAGS"] += " -llog" # Used by Chipmunk cpMessage 14 | env["LDFLAGS"] += " -lm" # For older versions of Android 15 | return env 16 | 17 | 18 | recipe = PymunkRecipe() 19 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pynacl/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe 2 | import os 3 | 4 | 5 | class PyNaCLRecipe(CompiledComponentsPythonRecipe): 6 | name = 'pynacl' 7 | version = '1.3.0' 8 | url = 'https://pypi.python.org/packages/source/P/PyNaCl/PyNaCl-{version}.tar.gz' 9 | 10 | depends = ['hostpython3', 'six', 'setuptools', 'cffi', 'libsodium'] 11 | call_hostpython_via_targetpython = False 12 | 13 | def get_recipe_env(self, arch): 14 | env = super().get_recipe_env(arch) 15 | env['SODIUM_INSTALL'] = 'system' 16 | 17 | libsodium_build_dir = self.get_recipe( 18 | 'libsodium', self.ctx).get_build_dir(arch.arch) 19 | env['CFLAGS'] += ' -I{}'.format(os.path.join(libsodium_build_dir, 20 | 'src/libsodium/include')) 21 | env['LDFLAGS'] += ' -L{}'.format( 22 | self.ctx.get_libs_dir(arch.arch) + 23 | '-L{}'.format(self.ctx.libs_dir)) + ' -L{}'.format( 24 | libsodium_build_dir) 25 | 26 | return env 27 | 28 | 29 | recipe = PyNaCLRecipe() 30 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyogg/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | from os.path import join 3 | 4 | 5 | class PyOggRecipe(PythonRecipe): 6 | version = '0.6.4a1' 7 | url = 'https://files.pythonhosted.org/packages/source/p/pyogg/PyOgg-{version}.tar.gz' 8 | depends = ['libogg', 'libvorbis', 'setuptools'] 9 | patches = [join('patches', 'fix-find-lib.patch')] 10 | 11 | call_hostpython_via_targetpython = False 12 | 13 | 14 | recipe = PyOggRecipe() 15 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyogg/patches/fix-find-lib.patch: -------------------------------------------------------------------------------- 1 | diff --git a/pyogg/library_loader.py b/pyogg/library_loader.py 2 | index c2ba36c..383331a 100644 3 | --- a/pyogg/library_loader.py 4 | +++ b/pyogg/library_loader.py 5 | @@ -54,7 +54,7 @@ def load_other(name, paths = None): 6 | except: 7 | pass 8 | else: 9 | - for path in [os.getcwd(), _here]: 10 | + for path in [os.path.join(os.environ['ANDROID_PRIVATE'], '..', 'lib')]: 11 | for style in other_styles: 12 | candidate = os.path.join(path, style.format(name)) 13 | if os.path.exists(candidate): 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyopenal/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | from os.path import join 3 | 4 | 5 | class PyOpenALRecipe(PythonRecipe): 6 | version = '0.7.3a1' 7 | url = 'https://files.pythonhosted.org/packages/source/p/pyopenal/PyOpenAL-{version}.tar.gz' 8 | depends = ['openal', 'numpy', 'setuptools'] 9 | patches = [join('patches', 'fix-find-lib.patch')] 10 | 11 | call_hostpython_via_targetpython = False 12 | 13 | 14 | recipe = PyOpenALRecipe() 15 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyopenal/patches/fix-find-lib.patch: -------------------------------------------------------------------------------- 1 | diff --git a/openal/library_loader.py b/openal/library_loader.py 2 | index be2485c..e8c6cd2 100644 3 | --- a/openal/library_loader.py 4 | +++ b/openal/library_loader.py 5 | @@ -56,7 +56,7 @@ class ExternalLibrary: 6 | except: 7 | pass 8 | else: 9 | - for path in [os.getcwd(), _here]: 10 | + for path in [os.path.join(os.environ['ANDROID_PRIVATE'], '..', 'lib')]: 11 | for style in ExternalLibrary.other_styles: 12 | candidate = os.path.join(path, style.format(name)) 13 | if os.path.exists(candidate) and os.path.isfile(candidate): 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyopenssl/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from pythonforandroid.recipe import PythonRecipe 3 | 4 | 5 | class PyOpenSSLRecipe(PythonRecipe): 6 | version = '19.0.0' 7 | url = 'https://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-{version}.tar.gz' 8 | depends = ['openssl', 'setuptools'] 9 | site_packages_name = 'OpenSSL' 10 | 11 | call_hostpython_via_targetpython = False 12 | 13 | 14 | recipe = PyOpenSSLRecipe() 15 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyopenssl/fix-dlfcn.patch: -------------------------------------------------------------------------------- 1 | --- pyOpenSSL-0.13.orig/OpenSSL/__init__.py 2011-09-02 17:46:13.000000000 +0200 2 | +++ pyOpenSSL-0.13/OpenSSL/__init__.py 2013-07-29 17:20:15.750079894 +0200 3 | @@ -12,6 +12,11 @@ 4 | except AttributeError: 5 | from OpenSSL import crypto 6 | else: 7 | + # XXX android fix 8 | + # linux: RTLD_NOW (0x2) | RTLD_GLOBAL (0x100 / 256) 9 | + # android: RTLD_NOW (0x0) | RTLD_GLOBAL (0x2) 10 | + flags = 0x2 11 | + ''' 12 | try: 13 | import DLFCN 14 | except ImportError: 15 | @@ -31,6 +36,7 @@ 16 | else: 17 | flags = DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL 18 | del DLFCN 19 | + ''' 20 | 21 | sys.setdlopenflags(flags) 22 | from OpenSSL import crypto 23 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyproj/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CythonRecipe 2 | 3 | 4 | class PyProjRecipe(CythonRecipe): 5 | version = '1.9.6' 6 | url = 'https://github.com/pyproj4/pyproj/archive/v{version}rel.zip' 7 | depends = ['setuptools'] 8 | call_hostpython_via_targetpython = False 9 | 10 | 11 | recipe = PyProjRecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyrxp/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe 2 | 3 | 4 | class PyRXPURecipe(CompiledComponentsPythonRecipe): 5 | version = '2a02cecc87b9' 6 | url = 'https://bitbucket.org/rptlab/pyrxp/get/{version}.tar.gz' 7 | depends = [] 8 | patches = [] 9 | 10 | 11 | recipe = PyRXPURecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pysdl2/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class PySDL2Recipe(PythonRecipe): 5 | version = '0.9.6' 6 | url = 'https://files.pythonhosted.org/packages/source/P/PySDL2/PySDL2-{version}.tar.gz' 7 | 8 | depends = ['sdl2'] 9 | 10 | 11 | recipe = PySDL2Recipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pysha3/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pythonforandroid.recipe import PythonRecipe 3 | 4 | 5 | # TODO: CompiledComponentsPythonRecipe 6 | class Pysha3Recipe(PythonRecipe): 7 | version = '1.0.2' 8 | url = 'https://github.com/tiran/pysha3/archive/{version}.tar.gz' 9 | depends = ['setuptools'] 10 | call_hostpython_via_targetpython = False 11 | 12 | def get_recipe_env(self, arch=None, with_flags_in_cc=True): 13 | env = super().get_recipe_env(arch, with_flags_in_cc) 14 | # CFLAGS may only be used to specify C compiler flags, for macro definitions use CPPFLAGS 15 | env['CPPFLAGS'] = env['CFLAGS'] 16 | env['CFLAGS'] = '' 17 | # LDFLAGS may only be used to specify linker flags, for libraries use LIBS 18 | env['LDFLAGS'] = env['LDFLAGS'].replace('-lm', '') 19 | env['LDFLAGS'] += ' -L{}'.format(os.path.join(self.ctx.bootstrap.build_dir, 'libs', arch.arch)) 20 | env['LIBS'] = ' -lm' 21 | env['LDSHARED'] += env['LIBS'] 22 | return env 23 | 24 | 25 | recipe = Pysha3Recipe() 26 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/python3/patches/py3.7.1_fix-ctypes-util-find-library.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py 2 | --- a/Lib/ctypes/util.py 3 | +++ b/Lib/ctypes/util.py 4 | @@ -67,4 +67,11 @@ 5 | return fname 6 | return None 7 | 8 | +# This patch overrides the find_library to look in the right places on 9 | +# Android 10 | +if True: 11 | + from android._ctypes_library_finder import find_library as _find_lib 12 | + def find_library(name): 13 | + return _find_lib(name) 14 | + 15 | elif os.name == "posix" and sys.platform == "darwin": 16 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/python3/patches/py3.7.1_fix-zlib-version.patch: -------------------------------------------------------------------------------- 1 | --- Python-3.7.1/setup.py.orig 2018-10-20 08:04:19.000000000 +0200 2 | +++ Python-3.7.1/setup.py 2019-02-17 00:24:30.715904412 +0100 3 | @@ -1410,7 +1410,8 @@ class PyBuildExt(build_ext): 4 | if zlib_inc is not None: 5 | zlib_h = zlib_inc[0] + '/zlib.h' 6 | version = '"0.0.0"' 7 | - version_req = '"1.1.3"' 8 | + version_req = '"{}"'.format( 9 | + os.environ.get('ZLIB_VERSION', '1.1.3')) 10 | if host_platform == 'darwin' and is_macosx_sdk_path(zlib_h): 11 | zlib_h = os.path.join(macosx_sdk_root(), zlib_h[1:]) 12 | with open(zlib_h) as fp: 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/python3/patches/py3.7.1_fix_cortex_a8.patch: -------------------------------------------------------------------------------- 1 | This patch removes --fix-cortex-a8 from the linker flags in order to support linking 2 | with lld, as lld does not support this flag (https://github.com/android-ndk/ndk/issues/766). 3 | diff --git a/configure b/configure 4 | --- a/configure 5 | +++ b/configure 6 | @@ -5671,7 +5671,7 @@ $as_echo_n "checking for the Android arm ABI... " >&6; } 7 | $as_echo "$_arm_arch" >&6; } 8 | if test "$_arm_arch" = 7; then 9 | BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16" 10 | - LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8" 11 | + LDFLAGS="${LDFLAGS} -march=armv7-a" 12 | fi 13 | else 14 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: not Android" >&5 -------------------------------------------------------------------------------- /pythonforandroid/recipes/python3/patches/py3.8.1_fix_cortex_a8.patch: -------------------------------------------------------------------------------- 1 | This patch removes --fix-cortex-a8 from the linker flags in order to support linking 2 | with lld, as lld does not support this flag (https://github.com/android-ndk/ndk/issues/766). 3 | diff --git a/configure b/configure 4 | index 0914e24..7517168 100755 5 | --- a/configure 6 | +++ b/configure 7 | @@ -5642,7 +5642,7 @@ $as_echo_n "checking for the Android arm ABI... " >&6; } 8 | $as_echo "$_arm_arch" >&6; } 9 | if test "$_arm_arch" = 7; then 10 | BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16" 11 | - LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8" 12 | + LDFLAGS="${LDFLAGS} -march=armv7-a" 13 | fi 14 | else 15 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: not Android" >&5 16 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/python3/patches/pyconfig_detection.patch: -------------------------------------------------------------------------------- 1 | diff -Nru Python-3.8.2/Lib/site.py Python-3.8.2-new/Lib/site.py 2 | --- Python-3.8.2/Lib/site.py 2020-04-28 12:48:38.000000000 -0700 3 | +++ Python-3.8.2-new/Lib/site.py 2020-04-28 12:52:46.000000000 -0700 4 | @@ -487,7 +487,8 @@ 5 | if key == 'include-system-site-packages': 6 | system_site = value.lower() 7 | elif key == 'home': 8 | - sys._home = value 9 | + # this is breaking pyconfig.h path detection with venv 10 | + print('Ignoring "sys._home = value" override') 11 | 12 | sys.prefix = sys.exec_prefix = site_prefix 13 | 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/python3/patches/reproducible-buildinfo.diff: -------------------------------------------------------------------------------- 1 | # DP: Build getbuildinfo.o with DATE/TIME values when defined 2 | 3 | --- a/Makefile.pre.in 4 | +++ b/Makefile.pre.in 5 | @@ -785,6 +785,8 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ 6 | -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \ 7 | -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \ 8 | -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \ 9 | + $(if $(BUILD_DATE),-DDATE='"$(BUILD_DATE)"') \ 10 | + $(if $(BUILD_TIME),-DTIME='"$(BUILD_TIME)"') \ 11 | -o $@ $(srcdir)/Modules/getbuildinfo.c 12 | 13 | Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyusb/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class PyusbRecipe(PythonRecipe): 5 | name = 'pyusb' 6 | version = '1.0.0b1' 7 | url = 'https://pypi.python.org/packages/source/p/pyusb/pyusb-{version}.tar.gz' 8 | depends = [] 9 | site_packages_name = 'usb' 10 | 11 | patches = ['fix-android.patch'] 12 | 13 | 14 | recipe = PyusbRecipe() 15 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/pyzbar/__init__.py: -------------------------------------------------------------------------------- 1 | from os.path import join 2 | from pythonforandroid.recipe import PythonRecipe 3 | 4 | 5 | class PyZBarRecipe(PythonRecipe): 6 | 7 | version = '0.1.7' 8 | 9 | url = 'https://github.com/NaturalHistoryMuseum/pyzbar/archive/v{version}.tar.gz' # noqa 10 | 11 | call_hostpython_via_targetpython = False 12 | 13 | depends = ['setuptools', 'libzbar'] 14 | 15 | def get_recipe_env(self, arch=None, with_flags_in_cc=True): 16 | env = super().get_recipe_env(arch, with_flags_in_cc) 17 | libzbar = self.get_recipe('libzbar', self.ctx) 18 | libzbar_dir = libzbar.get_build_dir(arch.arch) 19 | env['PYTHON_ROOT'] = self.ctx.get_python_install_dir(arch.arch) 20 | env['CFLAGS'] += ' -I' + join(libzbar_dir, 'include') 21 | env['LDFLAGS'] += ' -L' + join(libzbar_dir, 'zbar', '.libs') 22 | env['LIBS'] = env.get('LIBS', '') + ' -landroid -lzbar' 23 | return env 24 | 25 | 26 | recipe = PyZBarRecipe() 27 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/regex/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe 2 | 3 | 4 | class RegexRecipe(CompiledComponentsPythonRecipe): 5 | name = 'regex' 6 | version = '2019.06.08' 7 | url = 'https://pypi.python.org/packages/source/r/regex/regex-{version}.tar.gz' # noqa 8 | 9 | depends = ['setuptools'] 10 | call_hostpython_via_targetpython = False 11 | 12 | 13 | recipe = RegexRecipe() 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/ruamel.yaml/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class RuamelYamlRecipe(PythonRecipe): 5 | version = '0.15.77' 6 | url = 'https://pypi.python.org/packages/source/r/ruamel.yaml/ruamel.yaml-{version}.tar.gz' 7 | depends = ['setuptools'] 8 | site_packages_name = 'ruamel' 9 | call_hostpython_via_targetpython = False 10 | patches = ['disable-pip-req.patch'] 11 | 12 | 13 | recipe = RuamelYamlRecipe() 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/ruamel.yaml/disable-pip-req.patch: -------------------------------------------------------------------------------- 1 | --- setup.py 2018-11-11 18:27:31.936424140 +0100 2 | +++ b/setup.py 2018-11-11 18:28:19.873507071 +0100 3 | @@ -396,7 +396,7 @@ 4 | sys.exit(0) 5 | if not os.environ.get('RUAMEL_NO_PIP_INSTALL_CHECK', False): 6 | print('error: you have to install with "pip install ."') 7 | - sys.exit(1) 8 | + # sys.exit(1) 9 | # If you only support an extension module on Linux, Windows thinks it 10 | # is pure. That way you would get pure python .whl files that take 11 | # precedence for downloading on Linux over source with compilable C code 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/scrypt/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CythonRecipe 2 | 3 | 4 | class ScryptRecipe(CythonRecipe): 5 | 6 | version = '0.8.20' 7 | url = 'https://github.com/holgern/py-scrypt/archive/refs/tags/v{version}.zip' 8 | depends = ['setuptools', 'openssl'] 9 | call_hostpython_via_targetpython = False 10 | patches = ["remove_librt.patch"] 11 | 12 | def get_recipe_env(self, arch, with_flags_in_cc=True): 13 | """ 14 | Adds openssl recipe to include and library path. 15 | """ 16 | env = super().get_recipe_env(arch, with_flags_in_cc) 17 | openssl_recipe = self.get_recipe('openssl', self.ctx) 18 | env['CFLAGS'] += openssl_recipe.include_flags(arch) 19 | env['LDFLAGS'] += ' -L{}'.format(self.ctx.get_libs_dir(arch.arch)) 20 | env['LDFLAGS'] += ' -L{}'.format(self.ctx.libs_dir) 21 | env['LDFLAGS'] += openssl_recipe.link_dirs_flags(arch) 22 | env['LIBS'] = env.get('LIBS', '') + openssl_recipe.link_libs_flags() 23 | return env 24 | 25 | 26 | recipe = ScryptRecipe() 27 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/scrypt/remove_librt.patch: -------------------------------------------------------------------------------- 1 | --- a/setup.py 2018-05-06 23:25:08.757522119 +0200 2 | +++ b/setup.py 2018-05-06 23:25:30.269797365 +0200 3 | @@ -15,7 +15,6 @@ 4 | 5 | if sys.platform.startswith('linux'): 6 | define_macros = [('HAVE_CLOCK_GETTIME', '1'), 7 | - ('HAVE_LIBRT', '1'), 8 | ('HAVE_POSIX_MEMALIGN', '1'), 9 | ('HAVE_STRUCT_SYSINFO', '1'), 10 | ('HAVE_STRUCT_SYSINFO_MEM_UNIT', '1'), 11 | @@ -23,8 +22,7 @@ 12 | ('HAVE_SYSINFO', '1'), 13 | ('HAVE_SYS_SYSINFO_H', '1'), 14 | ('_FILE_OFFSET_BITS', '64')] 15 | - libraries = ['crypto', 'rt'] 16 | - includes = ['/usr/local/include', '/usr/include'] 17 | + libraries = ['crypto'] 18 | CFLAGS.append('-O2') 19 | elif sys.platform.startswith('win32'): 20 | define_macros = [('inline', '__inline')] 21 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/sdl2_image/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sh 3 | from pythonforandroid.logger import shprint 4 | from pythonforandroid.recipe import BootstrapNDKRecipe 5 | from pythonforandroid.util import current_directory 6 | 7 | 8 | class LibSDL2Image(BootstrapNDKRecipe): 9 | version = '2.6.2' 10 | url = 'https://github.com/libsdl-org/SDL_image/releases/download/release-{version}/SDL2_image-{version}.tar.gz' 11 | dir_name = 'SDL2_image' 12 | 13 | patches = ['enable-webp.patch'] 14 | 15 | def prebuild_arch(self, arch): 16 | # We do not have a folder for each arch on BootstrapNDKRecipe, so we 17 | # need to skip the external deps download if we already have done it. 18 | external_deps_dir = os.path.join(self.get_build_dir(arch.arch), "external") 19 | if not os.path.exists(os.path.join(external_deps_dir, "libwebp")): 20 | with current_directory(external_deps_dir): 21 | shprint(sh.Command("./download.sh")) 22 | super().prebuild_arch(arch) 23 | 24 | 25 | recipe = LibSDL2Image() 26 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/sdl2_image/enable-webp.patch: -------------------------------------------------------------------------------- 1 | diff -Naur SDL2_image.orig/Android.mk SDL2_image/Android.mk 2 | --- SDL2_image.orig/Android.mk 2022-10-03 20:51:52.000000000 +0200 3 | +++ SDL2_image/Android.mk 2022-10-03 20:52:48.000000000 +0200 4 | @@ -32,7 +32,7 @@ 5 | 6 | # Enable this if you want to support loading WebP images 7 | # The library path should be a relative path to this directory. 8 | -SUPPORT_WEBP ?= false 9 | +SUPPORT_WEBP := true 10 | WEBP_LIBRARY_PATH := external/libwebp 11 | 12 | 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/sdl2_mixer/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from pythonforandroid.recipe import BootstrapNDKRecipe 4 | 5 | 6 | class LibSDL2Mixer(BootstrapNDKRecipe): 7 | version = '2.6.2' 8 | url = 'https://github.com/libsdl-org/SDL_mixer/releases/download/release-{version}/SDL2_mixer-{version}.tar.gz' 9 | dir_name = 'SDL2_mixer' 10 | 11 | def get_include_dirs(self, arch): 12 | return [ 13 | os.path.join(self.ctx.bootstrap.build_dir, "jni", "SDL2_mixer", "include") 14 | ] 15 | 16 | 17 | recipe = LibSDL2Mixer() 18 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/sdl2_ttf/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import BootstrapNDKRecipe 2 | 3 | 4 | class LibSDL2TTF(BootstrapNDKRecipe): 5 | version = '2.20.1' 6 | url = 'https://github.com/libsdl-org/SDL_ttf/releases/download/release-{version}/SDL2_ttf-{version}.tar.gz' 7 | dir_name = 'SDL2_ttf' 8 | 9 | 10 | recipe = LibSDL2TTF() 11 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/secp256k1/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe 3 | 4 | 5 | class Secp256k1Recipe(CppCompiledComponentsPythonRecipe): 6 | 7 | version = '0.13.2.4' 8 | url = 'https://github.com/ludbb/secp256k1-py/archive/{version}.tar.gz' 9 | 10 | call_hostpython_via_targetpython = False 11 | 12 | depends = [ 13 | 'openssl', 14 | 'hostpython3', 15 | 'python3', 16 | 'setuptools', 17 | 'libffi', 18 | 'cffi', 19 | 'libsecp256k1' 20 | ] 21 | 22 | patches = [ 23 | "cross_compile.patch", "drop_setup_requires.patch", 24 | "pkg-config.patch", "find_lib.patch", "no-download.patch"] 25 | 26 | def get_recipe_env(self, arch=None): 27 | env = super().get_recipe_env(arch) 28 | libsecp256k1 = self.get_recipe('libsecp256k1', self.ctx) 29 | libsecp256k1_dir = libsecp256k1.get_build_dir(arch.arch) 30 | env['CFLAGS'] += ' -I' + os.path.join(libsecp256k1_dir, 'include') 31 | env['LDFLAGS'] += ' -L{} -lsecp256k1'.format(libsecp256k1_dir) 32 | return env 33 | 34 | 35 | recipe = Secp256k1Recipe() 36 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/secp256k1/cross_compile.patch: -------------------------------------------------------------------------------- 1 | diff --git a/setup.py b/setup.py 2 | index bba4bce..b86b369 100644 3 | --- a/setup.py 4 | +++ b/setup.py 5 | @@ -191,6 +192,7 @@ class build_clib(_build_clib): 6 | "--disable-dependency-tracking", 7 | "--with-pic", 8 | "--enable-module-recovery", 9 | + "--host=" + arch.command_prefix, 10 | "--prefix", 11 | os.path.abspath(self.build_clib), 12 | ] 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/secp256k1/drop_setup_requires.patch: -------------------------------------------------------------------------------- 1 | diff --git a/setup.py b/setup.py 2 | index bba4bce..bfffbbc 100644 3 | --- a/setup.py 4 | +++ b/setup.py 5 | @@ -263,7 +263,6 @@ setup( 6 | author_email='lud@tutanota.com', 7 | license='MIT', 8 | 9 | - setup_requires=['cffi>=1.3.0', 'pytest-runner==2.6.2'], 10 | install_requires=['cffi>=1.3.0'], 11 | tests_require=['pytest==2.8.7'], 12 | 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/secp256k1/find_lib.patch: -------------------------------------------------------------------------------- 1 | diff --git a/setup_support.py b/setup_support.py 2 | index 68a2a7f..b84f420 100644 3 | --- a/setup_support.py 4 | +++ b/setup_support.py 5 | @@ -68,6 +68,8 @@ def build_flags(library, type_, path): 6 | 7 | 8 | def _find_lib(): 9 | + # we're picking up the recipe one 10 | + return True 11 | from cffi import FFI 12 | ffi = FFI() 13 | try: 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/secp256k1/no-download.patch: -------------------------------------------------------------------------------- 1 | diff --git a/setup.py b/setup.py 2 | index bba4bce..5ea0228 100644 3 | --- a/setup.py 4 | +++ b/setup.py 5 | @@ -55,6 +55,8 @@ except OSError: 6 | 7 | 8 | def download_library(command): 9 | + # we will use the custom libsecp256k1 recipe 10 | + return 11 | if command.dry_run: 12 | return 13 | libdir = absolute("libsecp256k1") 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/secp256k1/pkg-config.patch: -------------------------------------------------------------------------------- 1 | diff --git a/setup.py b/setup.py 2 | index bba4bce..609481c 100644 3 | --- a/setup.py 4 | +++ b/setup.py 5 | @@ -48,10 +48,7 @@ if [int(i) for i in setuptools_version.split('.')] < [3, 3]: 6 | try: 7 | subprocess.check_call(['pkg-config', '--version']) 8 | except OSError: 9 | - raise SystemExit( 10 | - "'pkg-config' is required to install this package. " 11 | - "Please see the README for details." 12 | - ) 13 | + pass 14 | 15 | 16 | def download_library(command): 17 | diff --git a/setup_support.py b/setup_support.py 18 | index 68a2a7f..ccbafac 100644 19 | --- a/setup_support.py 20 | +++ b/setup_support.py 21 | @@ -40,6 +40,7 @@ def absolute(*paths): 22 | 23 | def build_flags(library, type_, path): 24 | """Return separated build flags from pkg-config output""" 25 | + return [] 26 | 27 | pkg_config_path = [path] 28 | if "PKG_CONFIG_PATH" in os.environ: 29 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/setuptools/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class SetuptoolsRecipe(PythonRecipe): 5 | version = '51.3.3' 6 | url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz' 7 | call_hostpython_via_targetpython = False 8 | install_in_hostpython = True 9 | 10 | 11 | recipe = SetuptoolsRecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/six/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class SixRecipe(PythonRecipe): 5 | version = '1.15.0' 6 | url = 'https://pypi.python.org/packages/source/s/six/six-{version}.tar.gz' 7 | depends = ['setuptools'] 8 | 9 | 10 | recipe = SixRecipe() 11 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/snappy/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import Recipe 2 | from pythonforandroid.logger import shprint 3 | from pythonforandroid.util import current_directory 4 | from os.path import join 5 | import sh 6 | 7 | 8 | class SnappyRecipe(Recipe): 9 | version = '1.1.7' 10 | url = 'https://github.com/google/snappy/archive/{version}.tar.gz' 11 | built_libraries = {'libsnappy.so': '.'} 12 | 13 | def build_arch(self, arch): 14 | env = self.get_recipe_env(arch) 15 | source_dir = self.get_build_dir(arch.arch) 16 | with current_directory(source_dir): 17 | shprint(sh.cmake, source_dir, 18 | '-DANDROID_ABI={}'.format(arch.arch), 19 | '-DANDROID_NATIVE_API_LEVEL={}'.format(self.ctx.ndk_api), 20 | '-DCMAKE_TOOLCHAIN_FILE={}'.format( 21 | join(self.ctx.ndk_dir, 'build', 'cmake', 22 | 'android.toolchain.cmake')), 23 | '-DBUILD_SHARED_LIBS=1', 24 | _env=env) 25 | shprint(sh.make, _env=env) 26 | 27 | 28 | recipe = SnappyRecipe() 29 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/spine/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CythonRecipe 2 | 3 | 4 | class SpineCython(CythonRecipe): 5 | 6 | version = '0.5.1' 7 | url = 'https://github.com/tileworks/spine-cython/archive/{version}.zip' 8 | name = 'spine' 9 | depends = ['setuptools'] 10 | site_packages_name = 'spine' 11 | call_hostpython_via_targetpython = False 12 | 13 | 14 | recipe = SpineCython() 15 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/sqlalchemy/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe 2 | 3 | 4 | class SQLAlchemyRecipe(CompiledComponentsPythonRecipe): 5 | name = 'sqlalchemy' 6 | version = '1.3.3' 7 | url = 'https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-{version}.tar.gz' 8 | call_hostpython_via_targetpython = False 9 | 10 | depends = ['setuptools'] 11 | 12 | patches = ['zipsafe.patch'] 13 | 14 | 15 | recipe = SQLAlchemyRecipe() 16 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/sqlalchemy/zipsafe.patch: -------------------------------------------------------------------------------- 1 | --- a/setup.py 2019-04-15 17:45:03.000000000 +0200 2 | +++ b/setup.py 2019-04-16 20:12:19.056710749 +0200 3 | @@ -145,6 +145,7 @@ 4 | name="SQLAlchemy", 5 | version=VERSION, 6 | description="Database Abstraction Library", 7 | + zip_safe=False, 8 | author="Mike Bayer", 9 | author_email="mike_mp@zzzcomputing.com", 10 | url="http://www.sqlalchemy.org", 11 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/sqlite3/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir)/.. 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_SRC_FILES := sqlite3.c 6 | 7 | LOCAL_MODULE := sqlite3 8 | 9 | LOCAL_CFLAGS := -DSQLITE_ENABLE_FTS4 -D_FILE_OFFSET_BITS=32 10 | 11 | include $(BUILD_SHARED_LIBRARY) 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/storm/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe, current_directory, shprint 2 | import sh 3 | 4 | 5 | class StormRecipe(PythonRecipe): 6 | version = '0.20' 7 | url = 'https://launchpad.net/storm/trunk/{version}/+download/storm-{version}.tar.bz2' 8 | depends = [] 9 | site_packages_name = 'storm' 10 | call_hostpython_via_targetpython = False 11 | 12 | def prebuild_arch(self, arch): 13 | with current_directory(self.get_build_dir(arch.arch)): 14 | # Cross compiling for 32 bits in 64 bit ubuntu before precise is 15 | # failing. See 16 | # https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/873007 17 | shprint(sh.sed, '-i', 18 | "s|BUILD_CEXTENSIONS = True|BUILD_CEXTENSIONS = False|", 19 | 'setup.py') 20 | 21 | 22 | recipe = StormRecipe() 23 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/sympy/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from pythonforandroid.recipe import PythonRecipe 3 | 4 | 5 | class SympyRecipe(PythonRecipe): 6 | version = '1.1.1' 7 | url = 'https://github.com/sympy/sympy/releases/download/sympy-{version}/sympy-{version}.tar.gz' 8 | 9 | depends = ['mpmath'] 10 | 11 | call_hostpython_via_targetpython = True 12 | 13 | patches = ['fix_timeutils.patch', 'fix_pretty_print.patch'] 14 | 15 | 16 | recipe = SympyRecipe() 17 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/sympy/fix_timeutils.patch: -------------------------------------------------------------------------------- 1 | diff --git a/sympy/utilities/timeutils.py b/sympy/utilities/timeutils.py 2 | index 3770d85..c53594e 100644 3 | --- a/sympy/utilities/timeutils.py 4 | +++ b/sympy/utilities/timeutils.py 5 | @@ -8,7 +8,7 @@ import math 6 | from sympy.core.compatibility import range 7 | 8 | _scales = [1e0, 1e3, 1e6, 1e9] 9 | -_units = [u's', u'ms', u'\N{GREEK SMALL LETTER MU}s', u'ns'] 10 | +_units = [u's', u'ms', u'mus', u'ns'] 11 | 12 | 13 | def timed(func, setup="pass", limit=None): 14 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/tflite-runtime/CMakeLists.patch: -------------------------------------------------------------------------------- 1 | --- tflite-runtime/tensorflow/lite/CMakeLists.txt 2022-01-27 17:29:49.460000000 -1000 2 | +++ CMakeLists.txt 2022-02-21 15:03:09.568367300 -1000 3 | @@ -220,6 +220,9 @@ 4 | if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "iOS") 5 | list(FILTER TFLITE_SRCS EXCLUDE REGEX ".*minimal_logging_ios\\.cc$") 6 | endif() 7 | +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Android") 8 | + list(FILTER TFLITE_SRCS EXCLUDE REGEX ".*minimal_logging_default\\.cc$") 9 | +endif() 10 | populate_tflite_source_vars("core" TFLITE_CORE_SRCS) 11 | populate_tflite_source_vars("core/api" TFLITE_CORE_API_SRCS) 12 | populate_tflite_source_vars("c" TFLITE_C_SRCS) 13 | @@ -505,6 +508,7 @@ 14 | ruy 15 | ${CMAKE_DL_LIBS} 16 | ${TFLITE_TARGET_DEPENDENCIES} 17 | + ${ANDROID_LOG_LIB} 18 | ) 19 | 20 | if (NOT BUILD_SHARED_LIBS) 21 | @@ -550,6 +554,7 @@ 22 | tensorflow-lite 23 | ${CMAKE_DL_LIBS} 24 | ) 25 | + 26 | target_compile_options(_pywrap_tensorflow_interpreter_wrapper 27 | PUBLIC ${TFLITE_TARGET_PUBLIC_OPTIONS} 28 | PRIVATE ${TFLITE_TARGET_PRIVATE_OPTIONS} 29 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/twisted/incremental.patch: -------------------------------------------------------------------------------- 1 | diff -Naur twisted-twisted-19.7.0/src/twisted/python/_setup.py twisted-twisted-19.7.0_patched/src/twisted/python/_setup.py 2 | --- twisted-twisted-19.7.0/src/twisted/python/_setup.py 2019-07-28 11:17:29.000000000 +0200 3 | +++ twisted-twisted-19.7.0_patched/src/twisted/python/_setup.py 2019-10-21 22:10:03.643068863 +0200 4 | @@ -282,7 +282,6 @@ 5 | requirements = [ 6 | "zope.interface >= 4.4.2", 7 | "constantly >= 15.1", 8 | - "incremental >= 16.10.1", 9 | "Automat >= 0.3.0", 10 | "hyperlink >= 17.1.1", 11 | "PyHamcrest >= 1.9.0", 12 | @@ -291,8 +290,6 @@ 13 | 14 | arguments.update(dict( 15 | packages=find_packages("src"), 16 | - use_incremental=True, 17 | - setup_requires=["incremental >= 16.10.1"], 18 | install_requires=requirements, 19 | entry_points={ 20 | 'console_scripts': _CONSOLE_SCRIPTS 21 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/twisted/remove_tests.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/twisted/python/_setup.py b/src/twisted/python/_setup.py 2 | index 32cb096c7..a607fef07 100644 3 | --- a/src/twisted/python/_setup.py 4 | +++ b/src/twisted/python/_setup.py 5 | @@ -160,11 +160,6 @@ class ConditionalExtension(Extension, object): 6 | 7 | # The C extensions used for Twisted. 8 | _EXTENSIONS = [ 9 | - ConditionalExtension( 10 | - "twisted.test.raiser", 11 | - sources=["src/twisted/test/raiser.c"], 12 | - condition=lambda _: _isCPython), 13 | - 14 | ConditionalExtension( 15 | "twisted.internet.iocpreactor.iocpsupport", 16 | sources=[ 17 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/ujson/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CompiledComponentsPythonRecipe 2 | 3 | 4 | class UJsonRecipe(CompiledComponentsPythonRecipe): 5 | version = '1.35' 6 | url = 'https://pypi.python.org/packages/source/u/ujson/ujson-{version}.tar.gz' 7 | depends = [] 8 | 9 | 10 | recipe = UJsonRecipe() 11 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/vispy/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class VispyRecipe(PythonRecipe): 5 | version = '0.4.0' 6 | url = 'https://github.com/vispy/vispy/archive/v{version}.tar.gz' 7 | depends = ['numpy', 'pysdl2'] 8 | patches = ['disable_freetype.patch', 9 | 'disable_font_triage.patch', 10 | 'use_es2.patch', 11 | 'remove_ati_check.patch'] 12 | 13 | 14 | recipe = VispyRecipe() 15 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/vispy/disable_font_triage.patch: -------------------------------------------------------------------------------- 1 | diff --git a/vispy/util/fonts/_triage.py b/vispy/util/fonts/_triage.py 2 | index ddbc93d..324c161 100644 3 | --- a/vispy/util/fonts/_triage.py 4 | +++ b/vispy/util/fonts/_triage.py 5 | @@ -9,14 +9,14 @@ import sys 6 | from ._vispy_fonts import _vispy_fonts 7 | if sys.platform.startswith('linux'): 8 | from ._freetype import _load_glyph 9 | - from ...ext.fontconfig import _list_fonts 10 | -elif sys.platform == 'darwin': 11 | - from ._quartz import _load_glyph, _list_fonts 12 | -elif sys.platform.startswith('win'): 13 | - from ._freetype import _load_glyph # noqa, analysis:ignore 14 | - from ._win32 import _list_fonts # noqa, analysis:ignore 15 | -else: 16 | - raise NotImplementedError('unknown system %s' % sys.platform) 17 | + # from ...ext.fontconfig import _list_fonts 18 | +# elif sys.platform == 'darwin': 19 | +# from ._quartz import _load_glyph, _list_fonts 20 | +# elif sys.platform.startswith('win'): 21 | +# from ._freetype import _load_glyph # noqa, analysis:ignore 22 | +# from ._win32 import _list_fonts # noqa, analysis:ignore 23 | +# else: 24 | +# raise NotImplementedError('unknown system %s' % sys.platform) 25 | 26 | _fonts = {} 27 | 28 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/vispy/disable_freetype.patch: -------------------------------------------------------------------------------- 1 | diff --git a/vispy/util/fonts/_freetype.py b/vispy/util/fonts/_freetype.py 2 | index 3b33d0b..229d559 100644 3 | --- a/vispy/util/fonts/_freetype.py 4 | +++ b/vispy/util/fonts/_freetype.py 5 | @@ -12,12 +12,12 @@ import numpy as np 6 | 7 | # Convert face to filename 8 | from ._vispy_fonts import _vispy_fonts, _get_vispy_font_filename 9 | -if sys.platform.startswith('linux'): 10 | - from ...ext.fontconfig import find_font 11 | -elif sys.platform.startswith('win'): 12 | - from ._win32 import find_font # noqa, analysis:ignore 13 | -else: 14 | - raise NotImplementedError 15 | +# if sys.platform.startswith('linux'): 16 | +# from ...ext.fontconfig import find_font 17 | +# elif sys.platform.startswith('win'): 18 | +# from ._win32 import find_font # noqa, analysis:ignore 19 | +# else: 20 | +# raise NotImplementedError 21 | 22 | _font_dict = {} 23 | 24 | @@ -41,6 +41,7 @@ def _load_font(face, bold, italic): 25 | 26 | def _load_glyph(f, char, glyphs_dict): 27 | """Load glyph from font into dict""" 28 | + return 29 | from ...ext.freetype import (FT_LOAD_RENDER, FT_LOAD_NO_HINTING, 30 | FT_LOAD_NO_AUTOHINT) 31 | flags = FT_LOAD_RENDER | FT_LOAD_NO_HINTING | FT_LOAD_NO_AUTOHINT 32 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/vispy/disable_freetype.patch_backup: -------------------------------------------------------------------------------- 1 | diff --git a/vispy/util/fonts/_freetype.py b/vispy/util/fonts/_freetype.py 2 | index 3b33d0b..229d559 100644 3 | --- a/vispy/util/fonts/_freetype.py 4 | +++ b/vispy/util/fonts/_freetype.py 5 | @@ -12,12 +12,12 @@ import numpy as np 6 | 7 | # Convert face to filename 8 | from ._vispy_fonts import _vispy_fonts, _get_vispy_font_filename 9 | -if sys.platform.startswith('linux'): 10 | - from ...ext.fontconfig import find_font 11 | -elif sys.platform.startswith('win'): 12 | - from ._win32 import find_font # noqa, analysis:ignore 13 | -else: 14 | - raise NotImplementedError 15 | +# if sys.platform.startswith('linux'): 16 | +# from ...ext.fontconfig import find_font 17 | +# elif sys.platform.startswith('win'): 18 | +# from ._win32 import find_font # noqa, analysis:ignore 19 | +# else: 20 | +# raise NotImplementedError 21 | 22 | _font_dict = {} 23 | 24 | @@ -41,6 +41,7 @@ def _load_font(face, bold, italic): 25 | 26 | def _load_glyph(f, char, glyphs_dict): 27 | """Load glyph from font into dict""" 28 | + return 29 | from ...ext.freetype import (FT_LOAD_RENDER, FT_LOAD_NO_HINTING, 30 | FT_LOAD_NO_AUTOHINT) 31 | flags = FT_LOAD_RENDER | FT_LOAD_NO_HINTING | FT_LOAD_NO_AUTOHINT 32 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/vispy/use_es2.patch: -------------------------------------------------------------------------------- 1 | diff --git a/vispy/gloo/gl/__init__.py b/vispy/gloo/gl/__init__.py 2 | index 93813fa..c41859c 100644 3 | --- a/vispy/gloo/gl/__init__.py 4 | +++ b/vispy/gloo/gl/__init__.py 5 | @@ -210,7 +210,7 @@ def check_error(when='periodic check'): 6 | 7 | 8 | # Load default gl backend 9 | -from . import gl2 as default_backend # noqa 10 | +from . import es2 as default_backend # noqa 11 | 12 | # Call use to start using our default backend 13 | -use_gl() 14 | +use_gl('es2') 15 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/wsaccel/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CythonRecipe 2 | 3 | 4 | class WSAccellRecipe(CythonRecipe): 5 | version = '0.6.2' 6 | url = 'https://pypi.python.org/packages/source/w/wsaccel/wsaccel-{version}.tar.gz' 7 | depends = [] 8 | call_hostpython_via_targetpython = False 9 | 10 | 11 | recipe = WSAccellRecipe() 12 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/x3dh/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class X3DHRecipe(PythonRecipe): 5 | name = 'x3dh' 6 | version = '0.5.3' 7 | url = 'https://pypi.python.org/packages/source/X/X3DH/X3DH-{version}.tar.gz' 8 | site_packages_name = 'x3dh' 9 | depends = [ 10 | 'setuptools', 11 | 'cryptography', 12 | 'xeddsa', 13 | ] 14 | patches = ['requires_fix.patch'] 15 | call_hostpython_via_targetpython = False 16 | 17 | 18 | recipe = X3DHRecipe() 19 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/x3dh/requires_fix.patch: -------------------------------------------------------------------------------- 1 | diff -urN X3DH-0.5.3.ori/setup.py X3DH-0.5.3/setup.py 2 | --- X3DH-0.5.3.ori/setup.py 2018-10-28 19:15:16.444766623 +0100 3 | +++ X3DH-0.5.3/setup.py 2018-10-28 19:15:38.028060948 +0100 4 | @@ -24,7 +24,7 @@ 5 | author_email = "tim@cifg.io", 6 | license = "MIT", 7 | packages = find_packages(), 8 | - install_requires = [ "cryptography>=1.7.1", "XEdDSA>=0.4.2" ], 9 | + install_requires = [], 10 | python_requires = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", 11 | zip_safe = True, 12 | classifiers = [ 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/xeddsa/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import CythonRecipe 2 | from pythonforandroid.toolchain import current_directory, shprint 3 | from os.path import join 4 | import sh 5 | 6 | 7 | class XedDSARecipe(CythonRecipe): 8 | name = 'xeddsa' 9 | version = '0.4.4' 10 | url = 'https://pypi.python.org/packages/source/X/XEdDSA/XEdDSA-{version}.tar.gz' 11 | depends = [ 12 | 'setuptools', 13 | 'cffi', 14 | 'pynacl', 15 | ] 16 | patches = ['remove_dependencies.patch'] 17 | call_hostpython_via_targetpython = False 18 | 19 | def build_arch(self, arch): 20 | with current_directory(join(self.get_build_dir(arch.arch))): 21 | env = self.get_recipe_env(arch) 22 | hostpython = sh.Command(self.ctx.hostpython) 23 | shprint( 24 | hostpython, 'ref10/build.py', 25 | _env=env 26 | ) 27 | # the library could be `_crypto_sign.cpython-37m-x86_64-linux-gnu.so` 28 | # or simply `_crypto_sign.so` depending on the platform/distribution 29 | sh.cp('-a', sh.glob('_crypto_sign*.so'), self.ctx.get_site_packages_dir(arch)) 30 | self.install_python_package(arch) 31 | 32 | 33 | recipe = XedDSARecipe() 34 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/xeddsa/remove_dependencies.patch: -------------------------------------------------------------------------------- 1 | diff -urN XEdDSA-0.4.4.ori/setup.py XEdDSA-0.4.4/setup.py 2 | --- XEdDSA-0.4.4.ori/setup.py 2018-09-23 16:08:35.000000000 +0200 3 | +++ XEdDSA-0.4.4/setup.py 2018-10-30 08:21:23.338790184 +0100 4 | @@ -22,9 +22,8 @@ 5 | author_email = "tim@cifg.io", 6 | license = "MIT", 7 | packages = find_packages(), 8 | - install_requires = [ "cffi>=1.9.1", "pynacl>=1.0.1" ], 9 | - setup_requires = [ "cffi>=1.9.1" ], 10 | - cffi_modules = [ os.path.join("ref10", "build.py") + ":ffibuilder" ], 11 | + install_requires = ["pynacl>=1.0.1" ], 12 | + setup_requires = [], 13 | python_requires = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", 14 | include_package_data = True, 15 | zip_safe = False, 16 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/zbar/zbar-0.10-python-crash.patch: -------------------------------------------------------------------------------- 1 | https://sourceforge.net/p/zbar/patches/37/ 2 | 3 | fix from Debian for crashes when importing the python module. 4 | http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702499 5 | 6 | this doesn't happen on some arches as the data naturally ends up with zero 7 | data after the structure, but on some (like arm), it isn't so we crash when 8 | python walks the list. 9 | 10 | --- a/imagescanner.c 11 | +++ b/imagescanner.c 12 | @@ -68,6 +68,7 @@ imagescanner_get_results (zbarImageScanner *self, 13 | 14 | static PyGetSetDef imagescanner_getset[] = { 15 | { "results", (getter)imagescanner_get_results, }, 16 | + { NULL }, 17 | }; 18 | 19 | static PyObject* 20 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/zbarlight/__init__.py: -------------------------------------------------------------------------------- 1 | from os.path import join 2 | from pythonforandroid.recipe import PythonRecipe 3 | 4 | 5 | class ZBarLightRecipe(PythonRecipe): 6 | 7 | version = '2.1' 8 | 9 | url = 'https://github.com/Polyconseil/zbarlight/archive/{version}.tar.gz' # noqa 10 | 11 | call_hostpython_via_targetpython = False 12 | 13 | depends = ['setuptools', 'libzbar'] 14 | 15 | def get_recipe_env(self, arch=None, with_flags_in_cc=True): 16 | env = super().get_recipe_env(arch, with_flags_in_cc) 17 | libzbar = self.get_recipe('libzbar', self.ctx) 18 | libzbar_dir = libzbar.get_build_dir(arch.arch) 19 | env['PYTHON_ROOT'] = self.ctx.get_python_install_dir(arch.arch) 20 | env['CFLAGS'] += ' -I' + join(libzbar_dir, 'include') 21 | env['LDFLAGS'] += ' -L' + join(libzbar_dir, 'zbar', '.libs') 22 | env['LIBS'] = env.get('LIBS', '') + ' -landroid -lzbar' 23 | return env 24 | 25 | 26 | recipe = ZBarLightRecipe() 27 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/zeroconf/__init__.py: -------------------------------------------------------------------------------- 1 | from pythonforandroid.recipe import PythonRecipe 2 | 3 | 4 | class ZeroconfRecipe(PythonRecipe): 5 | name = 'zeroconf' 6 | version = '0.24.5' 7 | url = 'https://pypi.python.org/packages/source/z/zeroconf/zeroconf-{version}.tar.gz' 8 | depends = ['setuptools', 'ifaddr', 'typing;python_version<"3.5"'] 9 | call_hostpython_via_targetpython = False 10 | 11 | 12 | recipe = ZeroconfRecipe() 13 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/zeroconf/patches/setup.patch: -------------------------------------------------------------------------------- 1 | --- zeroconf.orig/setup.py 2015-07-11 21:55:09.000000000 +0200 2 | +++ zeroconf/setup.py 2017-02-23 01:04:13.370018716 +0100 3 | @@ -55,12 +55,5 @@ 4 | 'mDNS', 5 | ], 6 | install_requires=[ 7 | - 'enum-compat', 8 | - # netifaces 0.10.5 has a bug that results in all interfaces' netmasks 9 | - # to be 255.255.255.255 on Windows which breaks things. See: 10 | - # * https://github.com/jstasiak/python-zeroconf/issues/84 11 | - # * https://bitbucket.org/al45tair/netifaces/issues/39/netmask-is-always-255255255255 12 | - 'netifaces<=0.10.4', 13 | - 'six', 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/zope/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from pythonforandroid.recipe import PythonRecipe 3 | from os.path import join 4 | 5 | 6 | class ZopeRecipe(PythonRecipe): 7 | name = 'zope' 8 | version = '4.1.3' 9 | url = 'https://pypi.python.org/packages/source/z/zope.interface/zope.interface-{version}.tar.gz' 10 | 11 | depends = [] 12 | 13 | def get_recipe_env(self, arch): 14 | env = super().get_recipe_env(arch) 15 | 16 | # These are in the old zope recipe but seem like they shouldn't actually be necessary 17 | env['LDFLAGS'] = env['LDFLAGS'] + ' -L{}'.format( 18 | self.ctx.get_libs_dir(arch.arch)) 19 | env['LDSHARED'] = join(self.ctx.root_dir, 'tools', 'liblink') 20 | return env 21 | 22 | def postbuild_arch(self, arch): 23 | super().postbuild_arch(arch) 24 | 25 | # Should do some deleting here 26 | 27 | 28 | recipe = ZopeRecipe() 29 | 30 | # FIXME: @mirko liblink & LD 31 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/zope_interface/fix-init.patch: -------------------------------------------------------------------------------- 1 | The zope.interface module lacks of the __init__.py file in `zope` folder 2 | (once is installed), this patch creates that missing file. This seems to be 3 | caused during the installation process because that file exists in source 4 | files. 5 | diff -Naurp zope.orig/__init__.py zope/__init__.py 6 | --- zope.orig/__init__.py 1970-01-01 01:00:00.000000000 +0100 7 | +++ zope/__init__.py 2019-02-05 11:29:22.666757227 +0100 8 | @@ -0,0 +1 @@ 9 | + 10 | -------------------------------------------------------------------------------- /pythonforandroid/recipes/zope_interface/no_tests.patch: -------------------------------------------------------------------------------- 1 | --- zope_interface/setup.py 2015-10-05 09:35:14.000000000 +0200 2 | +++ b/setup.py 2016-06-15 17:44:35.108263993 +0200 3 | @@ -139,9 +139,8 @@ 4 | "Topic :: Software Development :: Libraries :: Python Modules", 5 | ], 6 | 7 | - packages = ['zope', 'zope.interface', 'zope.interface.tests'], 8 | + packages = ['zope', 'zope.interface'], 9 | package_dir = {'': 'src'}, 10 | cmdclass = {'build_ext': optional_build_ext, 11 | }, 12 | - test_suite = 'zope.interface.tests', 13 | **extra) 14 | -------------------------------------------------------------------------------- /pythonforandroid/tools/biglink: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | import subprocess 6 | 7 | sofiles = [] 8 | 9 | for directory in sys.argv[2:]: 10 | 11 | for fn in os.listdir(directory): 12 | fn = os.path.join(directory, fn) 13 | 14 | if not fn.endswith(".so.o"): 15 | continue 16 | if not os.path.exists(fn[:-2] + ".libs"): 17 | continue 18 | 19 | sofiles.append(fn[:-2]) 20 | 21 | # The raw argument list. 22 | args = [] 23 | 24 | for fn in sofiles: 25 | afn = fn + ".o" 26 | libsfn = fn + ".libs" 27 | 28 | args.append(afn) 29 | with open(libsfn) as fd: 30 | data = fd.read() 31 | args.extend(data.split(" ")) 32 | 33 | unique_args = [] 34 | while args: 35 | a = args.pop() 36 | if a in ('-L', ): 37 | continue 38 | if a not in unique_args: 39 | unique_args.insert(0, a) 40 | unique_args = [x for x in unique_args if x] 41 | 42 | print('Biglink create %s library' % sys.argv[1]) 43 | print('Biglink arguments:') 44 | for arg in unique_args: 45 | print(' %s' % arg) 46 | 47 | args = os.environ['CC'].split() + \ 48 | ['-shared', '-O3', '-o', sys.argv[1]] + \ 49 | unique_args 50 | 51 | sys.exit(subprocess.call(args)) 52 | -------------------------------------------------------------------------------- /pythonforandroid/tools/liblink.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PYTHONPATH= python `dirname $0`/liblink "$@" 4 | -------------------------------------------------------------------------------- /testapps/on_device_unit_tests/test_app/app_service.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import datetime 5 | import threading 6 | import time 7 | 8 | from os import environ 9 | 10 | argument = environ.get('PYTHON_SERVICE_ARGUMENT', '') 11 | print( 12 | 'app_service.py was successfully called with argument: "{}"'.format( 13 | argument, 14 | ), 15 | ) 16 | 17 | next_call = time.time() 18 | next_call_in = 5 # seconds 19 | 20 | 21 | def service_timer(): 22 | global next_call 23 | print('P4a test service: {}'.format(datetime.datetime.now())) 24 | 25 | next_call += next_call_in 26 | threading.Timer(next_call - time.time(), service_timer).start() 27 | 28 | 29 | print('Starting the test service timer...') 30 | service_timer() 31 | -------------------------------------------------------------------------------- /testapps/on_device_unit_tests/test_app/constants.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from os import environ 4 | 5 | RUNNING_ON_ANDROID = "ANDROID_APP_PATH" in environ 6 | 7 | FONT_SIZE_TITLE = 32 if RUNNING_ON_ANDROID else 60 8 | FONT_SIZE_SUBTITLE = 16 if RUNNING_ON_ANDROID else 32 9 | FONT_SIZE_TEXT = 8 if RUNNING_ON_ANDROID else 16 10 | -------------------------------------------------------------------------------- /testapps/on_device_unit_tests/test_app/static/Blanka-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/testapps/on_device_unit_tests/test_app/static/Blanka-Regular.otf -------------------------------------------------------------------------------- /testapps/on_device_unit_tests/test_app/static/colours.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/testapps/on_device_unit_tests/test_app/static/colours.png -------------------------------------------------------------------------------- /testapps/on_device_unit_tests/test_app/static/coloursinv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/testapps/on_device_unit_tests/test_app/static/coloursinv.png -------------------------------------------------------------------------------- /testapps/on_device_unit_tests/test_app/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {% block title %} 9 | Flask on {{ platform }} 10 | {% endblock %} 11 | 12 | 13 | 14 | 15 |
16 |
17 |

Flask on {{ platform }}!

18 | 19 | 25 | 26 |
27 |
28 | 29 |
30 | {% block body %} 31 | {% endblock %} 32 |
33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /testapps/on_device_unit_tests/test_app/templates/page2.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends "base.html" %} 3 | 4 | 5 | {% block body %} 6 | 7 |

Page two

8 | 9 | 10 | 11 |
12 |
13 | Yeah, it seems to work, I would suggest to go to: 14 |
15 |
16 | 17 |
18 |
19 | ...far more interesting ;) 20 |
21 | 22 | {% endblock %} 23 | -------------------------------------------------------------------------------- /testapps/on_device_unit_tests/test_app/templates/unittests.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | 4 | {% block body %} 5 | 6 |

Unittests Page

7 | 8 |
9 | Unittest recipes: {{ tested_recipes }} 10 |
11 | 12 |
13 |
14 | {% for line in unittests_output %} 15 | {{ line }}
16 | {% endfor %} 17 |
18 |
19 | 20 | {% endblock %} -------------------------------------------------------------------------------- /testapps/on_device_unit_tests/test_app/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/testapps/on_device_unit_tests/test_app/tests/__init__.py -------------------------------------------------------------------------------- /testapps/on_device_unit_tests/test_app/tests/mixin.py: -------------------------------------------------------------------------------- 1 | import importlib 2 | 3 | 4 | class PythonTestMixIn(object): 5 | 6 | module_import = None 7 | 8 | def test_import_module(self): 9 | """Test importing the specified Python module name. This import test 10 | is common to all Python modules, it does not test any further 11 | functionality. 12 | """ 13 | self.assertIsNotNone( 14 | self.module_import, 15 | 'module_import is not set (was default None)') 16 | 17 | importlib.import_module(self.module_import) 18 | 19 | def test_run_module(self): 20 | """Import the specified module and do something with it as a minimal 21 | check that it actually works. 22 | 23 | This test fails by default, it must be overridden by every 24 | child test class. 25 | """ 26 | 27 | self.fail('This test must be overridden by {}'.format(self)) 28 | 29 | 30 | print('Defined test case') 31 | -------------------------------------------------------------------------------- /testapps/on_device_unit_tests/test_app/widgets.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from kivy.properties import StringProperty 4 | from kivy.uix.boxlayout import BoxLayout 5 | from kivy.uix.popup import Popup 6 | from kivy.uix.behaviors.button import ButtonBehavior 7 | from kivy.uix.widget import Widget 8 | from kivy.vector import Vector 9 | from tools import load_kv_from 10 | 11 | load_kv_from('widgets.kv') 12 | 13 | 14 | class Spacer20(Widget): 15 | pass 16 | 17 | 18 | class TestImage(BoxLayout): 19 | text = StringProperty() 20 | source = StringProperty() 21 | 22 | 23 | class CircularButton(ButtonBehavior, Widget): 24 | def collide_point(self, x, y): 25 | return Vector(x, y).distance(self.center) <= self.width / 2 26 | 27 | 28 | class ErrorPopup(Popup): 29 | error_text = StringProperty('') 30 | -------------------------------------------------------------------------------- /testapps/setup_testapp_python3_sqlite_openssl.py: -------------------------------------------------------------------------------- 1 | 2 | from distutils.core import setup 3 | from setuptools import find_packages 4 | 5 | options = {'apk': {'requirements': 'requests,peewee,sdl2,pyjnius,kivy,python3', 6 | 'android-api': 27, 7 | 'ndk-api': 21, 8 | 'bootstrap': 'sdl2', 9 | 'dist-name': 'bdisttest_python3_sqlite_openssl_googlendk', 10 | 'ndk-version': '10.3.2', 11 | 'arch': 'armeabi-v7a', 12 | 'permissions': ['INTERNET', 'VIBRATE'], 13 | }} 14 | 15 | setup( 16 | name='testapp_python3_sqlite_openssl_googlendk', 17 | version='1.1', 18 | description='p4a setup.py test', 19 | author='Alexander Taylor', 20 | author_email='alexanderjohntaylor@gmail.com', 21 | packages=find_packages(), 22 | options=options, 23 | package_data={'testapp_sqlite_openssl': ['*.py', '*.png']} 24 | ) 25 | -------------------------------------------------------------------------------- /testapps/setup_vispy.py: -------------------------------------------------------------------------------- 1 | 2 | from distutils.core import setup 3 | from setuptools import find_packages 4 | 5 | options = {'apk': {'debug': None, 6 | 'requirements': 'python3,vispy', 7 | 'blacklist-requirements': 'openssl,sqlite3', 8 | 'android-api': 27, 9 | 'ndk-api': 21, 10 | 'bootstrap': 'empty', 11 | 'ndk-dir': '/home/asandy/android/android-ndk-r17c', 12 | 'dist-name': 'bdisttest', 13 | 'ndk-version': '10.3.2', 14 | 'permission': 'VIBRATE', 15 | }} 16 | 17 | package_data = {'': ['*.py', 18 | '*.png'] 19 | } 20 | 21 | packages = find_packages() 22 | print('packages are', packages) 23 | 24 | setup( 25 | name='testapp_vispy', 26 | version='1.1', 27 | description='p4a setup.py test', 28 | author='Alexander Taylor', 29 | author_email='alexanderjohntaylor@gmail.com', 30 | packages=find_packages(), 31 | options=options, 32 | package_data={'testapp_vispy': ['*.py', '*.png']} 33 | ) 34 | -------------------------------------------------------------------------------- /testapps/testapp_sqlite_openssl/colours.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yunus-ceyhan/python-for-android/602583a63517fedba46d668aa60e853752cd01b6/testapps/testapp_sqlite_openssl/colours.png -------------------------------------------------------------------------------- /tests/recipes/test_freetype.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestFreetypeRecipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.freetype` 8 | """ 9 | recipe_name = "freetype" 10 | sh_command_calls = ["./configure"] 11 | -------------------------------------------------------------------------------- /tests/recipes/test_harfbuzz.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestHarfbuzzRecipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.harfbuzz` 8 | """ 9 | recipe_name = "harfbuzz" 10 | sh_command_calls = ["./configure"] 11 | -------------------------------------------------------------------------------- /tests/recipes/test_jpeg.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForCmakeRecipe 3 | 4 | 5 | class TestJpegRecipe(BaseTestForCmakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.jpeg` 8 | """ 9 | recipe_name = "jpeg" 10 | -------------------------------------------------------------------------------- /tests/recipes/test_leveldb.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForCmakeRecipe 3 | 4 | 5 | class TestLeveldbRecipe(BaseTestForCmakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.leveldb` 8 | """ 9 | recipe_name = "leveldb" 10 | -------------------------------------------------------------------------------- /tests/recipes/test_libbz2.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 4 | 5 | 6 | class TestLibBz2Recipe(BaseTestForMakeRecipe, unittest.TestCase): 7 | """TestCase for recipe :mod:`~pythonforandroid.recipes.libbz2`.""" 8 | recipe_name = "libbz2" 9 | sh_command_calls = [] 10 | 11 | def test_get_library_includes(self): 12 | """ 13 | Test :meth:`~pythonforandroid.recipes.libbz2.get_library_includes`. 14 | """ 15 | self.assertEqual( 16 | self.recipe.get_library_includes(self.arch), 17 | f" -I{self.recipe.get_build_dir(self.arch.arch)}", 18 | ) 19 | 20 | def test_get_library_ldflags(self): 21 | """ 22 | Test :meth:`~pythonforandroid.recipes.libbz2.get_library_ldflags`. 23 | """ 24 | self.assertEqual( 25 | self.recipe.get_library_ldflags(self.arch), 26 | f" -L{self.recipe.get_build_dir(self.arch.arch)}", 27 | ) 28 | 29 | def test_link_libs_flags(self): 30 | """ 31 | Test :meth:`~pythonforandroid.recipes.libbz2.get_library_ldflags`. 32 | """ 33 | self.assertEqual(self.recipe.get_library_libs_flag(), " -lbz2") 34 | -------------------------------------------------------------------------------- /tests/recipes/test_libcurl.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestLibcurlRecipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.libcurl` 8 | """ 9 | recipe_name = "libcurl" 10 | sh_command_calls = ["./configure"] 11 | -------------------------------------------------------------------------------- /tests/recipes/test_libexpat.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestLibexpatRecipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.libexpat` 8 | """ 9 | recipe_name = "libexpat" 10 | sh_command_calls = ["./buildconf.sh", "./configure"] 11 | -------------------------------------------------------------------------------- /tests/recipes/test_libffi.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestLibffiRecipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.libffi` 8 | """ 9 | recipe_name = "libffi" 10 | sh_command_calls = ["./autogen.sh", "autoreconf", "./configure"] 11 | 12 | def test_get_include_dirs(self): 13 | list_of_includes = self.recipe.get_include_dirs(self.arch) 14 | self.assertIsInstance(list_of_includes, list) 15 | self.assertTrue(list_of_includes[0].endswith("include")) 16 | -------------------------------------------------------------------------------- /tests/recipes/test_libgeos.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from unittest import mock 3 | from tests.recipes.recipe_lib_test import BaseTestForCmakeRecipe 4 | 5 | 6 | class TestLibgeosRecipe(BaseTestForCmakeRecipe, unittest.TestCase): 7 | """ 8 | An unittest for recipe :mod:`~pythonforandroid.recipes.libgeos` 9 | """ 10 | recipe_name = "libgeos" 11 | 12 | @mock.patch("pythonforandroid.util.makedirs") 13 | @mock.patch("pythonforandroid.util.chdir") 14 | @mock.patch("pythonforandroid.build.ensure_dir") 15 | @mock.patch("pythonforandroid.archs.find_executable") 16 | def test_build_arch( 17 | self, 18 | mock_find_executable, 19 | mock_ensure_dir, 20 | mock_current_directory, 21 | mock_makedirs, 22 | ): 23 | # We overwrite the base test method because we 24 | # want to avoid any file/directory creation 25 | super().test_build_arch() 26 | # make sure that the mocked methods are actually called 27 | mock_makedirs.assert_called() 28 | -------------------------------------------------------------------------------- /tests/recipes/test_libiconv.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestLibiconvRecipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.libiconv` 8 | """ 9 | recipe_name = "libiconv" 10 | sh_command_calls = ["./configure"] 11 | -------------------------------------------------------------------------------- /tests/recipes/test_libmysqlclient.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from unittest import mock 3 | from tests.recipes.recipe_lib_test import BaseTestForCmakeRecipe 4 | 5 | 6 | class TestLibmysqlclientRecipe(BaseTestForCmakeRecipe, unittest.TestCase): 7 | """ 8 | An unittest for recipe :mod:`~pythonforandroid.recipes.libmysqlclient` 9 | """ 10 | recipe_name = "libmysqlclient" 11 | 12 | @mock.patch("pythonforandroid.recipes.libmysqlclient.sh.rm") 13 | @mock.patch("pythonforandroid.recipes.libmysqlclient.sh.cp") 14 | @mock.patch("pythonforandroid.util.chdir") 15 | @mock.patch("pythonforandroid.build.ensure_dir") 16 | @mock.patch("pythonforandroid.archs.find_executable") 17 | def test_build_arch( 18 | self, 19 | mock_find_executable, 20 | mock_ensure_dir, 21 | mock_current_directory, 22 | mock_sh_cp, 23 | mock_sh_rm, 24 | ): 25 | # We overwrite the base test method because we need 26 | # to mock a little more (`sh.cp` and rmdir) 27 | super().test_build_arch() 28 | # make sure that the mocked methods are actually called 29 | mock_sh_cp.assert_called() 30 | mock_sh_rm.assert_called() 31 | -------------------------------------------------------------------------------- /tests/recipes/test_libogg.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestLiboggRecipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.libogg` 8 | """ 9 | recipe_name = "libogg" 10 | sh_command_calls = ["./configure"] 11 | -------------------------------------------------------------------------------- /tests/recipes/test_libpq.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from unittest import mock 3 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 4 | 5 | 6 | class TestLibpqRecipe(BaseTestForMakeRecipe, unittest.TestCase): 7 | """ 8 | An unittest for recipe :mod:`~pythonforandroid.recipes.libpq` 9 | """ 10 | recipe_name = "libpq" 11 | sh_command_calls = ["./configure"] 12 | 13 | @mock.patch("pythonforandroid.recipes.libpq.sh.cp") 14 | @mock.patch("pythonforandroid.util.chdir") 15 | @mock.patch("pythonforandroid.build.ensure_dir") 16 | @mock.patch("pythonforandroid.archs.find_executable") 17 | def test_build_arch( 18 | self, 19 | mock_find_executable, 20 | mock_ensure_dir, 21 | mock_current_directory, 22 | mock_sh_cp, 23 | ): 24 | # We overwrite the base test method because we need to mock a little 25 | # more with this recipe (`sh.cp`) 26 | super().test_build_arch() 27 | # make sure that the mocked methods are actually called 28 | mock_sh_cp.assert_called() 29 | -------------------------------------------------------------------------------- /tests/recipes/test_libsecp256k1.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestLibsecp256k1Recipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.libsecp256k1` 8 | """ 9 | recipe_name = "libsecp256k1" 10 | sh_command_calls = ["./autogen.sh", "./configure"] 11 | -------------------------------------------------------------------------------- /tests/recipes/test_libshine.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestLibshineRecipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.libshine` 8 | """ 9 | recipe_name = "libshine" 10 | sh_command_calls = ["./bootstrap", "./configure"] 11 | -------------------------------------------------------------------------------- /tests/recipes/test_libvorbis.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from unittest import mock 3 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 4 | 5 | 6 | class TestLibvorbisRecipe(BaseTestForMakeRecipe, unittest.TestCase): 7 | """ 8 | An unittest for recipe :mod:`~pythonforandroid.recipes.libvorbis` 9 | """ 10 | recipe_name = "libvorbis" 11 | sh_command_calls = ["./configure"] 12 | extra_env_flags = {'CFLAGS': 'libogg/include'} 13 | 14 | @mock.patch("pythonforandroid.recipes.libvorbis.sh.cp") 15 | @mock.patch("pythonforandroid.util.chdir") 16 | @mock.patch("pythonforandroid.build.ensure_dir") 17 | @mock.patch("pythonforandroid.archs.find_executable") 18 | def test_build_arch( 19 | self, 20 | mock_find_executable, 21 | mock_ensure_dir, 22 | mock_current_directory, 23 | mock_sh_cp, 24 | ): 25 | # We overwrite the base test method because we need to mock a little 26 | # more with this recipe (`sh.cp`) 27 | super().test_build_arch() 28 | # make sure that the mocked methods are actually called 29 | mock_sh_cp.assert_called() 30 | -------------------------------------------------------------------------------- /tests/recipes/test_libvpx.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestLibVPXRecipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.libvpx` 8 | """ 9 | recipe_name = "libvpx" 10 | sh_command_calls = ["./configure"] 11 | -------------------------------------------------------------------------------- /tests/recipes/test_libx264.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestLibx264Recipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.libx264` 8 | """ 9 | recipe_name = "libx264" 10 | sh_command_calls = ["./configure"] 11 | -------------------------------------------------------------------------------- /tests/recipes/test_libxml2.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestLibxml2Recipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.libxml2` 8 | """ 9 | recipe_name = "libxml2" 10 | sh_command_calls = ["./autogen.sh", "autoreconf", "./configure"] 11 | extra_env_flags = { 12 | "CONFIG_SHELL": "/bin/bash", 13 | "SHELL": "/bin/bash", 14 | } 15 | -------------------------------------------------------------------------------- /tests/recipes/test_libxslt.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestLibxsltRecipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.libxslt` 8 | """ 9 | recipe_name = "libxslt" 10 | sh_command_calls = ["./autogen.sh", "autoreconf", "./configure"] 11 | extra_env_flags = { 12 | "CONFIG_SHELL": "/bin/bash", 13 | "SHELL": "/bin/bash", 14 | "LIBS": "-lxml2 -lz -lm", 15 | } 16 | -------------------------------------------------------------------------------- /tests/recipes/test_png.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForMakeRecipe 3 | 4 | 5 | class TestPngRecipe(BaseTestForMakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.png` 8 | """ 9 | recipe_name = "png" 10 | sh_command_calls = ["./configure"] 11 | -------------------------------------------------------------------------------- /tests/recipes/test_sdl2_mixer.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import RecipeCtx 3 | 4 | 5 | class TestSDL2MixerRecipe(RecipeCtx, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.sdl2_mixer` 8 | """ 9 | recipe_name = "sdl2_mixer" 10 | 11 | def test_get_include_dirs(self): 12 | list_of_includes = self.recipe.get_include_dirs(self.arch) 13 | self.assertIsInstance(list_of_includes, list) 14 | self.assertTrue(list_of_includes[0].endswith("include")) 15 | -------------------------------------------------------------------------------- /tests/recipes/test_snappy.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from tests.recipes.recipe_lib_test import BaseTestForCmakeRecipe 3 | 4 | 5 | class TestSnappyRecipe(BaseTestForCmakeRecipe, unittest.TestCase): 6 | """ 7 | An unittest for recipe :mod:`~pythonforandroid.recipes.snappy` 8 | """ 9 | recipe_name = "snappy" 10 | -------------------------------------------------------------------------------- /tests/test_logger.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from unittest.mock import MagicMock 3 | from pythonforandroid import logger 4 | 5 | 6 | class TestShprint(unittest.TestCase): 7 | 8 | def test_unicode_encode(self): 9 | """ 10 | Makes sure `shprint()` can handle unicode command output. 11 | Running the test with PYTHONIOENCODING=ASCII env would fail, refs: 12 | https://github.com/kivy/python-for-android/issues/1654 13 | """ 14 | expected_command_output = ["foo\xa0bar"] 15 | command = MagicMock() 16 | command.return_value = expected_command_output 17 | output = logger.shprint(command, 'a1', k1='k1') 18 | self.assertEqual(output, expected_command_output) 19 | --------------------------------------------------------------------------------