Skip to content

Commit

Permalink
Add builder, storage, angle and support for macOS targets (#1)
Browse files Browse the repository at this point in the history
* Build ANGLE for macOS platform (first commit)

* Fix typo
  • Loading branch information
misl6 authored Dec 31, 2023
1 parent cd01a69 commit 90d97d7
Show file tree
Hide file tree
Showing 15 changed files with 978 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build artifacts

on:
push:
pull_request:
create:

jobs:
build:
runs-on: macos-latest

steps:
- name: Checkout angle-builder
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5

- name: Install angle-builder
run: pip install .

- name: Build artifacts for macos-x64
run: angle-builder macos-x64 --artifact-output-folder /angle-builder-output

- name: Build artifacts for macos-arm64
run: angle-builder macos-arm64 --artifact-output-folder /angle-builder-output

- name: Build artifacts for macos-universal
run: angle-builder macos-universal --artifact-output-folder /angle-builder-output

- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: macos-angle-artifacts
path: --artifact-output-folder /angle-builder-output
54 changes: 54 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Temporary and binary files
*~
*.py[cod]
*.so
*.cfg
!.isort.cfg
!setup.cfg
*.orig
*.log
*.pot
__pycache__/*
.cache/*
.*.swp
*/.ipynb_checkpoints/*
.DS_Store

# Project files
.ropeproject
.project
.pydevproject
.settings
.idea
.vscode
tags

# Package files
*.egg
*.eggs/
.installed.cfg
*.egg-info

# Unittest and coverage
htmlcov/*
.coverage
.coverage.*
.tox
junit*.xml
coverage.xml
.pytest_cache/

# Build and docs folder/files
build/*
dist/*
sdist/*
docs/api/*
docs/_rst/*
docs/_build/*
cover/*
MANIFEST

# Per-project virtualenvs
.venv*/
.conda*/
.python-version
7 changes: 7 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
In the interest of fostering an open and welcoming community, we as
contributors and maintainers need to ensure participation in our project and
our sister projects is a harassment-free and positive experience for everyone.
It is vital that all interaction is conducted in a manner conveying respect,
open-mindedness and gratitude.

Please consult the [latest Kivy Code of Conduct](https://github.com/kivy/kivy/blob/master/CODE_OF_CONDUCT.md).
6 changes: 6 additions & 0 deletions CONTACT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Contacting the Kivy Team

If you are looking to contact the Kivy Team (who are responsible for managing
the angle-builder project), including looking for support, please see our
latest [Contact Us](https://github.com/kivy/kivy/blob/master/CONTACT.md)
document.
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Contribution Guidelines

angle-builder is part of the [Kivy](https://kivy.org) ecosystem - a large group of
products used by many thousands of developers for free, but it
is built entirely by the contributions of volunteers. We welcome (and rely on)
users who want to give back to the community by contributing to the project.

Contributions can come in many forms. See the latest
[Contribution Guidelines](https://github.com/kivy/kivy/blob/master/CONTRIBUTING.md)
for how you can help us.
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2010-2023 Kivy Team and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
140 changes: 139 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,139 @@
# angle-builder
# angle-builder

angle-builder is a dedicated tool designed to streamline the build process of the ANGLE library,
a critical component utilized by the Kivy project.

[![Backers on Open Collective](https://opencollective.com/kivy/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/kivy/sponsors/badge.svg)](#sponsors)

## Why angle-builder?

Building the ANGLE library manually can be a time-consuming and resource-intensive task,
demanding substantial disk space and several minutes on a performant laptop.

Recognizing these challenges, we developed `angle-builder` mainly with CI/CD in mind, even though
it can be used on your own development machine.

## Key features

- **Simplified Build Process**: Our tool automates the intricate steps involved in building the ANGLE library, making it easy for developers to integrate into their workflow.
- **Binaries Consolidation for Apple Platforms**: `angle-builder` includes scripts to merge the generated binaries into a single one for Apple platforms, when applicable. This results in a fat .dylib for macOS and an .xcframework for iOS for `-universal` targets.
- **CI/CD Integration**: We use GitHub Actions to build the library and store the binaries for later use. This allows us to avoid the time-consuming and resource-intensive build process on each CI/CD run, or on each developer's machine.

## Installation

Clone the repository and install the package:
```
$ git clone https://github.com/kivy/angle-builder.git
$ cd angle-builder
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install .
```

## Usage

### Building ANGLE via ``angle-builder``

The following targets are available:
- `macos-x64`: Creates a zip file containing `libEGL.dylib`, `libGLESv2.dylib`, the `include` folder, and the `LICENSE` file for Intel-based macs.
- `macos-arm64`: Creates a zip file containing `libEGL.dylib`, `libGLESv2.dylib`, the `include` folder, and the `LICENSE` file for Apple Silicon macs.
- `macos-universal`: Creates a zip file containing `libEGL.dylib`, `libGLESv2.dylib`, the `include` folder, and the `LICENSE` file for Intel-based and Apple Silicon macs, by merging the binaries generated by the `macos-x64` and `macos-arm64` targets.


To build the library, run the following command:
```
$ angle-builder <target>
```

For the list of all the available options, run:
```
$ angle-builder -h
```


## License

angle-builder is [MIT licensed](LICENSE), actively developed by a great
community and is supported by many projects managed by the
[Kivy Organization](https://www.kivy.org/about.html).

## Documentation

[Documentation for this repository]().

## Support

Are you having trouble using angle-builder?
Is there an error you don’t understand? Are you trying to figure out how to use
it? We have volunteers who can help!

The best channels to contact us for support are listed in the latest
[Contact Us](https://github.com/kivy/angle-builder/blob/master/CONTACT.md) document.

## Contributing

angle-builder is part of the [Kivy](https://kivy.org) ecosystem - a large group of
products used by many thousands of developers for free, but it
is built entirely by the contributions of volunteers. We welcome (and rely on)
users who want to give back to the community by contributing to the project.

Contributions can come in many forms. See the latest
[Contribution Guidelines](https://github.com/kivy/angle-builder/blob/master/CONTRIBUTING.md)
for how you can help us.

## Code of Conduct

In the interest of fostering an open and welcoming community, we as
contributors and maintainers need to ensure participation in our project and
our sister projects is a harassment-free and positive experience for everyone.
It is vital that all interaction is conducted in a manner conveying respect,
open-mindedness and gratitude.

Please consult the [latest Code of Conduct](https://github.com/kivy/angle-builder/blob/master/CODE_OF_CONDUCT.md).

## Contributors

This project exists thanks to
[all the people who contribute](https://github.com/kivy/angle-builder/graphs/contributors).
[[Become a contributor](CONTRIBUTING.md)].

<img src="https://contrib.nn.ci/api?repo=kivy/angle-builder&pages=5&no_bot=true&radius=22&cols=18">

## Backers

Thank you to [all of our backers](https://opencollective.com/kivy)!
🙏 [[Become a backer](https://opencollective.com/kivy#backer)]

<img src="https://opencollective.com/kivy/backers.svg?width=890&avatarHeight=44&button=false">

## Sponsors

Special thanks to
[all of our sponsors, past and present](https://opencollective.com/kivy).
Support this project by
[[becoming a sponsor](https://opencollective.com/kivy#sponsor)].

Here are our top current sponsors. Please click through to see their websites,
and support them as they support us.

<!--- See https://github.com/orgs/kivy/discussions/15 for explanation of this code. -->
<a href="https://opencollective.com/kivy/sponsor/0/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/1/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/2/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/3/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/3/avatar.svg"></a>

<a href="https://opencollective.com/kivy/sponsor/4/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/5/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/6/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/7/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/7/avatar.svg"></a>

<a href="https://opencollective.com/kivy/sponsor/8/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/9/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/10/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/11/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/11/avatar.svg"></a>

<a href="https://opencollective.com/kivy/sponsor/12/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/13/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/14/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/kivy/sponsor/15/website" target="_blank"><img src="https://opencollective.com/kivy/sponsor/15/avatar.svg"></a>
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=46.1.0"]
build-backend = "setuptools.build_meta"
69 changes: 69 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[metadata]
name = angle-builder
description = Build and releases ANGLE binaries for different platforms
author = Kivy Team and other contributors
author_email = [email protected]
license = MIT
license_files = LICENSE
long_description = file: README.md
url = https://github.com/kivy/angle-builder
project_urls =
Source = https://github.com/kivy/angle-builder/


platforms = any

classifiers =
Development Status :: 4 - Beta
Programming Language :: Python
Topic :: Software Development :: Build Tools

[options]
zip_safe = False
packages = find_namespace:
include_package_data = True
package_dir =
=src

python_requires = >=3.8

# install_requires =

[options.packages.find]
where = src
exclude =
tests

[options.extras_require]
dev =
setuptools
pytest
pytest-cov

[options.entry_points]
console_scripts =
angle-builder = angle_builder.builder:run

[tool:pytest]
addopts =
--cov angle_builder --cov-report term-missing
--verbose
norecursedirs =
dist
build
.tox
testpaths = tests


[flake8]
# Some sane defaults for the code style checker flake8
max_line_length = 88
extend_ignore = E203, W503
# ^ Black-compatible
# E203 and W503 have edge cases handled by black
exclude =
.tox
build
dist
.eggs
docs/conf.py
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""
Setup file for angle-builder.
Use setup.cfg to configure the project.
"""
from setuptools import setup

if __name__ == "__main__":
setup()
9 changes: 9 additions & 0 deletions src/angle_builder/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from importlib.metadata import PackageNotFoundError, version

try:
dist_name = "angle-builder"
__version__ = version(dist_name)
except PackageNotFoundError: # pragma: no cover
__version__ = "unknown"
finally:
del version, PackageNotFoundError
Loading

0 comments on commit 90d97d7

Please sign in to comment.