Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add modifications to support cross-platform builds #542

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

freakboy3742
Copy link
Contributor

Adds four changes to support cross-platform builds:

  1. Adds support for applying patches to downloaded source. If PATCH_DIR is defined, and contains a packagename-version.patch file that matches the package being unpacked, that patch will be applied to the source tree as part of the fetch_unpack step. This is required because some libraries haven't accepted Android and iOS compliance patches (most notably, autotools itself, which has repeatedly ignored/ghosted requests to add support for differentiating iOS simulators from iOS devices).
  2. Adds support for a HOST_CONFIGURE_FLAGS option that is a blanket "include these flags in the invocation of ./configure" option.
  3. Adds support for a HOST_CMAKE_FLAGS option. The analog of (2), but for cmake.
  4. Disables the install of cmake if it's already installed.

I've been able to use these options, plus some small patches, to build Pillow's dependencies for iOS - e.g.:

HOST_CONFIGURE_FLAGS="--disable-shared --enable-static --host=arm64-apple-ios --build=arm64-apple-darwin"
HOST_CMAKE_FLAGS="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0 -DCMAKE_OSX_SYSROOT=<sdk path> -DBUILD_SHARED_LIBS=NO"

I've added a test for the patching option; but I haven't added any new tests for the HOST_CONFIGURE_CFLAGS and HOST_CMAKE_FLAGS options - partly because they're mostly innocuous changes; but mostly because I'm not sure what testing strategy would make sense here. Adding a full iOS build pass seems excessive; but I can't think of an obvious alternative for testing these new capabilities.

@mattip mattip merged commit 74a9795 into multi-build:devel Dec 12, 2024
4 checks passed
@mattip
Copy link
Collaborator

mattip commented Dec 12, 2024

Seems reasonable. Thanks @freakboy3742

@radarhere radarhere mentioned this pull request Dec 12, 2024
@radarhere radarhere changed the title Add modifications to support cross-platform builds. Add modifications to support cross-platform builds Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants