{"id":23503260,"url":"https://github.com/codelv/conda-mobile","last_synced_at":"2025-04-15T21:50:45.665Z","repository":{"id":29875388,"uuid":"123046470","full_name":"codelv/conda-mobile","owner":"codelv","description":"A collection of conda recipes for cross compiling python, libraries, and extensions for iOS and Android","archived":false,"fork":false,"pushed_at":"2024-04-15T22:40:50.000Z","size":604,"stargazers_count":39,"open_issues_count":2,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T05:02:06.576Z","etag":null,"topics":["android","cross-compile","enaml-native","ios","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codelv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"frmdstryr","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-02-26T23:53:12.000Z","updated_at":"2025-03-04T22:03:22.000Z","dependencies_parsed_at":"2022-07-27T23:39:52.073Z","dependency_job_id":null,"html_url":"https://github.com/codelv/conda-mobile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelv%2Fconda-mobile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelv%2Fconda-mobile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelv%2Fconda-mobile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codelv%2Fconda-mobile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codelv","download_url":"https://codeload.github.com/codelv/conda-mobile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868306,"owners_count":21174750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","cross-compile","enaml-native","ios","python"],"created_at":"2024-12-25T08:26:18.885Z","updated_at":"2025-04-15T21:50:45.640Z","avatar_url":"https://github.com/codelv.png","language":"Python","funding_links":["https://github.com/sponsors/frmdstryr"],"categories":[],"sub_categories":[],"readme":"# conda-mobile\n\nA collection of conda recipes for cross compiling libraries, python, and\npython extensions for iOS and Android.\n\n[![status](https://github.com/codelv/conda-mobile/actions/workflows/ci.yml/badge.svg)](https://github.com/codelv/conda-mobile/actions)\n\nThe idea is to be able to easily create a python distribution that works on\nAndroid and iOS by simply using `mamba install android-\u003cpackage\u003e` or\n`mamba install ios-\u003cpackage\u003e` within an environment created for a specific app.\n\nThese recipes have been tested and confirmed working using\n[enaml-native](https://github.com/codelv/enaml-native).\n\nVisit [anaconda.org/codelv/repo](https://anaconda.org/codelv/repo) to see which\npackages are available.\n\n\u003e Note: You can use `conda` or `mamba`, mamba is much faster and now the\npreferred manager.\n\n\n### Targets\n\nCurrently all recipes are built 3.10.2 with optional support for\nopenssl, sqlite, and ctypes for the following targets:\n\n- Android (arm (armeabi-v7a), arm64 (arm64-v8a), x86_64, x86 (i686))\n\nAt one time iPhone builds worked but they are no longer being maintained.\n\n- iPhone (armv7, aarch64)\n- iPhone Simulator (x86_64, i386)\n\n\u003e Note: All libs and extensions are built as unstripped shared modules.\n\u003eAndroid strips libraries automatically.\n\nPackages are installed into the env using a prefix for the target platform as follows\n\n- `android/\u003carch\u003e` - Android recipes for a given arch (arm (v7a), arm64, x86_64, x86)\n- `iphoneos` - iOS recipes for the IPhone (armv7 and arm64)\n- `iphonesimulator` - iOS recipes for the IPhone simulator (x86_64 and i386)\n\n\n\nEach target then contains it's own include, lib, and python folders as follows\n\n```\n# In \u003cenv\u003e/\u003ctarget\u003e (ex micromamba/envs/myapp/iphoneos)\n\n\u003ctarget\u003e/include/ # All headers\n\u003ctarget\u003e/libs/ # All shared libraries files\n\u003ctarget\u003e/python/ # Python stdlib and site-packages\n\n```\n\nRecipes can easily reference these locations using appropriate `CFLAGS` and `LDFLAGS`.\n\n### Building packages\n\nYou should be able to simply install and use prebuilt versions, but if none\nprebuild packages don't exist you'll need to build them.\n\nSee the [conda docs](https://conda.io/docs/user-guide/tasks/build-packages/index.html)\nto get started.\n\nThere are three general recipe types that are generally relevant for conda-mobile:\n\n 1. Pure python packages, no extensions\n 2. Python package with, with extensions\n 3. Non python dependent libs\n\n\nPure python packages are prefixed with `pip-\u003cpackage\u003e` to distinguish them between regular\nconda packages that may exist with the same name. You can create these package (almost)\nautomatically using the [enaml-native-cli](https://github.com/codelv/enaml-native-cli)'s\n`enaml-native make-pip-recipe \u003cpackage\u003e` command.\n\nLibraries with compiled extensions / cython components are split  into separate packages with\nthe prefix `ios-\u003cpackage\u003e` and `android-package`. Otherwise all packages would need to be\nbuilt from mac osx.\n\nTo add a new recipe or to build existing recipes:\n\n1. Install [`micromamba`](https://github.com/mamba-org/mamba#micromamba)\n2. Install [`boa`](https://github.com/mamba-org/boa)\n3. Clone this repo or create your own recipe(s)\n4. Install the android ndk using `sdkmanager \"ndk:23.1.7779620\"` (or update the android-ndk recipe)\n5. Add the requirements to your recipes as needed\n6. Install `build-essential`,  `rename`, `autopoint`, and `texinfo` with apt\n7. Run `boa build \u003crecipe-name\u003e`\n8. Then either add a PR or create your own repos with recipes.\n\n\n#### Recipe requirements\n\nAll recipes that build python extensions MUST include `py310` in the\nbuild string so conda knows which version to install. Add\n`string: py310` under the `build` section.\n\n\u003e Note: This only applies to python extensions. Pure c/c++ libraries do not need to do this!\n\nFor example:\n\n```yaml\n\nrequirements:\n  build:\n    - python\n    - cython\n    - android-ndk\n    - android-python * py310*\n    - android-libc++\n  run:\n    - python # Adding python here make conda append the py27 or py310 build string\n    - android-python  * py310* # Required so it installs the correct pkg for the py version\n    - android-libc++ # Pure c/c++ libraries do not need a \"build\" filter\n\n```\n\nFailure to include python as a run requirement may cause conda to install the incorrect\npackages (ie a 2.7 package may be selected for a 3.10 python build!).\n\nIn order to make your package \"installable\" from other operating systems (ie windows) the\nrecipe must use `noarch:generic` in the `build` parameters as follows.\n\n```yaml\n\nbuild:\n    binary_relocation: False\n    noarch: generic\n\n```\n\nThe `binary_relocation: False` prevents conda from doing it's relocation logic on the\nlibraries created which can cause issues.\n\n\n### Installing packages\n\nThis requires `conda` or `mamba`. The preferred method is to install `micromamba` from\n[`micromamba`](https://github.com/mamba-org/mamba#micromamba).\n\n1. Create an env `micromamba create -n myapp`\n2. Activate it `source activate myapp`\n3. Add this channel `conda config --add channels codelv`\n4. Then install your apps dependencies using the the `android` or `ios` prefix.\nFor example `mamba install android-python`\n\n\nFor pure python packages you can usually auto generate a package using\n`enaml-native make-pip-recipe \u003cpackage\u003e`.\n\nOnce the packages are installed, the build system (gradle, xcode) can then easily grab\nthese libraries from the env for the given target and use them as is.\n\n\u003e Note: An import hook is required to load python extensions from \"non\" standard locations.\n[enaml-native](https://github.com/codelv/enaml-native) supports this.\n\n\n### CI\n\nThe ci script is generated using `python generate-ci.py`. Running it will\nupdate the `ci.yaml` and generate a boa `recipe.yaml` for each package.\n\n\n### Contributing\n\nThis is released under the GPL v3. See the LICENSE included adjacent to this file.\n\nPull requests are always welcome.\n\n\n### Support\n\nIf you need a package or otherwise need support please contact me at [codelv.com](https://codelv.com/contact).\n\nIf you use one of these builds in a commerical application please consider\nsponsoring me or dropping a donation at [codelv.com/donate](https://codelv.com/donate).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelv%2Fconda-mobile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodelv%2Fconda-mobile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelv%2Fconda-mobile/lists"}