{"id":21431615,"url":"https://github.com/suve/fpc-for-android","last_synced_at":"2026-05-22T14:07:24.369Z","repository":{"id":82776015,"uuid":"474320517","full_name":"suve/fpc-for-android","owner":"suve","description":"Container image for building your Pascal code for Android using the Free Pascal Compiler.","archived":false,"fork":false,"pushed_at":"2023-01-09T12:39:23.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-01-23T08:41:26.938Z","etag":null,"topics":["android","android-native","android-ndk","cross-compilation","fpc","free-pascal"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-26T10:59:02.000Z","updated_at":"2023-08-23T13:02:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"b52c3fcb-eab7-430c-8ce9-54f6c2ecd722","html_url":"https://github.com/suve/fpc-for-android","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/suve%2Ffpc-for-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suve%2Ffpc-for-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suve%2Ffpc-for-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suve%2Ffpc-for-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suve","download_url":"https://codeload.github.com/suve/fpc-for-android/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243941753,"owners_count":20372299,"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","android-native","android-ndk","cross-compilation","fpc","free-pascal"],"created_at":"2024-11-22T23:10:42.120Z","updated_at":"2026-05-22T14:07:19.303Z","avatar_url":"https://github.com/suve.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fpc-for-android\n\nAn example repository showing how to build the Free Pascal Compiler\nto allow cross-compilation for Android.\n\n\n## The two Containerfiles\n\nThe repository contains two slightly different Containerfiles:\n\n- The default `Containerfile` takes a very from-the-ground-up approach,\n  basing on the Ubuntu 22.04 LTS container image. A copy of the Android NDK\n  is required for the build. The FPC cross-compiler is installed system-wide.\n  The end result is a smaller, if more bare-bones, image. Most notably,\n  it includes only the Android NDK, and not the SDK - meaning that while\n  you can use it to compile code, you can't actually create an `.apk`.\n\n- The alternative `Containerfile-cimg` is based on one of the\n  [Circle CI for Android](https://hub.docker.com/r/cimg/android) container\n  images. The FPC cross-compiler is installed only for the default user.\n  The end result is a more comprehensive, if bloated, image.\n\n\n## Pre-built container images\n\nPre-built container images are available for download from\n[Docker Hub](https://hub.docker.com/repository/docker/suvepl/fpc-for-android).\n\n- The default image: `docker.io/suvepl/fpc-for-android:bare`\n\n- The `cimg` image: `docker.io/suvepl/fpc-for-android:cimg`\n\nFor both of these images, the target Android API level is set to 21\n(Android 5.0 \"Lollipop\").\n\n\n## Building the images yourself\n\nTo build the container images, you'll need the following:\n- Android Native Development Kit r21d (not needed for the `-cimg` image)\n- Buildah / Docker\n- Free Pascal Compiler v3.2.2 sources\n\n\n### Android tools\n\nYou can download the Android Native Development Kit from the \n[Android developer portal](https://developer.android.com/ndk/downloads/). \n\nMake sure to grab the r21d release, as - for the time being - the build\nscripts do not support newer versions.\n\n\n### Free Pascal Compiler source code\n\nYou can download the FPC source code from the\n[FPC downloads page](https://www.freepascal.org/down/source/sources.html).\nMake sure to grab the `fpcbuild-X.Y.Z` archive, **not** `fpc-source`.\n\n\n### Picking the target Android API level\n\nBefore you can proceed, you may want to take a moment to think about which\n[Android API level](https://en.wikipedia.org/wiki/Android_version_history#Overview)\n(i.e. NDK platform) you'll want to target. You need to make this decision now,\nfor two reasons:\n\n1. FPC itself is built against a specific API level;\n   in order to use a different level, the compiler must be rebuilt.\n2. For the default image, the build process includes a \"slimming\" script\n   that removes any files pertaining to unused API levels.\n\nIf you do not specify a level, the default value is `21`.\n\n\n### Performing the build\n\nAssuming you've downloaded both the Android NDK and FPC sources\nand placed them in the same directory as the `Containerfile`,\nall that's left to do now is:\n```\n$ buildah bud --build-arg ANDROID_API=LEVEL -t fpc-android ./\n```\nOr, if you're using Docker:\n```\n$ docker build --build-arg ANDROID_API=LEVEL -t fpc-android ./\n```\n\nThe build process can be rather lengthy,\nas it builds the Free Pascal Compiler four times over:\n\n1. First, it builds an `x86_64-linux` compiler.\nThis is used to ensure that you'll be using the downloaded version,\nwith any patches bundled within this repository applied,\nand not the version found in the Ubuntu repository (which may be older).\nThis step also compiles all the\n[Run-Time Library](https://www.freepascal.org/docs-html/current/rtl/index.html)\nand [Free Component Library](https://www.freepascal.org/docs-html/current/fcl/index.html)\nunits redistributed along with the compiler.\n\n2. Second, a cross-compiler for `aarch64-android` (64-bit ARM) is built,\nalong with the RTL and FCL units.\n\n3. Third, the compiler + RTL + FCL combo is built for `arm-android` (32-bit ARM).\n\n4. Lastly, the same is done for `x86_64-android`. The x86\\_64 Android target\nis mostly useful for debugging your apps in the Android Simulator.\n\nNote that the `x86-android` (for 32-bit Intel/AMD processors)\ntarget is \\*NOT\\* included here.\n\n\n## Licensing\n\nThe contents of this repository are subject to the zlib licence.\nFor the full text of the licence, consult the `LICENCE` file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuve%2Ffpc-for-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuve%2Ffpc-for-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuve%2Ffpc-for-android/lists"}