Compare commits
28 Commits
openssl3/v
...
nanosvg/v0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53271a60fa | ||
|
|
8d9b59b9d0 | ||
|
|
950d288e77 | ||
|
|
331d94a683 | ||
|
|
2e9aed768a | ||
|
|
65674ad817 | ||
|
|
61379f09ec | ||
|
|
21bb9ab18e | ||
|
|
2341b89849 | ||
|
|
7d158432af | ||
|
|
c81badf4a5 | ||
|
|
122939fdf2 | ||
|
|
9690fd5160 | ||
|
|
c835b206c6 | ||
|
|
70b6bf1c40 | ||
|
|
d67b3e906e | ||
|
|
408cc4b949 | ||
|
|
9e9a5b56ac | ||
|
|
e46683e1fc | ||
|
|
db4664139a | ||
|
|
8472bcb091 | ||
|
|
357d36a61d | ||
|
|
ae529b6818 | ||
|
|
a3eeb36555 | ||
|
|
57b632b00a | ||
|
|
e35ea9f690 | ||
|
|
32c2a425b5 | ||
|
|
62d18088cc |
105
.github/workflows/ci.yml
vendored
Normal file
105
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: build (${{ matrix.platform }})
|
||||||
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- platform: linux-x86_64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
- platform: linux-arm64
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
- platform: macos
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
key: build-cache-v2-${{ matrix.platform }}-${{ hashFiles('build.sh', 'setup.sh', '*/pyproject.toml', '*/setup.py', '*/build.sh') }}
|
||||||
|
restore-keys: build-cache-v2-${{ matrix.platform }}-
|
||||||
|
path: |
|
||||||
|
.uv-cache
|
||||||
|
*/*/install
|
||||||
|
*/*/toolchain
|
||||||
|
*/*/bin
|
||||||
|
*/*-src
|
||||||
|
*/build
|
||||||
|
- name: Build wheels
|
||||||
|
env:
|
||||||
|
MANYLINUX: ${{ runner.os == 'Linux' && '1' || '0' }}
|
||||||
|
UV_CACHE_DIR: ${{ github.workspace }}/.uv-cache
|
||||||
|
BUILD_SH_REUSE_MANYLINUX_ARTIFACTS: "1"
|
||||||
|
run: ./build.sh
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: wheels-${{ matrix.platform }}
|
||||||
|
path: dist/*.whl
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: test distro (${{ matrix.image }})
|
||||||
|
needs: build
|
||||||
|
runs-on: ${{ matrix.runs-on }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- image: debian:bookworm-slim
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
- image: ubuntu:24.04
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
- image: ubuntu:20.04
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
- image: fedora:41
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
- image: archlinux:latest
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
- image: opensuse/tumbleweed:latest
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
- image: ghcr.io/void-linux/void-glibc:latest
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
- image: debian:bookworm-slim
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
# TODO: add musl test
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ contains(matrix.runs-on, 'arm') && 'wheels-linux-arm64' || 'wheels-linux-x86_64' }}
|
||||||
|
path: dist/
|
||||||
|
- run: ./test_wheels_in_image.sh "${{ matrix.image }}"
|
||||||
|
|
||||||
|
publish:
|
||||||
|
name: publish wheels
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||||
|
needs: [build, test]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
pattern: wheels-*
|
||||||
|
merge-multiple: true
|
||||||
|
path: dist
|
||||||
|
- uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
key: build-cache-v2-${{ matrix.platform }}-${{ hashFiles('build.sh', 'setup.sh', '*/pyproject.toml', '*/setup.py', '*/build.sh') }}
|
||||||
|
restore-keys: build-cache-v2-${{ matrix.platform }}-
|
||||||
|
path: |
|
||||||
|
.uv-cache
|
||||||
|
*/*/install
|
||||||
|
*/*/toolchain
|
||||||
|
*/*/bin
|
||||||
|
- name: Publish wheels and shims
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: ./release.sh --publish-only
|
||||||
212
.github/workflows/release.yml
vendored
212
.github/workflows/release.yml
vendored
@@ -1,212 +0,0 @@
|
|||||||
name: release wheels
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [master]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: build - ${{ matrix.runs-on }}
|
|
||||||
runs-on: ${{ matrix.runs-on }}
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
runs-on: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: "3.14"
|
|
||||||
|
|
||||||
- name: Install build dependencies
|
|
||||||
run: ./setup.sh
|
|
||||||
|
|
||||||
- name: build and release wheels
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
pip install build
|
|
||||||
|
|
||||||
for toml in */pyproject.toml; do
|
|
||||||
[ -f "$toml" ] || continue
|
|
||||||
pkg="$(dirname "$toml")"
|
|
||||||
version=$(python3 -c "import tomllib; print(tomllib.load(open('$toml', 'rb'))['project']['version'])")
|
|
||||||
tag="${pkg}/v${version}"
|
|
||||||
|
|
||||||
echo "========================================="
|
|
||||||
echo "Building: $pkg v$version"
|
|
||||||
echo "========================================="
|
|
||||||
python -m build --wheel "$pkg"
|
|
||||||
|
|
||||||
whl=$(ls "$pkg"/dist/*.whl)
|
|
||||||
echo "Uploading: $whl"
|
|
||||||
if gh release view "$tag" --repo "$GITHUB_REPOSITORY" &>/dev/null; then
|
|
||||||
gh release upload "$tag" "$whl" --repo "$GITHUB_REPOSITORY" --clobber
|
|
||||||
else
|
|
||||||
gh release create "$tag" "$whl" \
|
|
||||||
--repo "$GITHUB_REPOSITORY" \
|
|
||||||
--title "$pkg v$version" \
|
|
||||||
--notes "Platform wheels for $pkg $version"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
publish-shims:
|
|
||||||
name: publish releases branch
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: build and push shim packages
|
|
||||||
run: |
|
|
||||||
REPO_URL="https://github.com/${GITHUB_REPOSITORY}"
|
|
||||||
|
|
||||||
# set up a temp dir for the releases branch
|
|
||||||
tmp="$(mktemp -d)"
|
|
||||||
trap 'rm -rf "$tmp"' EXIT
|
|
||||||
|
|
||||||
for toml in */pyproject.toml; do
|
|
||||||
[ -f "$toml" ] || continue
|
|
||||||
pkg="$(dirname "$toml")"
|
|
||||||
version=$(python3 -c "import tomllib; print(tomllib.load(open('$toml', 'rb'))['project']['version'])")
|
|
||||||
tag="${pkg}/v${version}"
|
|
||||||
module="${pkg//-/_}"
|
|
||||||
# detect the package-data directory (e.g. "toolchain" or "install")
|
|
||||||
datadir=$(python3 -c "
|
|
||||||
import tomllib
|
|
||||||
t = tomllib.load(open('$toml', 'rb'))
|
|
||||||
pat = t.get('tool', {}).get('setuptools', {}).get('package-data', {}).get('$module', [''])[0]
|
|
||||||
print(pat.split('/')[0])
|
|
||||||
")
|
|
||||||
description=$(python3 -c "import tomllib; print(tomllib.load(open('$toml', 'rb'))['project']['description'])")
|
|
||||||
|
|
||||||
echo "========================================="
|
|
||||||
echo "Creating shim: $pkg v$version (datadir=$datadir)"
|
|
||||||
echo "========================================="
|
|
||||||
|
|
||||||
pkg_dir="$tmp/$pkg"
|
|
||||||
mod_dir="$pkg_dir/$module"
|
|
||||||
mkdir -p "$mod_dir"
|
|
||||||
|
|
||||||
# copy __init__.py from source
|
|
||||||
cp "$pkg/$module/__init__.py" "$mod_dir/"
|
|
||||||
|
|
||||||
cat > "$pkg_dir/pyproject.toml" << TOML
|
|
||||||
[build-system]
|
|
||||||
requires = ["setuptools>=64", "wheel"]
|
|
||||||
build-backend = "setuptools.build_meta"
|
|
||||||
|
|
||||||
[project]
|
|
||||||
name = "$pkg"
|
|
||||||
version = "$version"
|
|
||||||
description = "$description (pre-built)"
|
|
||||||
requires-python = ">=3.8"
|
|
||||||
|
|
||||||
[project.scripts]
|
|
||||||
$(grep -A100 '^\[project\.scripts\]' "$pkg/pyproject.toml" | tail -n +2 | sed '/^\[/q' | grep -v '^\[')
|
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
|
||||||
include = ["${module}*"]
|
|
||||||
|
|
||||||
[tool.setuptools.package-data]
|
|
||||||
$module = ["${datadir}/**/*"]
|
|
||||||
TOML
|
|
||||||
|
|
||||||
# setup.py — downloads pre-built wheel from GH releases and extracts data
|
|
||||||
cat > "$pkg_dir/setup.py" << 'SETUP'
|
|
||||||
import os
|
|
||||||
import platform
|
|
||||||
import zipfile
|
|
||||||
from io import BytesIO
|
|
||||||
from urllib.request import urlopen
|
|
||||||
|
|
||||||
from setuptools.command.build_py import build_py
|
|
||||||
|
|
||||||
REPO_URL = "REPO_URL_PLACEHOLDER"
|
|
||||||
TAG = "TAG_PLACEHOLDER"
|
|
||||||
VERSION = "VERSION_PLACEHOLDER"
|
|
||||||
MODULE = "MODULE_PLACEHOLDER"
|
|
||||||
DATADIR = "DATADIR_PLACEHOLDER"
|
|
||||||
|
|
||||||
PLATFORM_MAP = {
|
|
||||||
("Linux", "x86_64"): "linux_x86_64",
|
|
||||||
("Linux", "aarch64"): "linux_aarch64",
|
|
||||||
("Darwin", "arm64"): "macosx_11_0_arm64",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class InstallPrebuilt(build_py):
|
|
||||||
"""Download pre-built wheel from GitHub Releases and extract binaries."""
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
data_dir = os.path.join(pkg_dir, MODULE, DATADIR)
|
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(data_dir, "bin")):
|
|
||||||
key = (platform.system(), platform.machine())
|
|
||||||
plat = PLATFORM_MAP.get(key)
|
|
||||||
if plat is None:
|
|
||||||
raise RuntimeError(f"unsupported platform: {key}")
|
|
||||||
|
|
||||||
whl_name = f"{MODULE}-{VERSION}-py3-none-{plat}.whl"
|
|
||||||
url = f"{REPO_URL}/releases/download/{TAG}/{whl_name}"
|
|
||||||
|
|
||||||
print(f"Downloading {url} ...")
|
|
||||||
data = urlopen(url).read()
|
|
||||||
|
|
||||||
print(f"Extracting {DATADIR} ...")
|
|
||||||
with zipfile.ZipFile(BytesIO(data)) as zf:
|
|
||||||
prefix = f"{MODULE}/{DATADIR}/"
|
|
||||||
alt_prefix = f"{MODULE}-{VERSION}.data/purelib/{MODULE}/{DATADIR}/"
|
|
||||||
for info in zf.infolist():
|
|
||||||
for p in (prefix, alt_prefix):
|
|
||||||
if info.filename.startswith(p):
|
|
||||||
rel = info.filename[len(p):]
|
|
||||||
if not rel:
|
|
||||||
continue
|
|
||||||
dest = os.path.join(data_dir, rel)
|
|
||||||
if info.is_dir():
|
|
||||||
os.makedirs(dest, exist_ok=True)
|
|
||||||
else:
|
|
||||||
os.makedirs(os.path.dirname(dest), exist_ok=True)
|
|
||||||
with open(dest, "wb") as f:
|
|
||||||
f.write(zf.read(info))
|
|
||||||
if info.external_attr >> 16 & 0o111:
|
|
||||||
os.chmod(dest, 0o755)
|
|
||||||
break
|
|
||||||
|
|
||||||
super().run()
|
|
||||||
|
|
||||||
|
|
||||||
def setup():
|
|
||||||
from setuptools import setup as _setup
|
|
||||||
_setup(cmdclass={"build_py": InstallPrebuilt})
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
setup()
|
|
||||||
SETUP
|
|
||||||
|
|
||||||
# template in the actual values
|
|
||||||
sed -i "s|REPO_URL_PLACEHOLDER|${REPO_URL}|" "$pkg_dir/setup.py"
|
|
||||||
sed -i "s|TAG_PLACEHOLDER|${tag}|" "$pkg_dir/setup.py"
|
|
||||||
sed -i "s|VERSION_PLACEHOLDER|${version}|" "$pkg_dir/setup.py"
|
|
||||||
sed -i "s|MODULE_PLACEHOLDER|${module}|" "$pkg_dir/setup.py"
|
|
||||||
sed -i "s|DATADIR_PLACEHOLDER|${datadir}|" "$pkg_dir/setup.py"
|
|
||||||
done
|
|
||||||
|
|
||||||
# push to releases branch
|
|
||||||
cd "$tmp"
|
|
||||||
git init
|
|
||||||
git checkout -b releases
|
|
||||||
git add .
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git commit -m "update shim packages"
|
|
||||||
git remote add origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
|
|
||||||
git push -f origin releases
|
|
||||||
92
.github/workflows/test.yml
vendored
92
.github/workflows/test.yml
vendored
@@ -1,92 +0,0 @@
|
|||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [master]
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: build (${{ matrix.platform }})
|
|
||||||
runs-on: ${{ matrix.runs-on }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- platform: macos
|
|
||||||
runs-on: macos-latest
|
|
||||||
- platform: linux-x86_64
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
- platform: linux-arm64
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: "3.14"
|
|
||||||
- name: Install build dependencies
|
|
||||||
run: ./setup.sh
|
|
||||||
- name: Build wheels
|
|
||||||
run: |
|
|
||||||
for pkg in */pyproject.toml; do
|
|
||||||
pip wheel "./$(dirname "$pkg")" --no-deps --wheel-dir dist/
|
|
||||||
done
|
|
||||||
- name: Smoketest locally
|
|
||||||
run: bash smoketest.sh dist/
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: wheels-${{ matrix.platform }}
|
|
||||||
path: dist/*.whl
|
|
||||||
|
|
||||||
test:
|
|
||||||
name: test (${{ matrix.image }})
|
|
||||||
needs: build
|
|
||||||
runs-on: ${{ matrix.runs-on }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
# test on vanilla linux images
|
|
||||||
- image: debian:bookworm-slim
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
- image: ubuntu:24.04
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
- image: fedora:41
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
- image: archlinux:latest
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
# TODO: make musl work
|
|
||||||
#- image: alpine:3.21
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
- image: opensuse/tumbleweed:latest
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
- image: ghcr.io/void-linux/void-glibc:latest
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
- image: debian:bookworm-slim
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: wheels-${{ contains(matrix.runs-on, 'arm') && 'linux-arm64' || 'linux-x86_64' }}
|
|
||||||
path: wheels
|
|
||||||
- name: build docker
|
|
||||||
run: |
|
|
||||||
docker build -t smoketest -f - . <<'DOCKERFILE'
|
|
||||||
FROM ${{ matrix.image }}
|
|
||||||
RUN if command -v apk >/dev/null; then \
|
|
||||||
apk add --no-cache python3 py3-pip bash; \
|
|
||||||
elif command -v apt-get >/dev/null; then \
|
|
||||||
apt-get update && apt-get install -y --no-install-recommends python3 python3-pip python3-venv; \
|
|
||||||
elif command -v dnf >/dev/null; then \
|
|
||||||
dnf install -y python3 python3-pip; \
|
|
||||||
elif command -v pacman >/dev/null; then \
|
|
||||||
pacman -Sy --noconfirm python python-pip; \
|
|
||||||
elif command -v zypper >/dev/null; then \
|
|
||||||
zypper install -y python3 python3-pip; \
|
|
||||||
elif command -v xbps-install >/dev/null; then \
|
|
||||||
xbps-install -Sy python3 python3-pip bash; \
|
|
||||||
fi
|
|
||||||
DOCKERFILE
|
|
||||||
- name: ./smoketest.sh
|
|
||||||
run: docker run --rm -v "$PWD:/work" -w /work smoketest bash smoketest.sh wheels/
|
|
||||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -2,6 +2,7 @@
|
|||||||
repo/
|
repo/
|
||||||
.venv/
|
.venv/
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
uv.lock
|
||||||
|
|
||||||
# agents
|
# agents
|
||||||
.claude/
|
.claude/
|
||||||
@@ -13,10 +14,16 @@ build/
|
|||||||
dist/
|
dist/
|
||||||
install/
|
install/
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
|
*-src/
|
||||||
|
*.tar.gz
|
||||||
|
*.tar.xz
|
||||||
|
*.tgz
|
||||||
|
Python-*/
|
||||||
|
ncurses-*/
|
||||||
|
arm-gnu-toolchain-*/
|
||||||
|
|
||||||
# downloaded toolchain binaries
|
# downloaded toolchain binaries
|
||||||
gcc-arm-none-eabi/gcc_arm_none_eabi/toolchain/
|
gcc-arm-none-eabi/gcc_arm_none_eabi/toolchain/
|
||||||
|
|
||||||
|
|
||||||
# downloaded git-lfs
|
# downloaded git-lfs
|
||||||
git-lfs/git_lfs/bin/
|
git-lfs/git_lfs/bin/
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -1,6 +1,6 @@
|
|||||||
# dependencies
|
# dependencies
|
||||||
|
|
||||||
a central repo for managing and [vendoring](https://htmx.org/essays/vendoring/) third party dependencies for all comma projects.
|
a central repo for [vendoring](https://htmx.org/essays/vendoring/) all third party dependencies for comma projects.
|
||||||
|
|
||||||
since all our projects are Python, we wrap each vendored dependency as a pip package. `git clone` and `uv sync` is all you need.
|
since all our projects are Python, we wrap each vendored dependency as a pip package. `git clone` and `uv sync` is all you need.
|
||||||
|
|
||||||
@@ -9,8 +9,7 @@ motivations for this approach
|
|||||||
- `apt-get` updates its packages on a schedule we don't control
|
- `apt-get` updates its packages on a schedule we don't control
|
||||||
- `apt-get` package versions don't match `brew` versions
|
- `apt-get` package versions don't match `brew` versions
|
||||||
- `apt-get` doesn't come with Arch Linux
|
- `apt-get` doesn't come with Arch Linux
|
||||||
- `apt-get` doesn't always have the exact package we need
|
- `apt-get` packages come with more than we need, bloating our project footprint
|
||||||
- `apt-get` packages are often bloated
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
this critically adds friction to adding dependencies to our project
|
this critically adds friction to adding dependencies to our project
|
||||||
@@ -27,6 +26,7 @@ we target the following platforms:
|
|||||||
|
|
||||||
contributions welcome for other platforms!
|
contributions welcome for other platforms!
|
||||||
|
|
||||||
|
<!--
|
||||||
## packages
|
## packages
|
||||||
|
|
||||||
| package | description |
|
| package | description |
|
||||||
@@ -36,13 +36,19 @@ contributions welcome for other platforms!
|
|||||||
| ffmpeg | video encode and decode for openpilot |
|
| ffmpeg | video encode and decode for openpilot |
|
||||||
| git-lfs | for tracking large files in openpilot |
|
| git-lfs | for tracking large files in openpilot |
|
||||||
| zeromq | bridging the openpilot IPC between different hosts |
|
| zeromq | bridging the openpilot IPC between different hosts |
|
||||||
|
-->
|
||||||
|
|
||||||
## usage
|
## usage
|
||||||
|
|
||||||
```python
|
```python
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
# use the releases branch for pre-built wheels
|
||||||
"capnproto @ git+https://github.com/commaai/dependencies.git@releases#subdirectory=capnproto",
|
"capnproto @ git+https://github.com/commaai/dependencies.git@releases#subdirectory=capnproto",
|
||||||
"ffmpeg @ git+https://github.com/commaai/dependencies.git@releases#subdirectory=ffmpeg",
|
"ffmpeg @ git+https://github.com/commaai/dependencies.git@releases#subdirectory=ffmpeg",
|
||||||
|
|
||||||
|
# use the master branch to build the package on pip install
|
||||||
|
"capnproto @ git+https://github.com/commaai/dependencies.git@master#subdirectory=capnproto",
|
||||||
|
"ffmpeg @ git+https://github.com/commaai/dependencies.git@master#subdirectory=ffmpeg",
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
103
_shim_setup.py
Normal file
103
_shim_setup.py
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
"""Shim setup.py: downloads pre-built wheels from GitHub Releases at install time."""
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
|
import time
|
||||||
|
import zipfile
|
||||||
|
from io import BytesIO
|
||||||
|
from urllib.error import URLError
|
||||||
|
from urllib.request import urlopen
|
||||||
|
|
||||||
|
try:
|
||||||
|
import tomllib
|
||||||
|
except ImportError:
|
||||||
|
import tomli as tomllib
|
||||||
|
|
||||||
|
from setuptools import setup
|
||||||
|
from setuptools.command.build_py import build_py
|
||||||
|
|
||||||
|
_HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
with open(os.path.join(_HERE, "pyproject.toml"), "rb") as _f:
|
||||||
|
_cfg = tomllib.load(_f)
|
||||||
|
|
||||||
|
REPO_URL = _cfg["tool"]["shim"]["repo_url"]
|
||||||
|
TAG = _cfg["tool"]["shim"]["tag"]
|
||||||
|
DATADIR = _cfg["tool"]["shim"]["datadir"]
|
||||||
|
VERSION = _cfg["project"]["version"]
|
||||||
|
MODULE = _cfg["project"]["name"].replace("-", "_")
|
||||||
|
|
||||||
|
PLATFORM_MAP = {
|
||||||
|
("Linux", "x86_64"): "linux_x86_64",
|
||||||
|
("Linux", "aarch64"): "linux_aarch64",
|
||||||
|
("Darwin", "arm64"): "macosx_11_0_arm64",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class InstallPrebuilt(build_py):
|
||||||
|
def run(self):
|
||||||
|
module_dir = os.path.join(_HERE, MODULE)
|
||||||
|
data_dir = os.path.join(module_dir, DATADIR)
|
||||||
|
|
||||||
|
if not os.path.exists(os.path.join(data_dir, "bin")):
|
||||||
|
key = (platform.system(), platform.machine())
|
||||||
|
plat = PLATFORM_MAP.get(key)
|
||||||
|
if plat is None:
|
||||||
|
raise RuntimeError(f"unsupported platform: {key}")
|
||||||
|
|
||||||
|
whl_name = f"{MODULE}-{VERSION}-py3-none-{plat}.whl"
|
||||||
|
url = f"{REPO_URL}/releases/download/{TAG}/{whl_name}"
|
||||||
|
|
||||||
|
print(f"Downloading {url} ...")
|
||||||
|
for attempt in range(3):
|
||||||
|
try:
|
||||||
|
raw = urlopen(url, timeout=60).read()
|
||||||
|
break
|
||||||
|
except (URLError, OSError) as e:
|
||||||
|
if attempt == 2:
|
||||||
|
raise
|
||||||
|
wait = 2 ** attempt
|
||||||
|
print(f"Download failed ({e}), retrying in {wait}s ...")
|
||||||
|
time.sleep(wait)
|
||||||
|
|
||||||
|
print(f"Extracting {DATADIR} ...")
|
||||||
|
with zipfile.ZipFile(BytesIO(raw)) as zf:
|
||||||
|
prefix = f"{MODULE}/{DATADIR}/"
|
||||||
|
alt_prefix = f"{MODULE}-{VERSION}.data/purelib/{MODULE}/{DATADIR}/"
|
||||||
|
for info in zf.infolist():
|
||||||
|
for p in (prefix, alt_prefix):
|
||||||
|
if info.filename.startswith(p):
|
||||||
|
rel = info.filename[len(p):]
|
||||||
|
if not rel:
|
||||||
|
continue
|
||||||
|
dest = os.path.join(data_dir, rel)
|
||||||
|
if info.is_dir():
|
||||||
|
os.makedirs(dest, exist_ok=True)
|
||||||
|
else:
|
||||||
|
os.makedirs(os.path.dirname(dest), exist_ok=True)
|
||||||
|
with open(dest, "wb") as f:
|
||||||
|
f.write(zf.read(info))
|
||||||
|
if info.external_attr >> 16 & 0o111:
|
||||||
|
os.chmod(dest, 0o755)
|
||||||
|
break
|
||||||
|
|
||||||
|
# Also extract compiled extension modules (.so)
|
||||||
|
ext_prefix = f"{MODULE}/"
|
||||||
|
ext_alt_prefix = f"{MODULE}-{VERSION}.data/purelib/{MODULE}/"
|
||||||
|
for info in zf.infolist():
|
||||||
|
if not info.filename.endswith('.so'):
|
||||||
|
continue
|
||||||
|
for p in (ext_prefix, ext_alt_prefix):
|
||||||
|
if info.filename.startswith(p):
|
||||||
|
rel = info.filename[len(p):]
|
||||||
|
if rel and '/' not in rel:
|
||||||
|
dest = os.path.join(module_dir, rel)
|
||||||
|
os.makedirs(os.path.dirname(dest), exist_ok=True)
|
||||||
|
with open(dest, "wb") as f:
|
||||||
|
f.write(zf.read(info))
|
||||||
|
if info.external_attr >> 16 & 0o111:
|
||||||
|
os.chmod(dest, 0o755)
|
||||||
|
break
|
||||||
|
|
||||||
|
super().run()
|
||||||
|
|
||||||
|
|
||||||
|
setup(cmdclass={"build_py": InstallPrebuilt})
|
||||||
81
build.sh
Executable file
81
build.sh
Executable file
@@ -0,0 +1,81 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||||
|
cd "$ROOT_DIR"
|
||||||
|
|
||||||
|
if [[ $# -gt 0 ]]; then
|
||||||
|
echo "usage: MANYLINUX=1 ./build.sh" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
USE_MANYLINUX="${MANYLINUX:-0}"
|
||||||
|
|
||||||
|
if [[ -z "${BUILD_SH_IN_MANYLINUX:-}" ]] && ! command -v uv >/dev/null 2>&1; then
|
||||||
|
./setup.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$USE_MANYLINUX" == "1" && -z "${BUILD_SH_IN_MANYLINUX:-}" ]]; then
|
||||||
|
UV_BIN="$(command -v uv)"
|
||||||
|
docker run --rm \
|
||||||
|
-e BUILD_SH_IN_MANYLINUX=1 \
|
||||||
|
-e BUILD_SH_REUSE_MANYLINUX_ARTIFACTS="${BUILD_SH_REUSE_MANYLINUX_ARTIFACTS:-}" \
|
||||||
|
-e HOME=/tmp \
|
||||||
|
-e UV_CACHE_DIR=/work/.uv-cache \
|
||||||
|
-e UV_PYTHON=/opt/python/cp312-cp312/bin/python3 \
|
||||||
|
-v "$ROOT_DIR:/work" \
|
||||||
|
-v "$UV_BIN:/usr/local/bin/uv:ro" \
|
||||||
|
-w /work \
|
||||||
|
"quay.io/pypa/manylinux_2_28_$(uname -m)" \
|
||||||
|
bash build.sh
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${BUILD_SH_IN_MANYLINUX:-}" ]]; then
|
||||||
|
export PATH="/opt/python/cp312-cp312/bin:$PATH"
|
||||||
|
|
||||||
|
# cached *-src repos may be owned by the host runner user; tell git to trust them
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
|
||||||
|
./setup.sh
|
||||||
|
|
||||||
|
if [[ -z "${BUILD_SH_REUSE_MANYLINUX_ARTIFACTS:-}" ]]; then
|
||||||
|
for toml in */pyproject.toml; do
|
||||||
|
pkg="${toml%/pyproject.toml}"
|
||||||
|
module="${pkg//-/_}"
|
||||||
|
rm -rf "$pkg/$module/install" "$pkg/$module/toolchain" "$pkg/$module/bin"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
export CMAKE_C_COMPILER_LAUNCHER=ccache
|
||||||
|
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||||
|
|
||||||
|
echo "Building workspace packages into dist"
|
||||||
|
START_SECS=$SECONDS
|
||||||
|
|
||||||
|
mkdir -p dist/
|
||||||
|
rm -rf dist/*
|
||||||
|
uv build --all-packages --wheel --out-dir dist --no-create-gitignore
|
||||||
|
|
||||||
|
if [[ -n "${BUILD_SH_IN_MANYLINUX:-}" ]]; then
|
||||||
|
VENV_DIR="$ROOT_DIR/.venv-manylinux"
|
||||||
|
else
|
||||||
|
VENV_DIR="$ROOT_DIR/.venv"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Running smoketests"
|
||||||
|
|
||||||
|
uv venv --allow-existing --quiet "$VENV_DIR"
|
||||||
|
uv pip install --python "$VENV_DIR/bin/python" --reinstall --no-deps --quiet dist/*.whl >/dev/null
|
||||||
|
|
||||||
|
for toml in */pyproject.toml; do
|
||||||
|
module="$(basename "$(dirname "$toml")" | tr '-' '_')"
|
||||||
|
"$VENV_DIR/bin/python" -c "import $module; $module.smoketest()" >/dev/null
|
||||||
|
done
|
||||||
|
|
||||||
|
du -hs dist/* | sort -hr
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Done in $((SECONDS - START_SECS))s"
|
||||||
37
bzip2/build.sh
Executable file
37
bzip2/build.sh
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
VERSION="bzip2-1.0.8"
|
||||||
|
INSTALL_DIR="$DIR/bzip2/install"
|
||||||
|
|
||||||
|
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
||||||
|
CC="ccache ${CC:-cc}"
|
||||||
|
|
||||||
|
# Clone/update source
|
||||||
|
if [ ! -d "bzip2-src/.git" ]; then
|
||||||
|
rm -rf bzip2-src
|
||||||
|
git clone --depth 1 https://gitlab.com/bzip2/bzip2.git bzip2-src
|
||||||
|
fi
|
||||||
|
git -C bzip2-src fetch --depth 1 origin "$VERSION"
|
||||||
|
git -C bzip2-src checkout --force FETCH_HEAD
|
||||||
|
|
||||||
|
# Build static library with -fPIC
|
||||||
|
cd bzip2-src
|
||||||
|
make -j"$NJOBS" libbz2.a CC="${CC:-cc}" CFLAGS="-Wall -Winline -O2 -fPIC -D_FILE_OFFSET_BITS=64"
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
# Copy to package install dir
|
||||||
|
rm -rf "$INSTALL_DIR"
|
||||||
|
mkdir -p "$INSTALL_DIR"/{lib,include}
|
||||||
|
|
||||||
|
# Library
|
||||||
|
cp bzip2-src/libbz2.a "$INSTALL_DIR/lib/"
|
||||||
|
|
||||||
|
# Headers
|
||||||
|
cp bzip2-src/bzlib.h "$INSTALL_DIR/include/"
|
||||||
|
|
||||||
|
echo "Installed bzip2 to $INSTALL_DIR"
|
||||||
|
du -sh "$INSTALL_DIR"
|
||||||
10
bzip2/bzip2/__init__.py
Normal file
10
bzip2/bzip2/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
DIR = os.path.join(os.path.dirname(__file__), "install")
|
||||||
|
LIB_DIR = os.path.join(DIR, "lib")
|
||||||
|
INCLUDE_DIR = os.path.join(DIR, "include")
|
||||||
|
|
||||||
|
|
||||||
|
def smoketest():
|
||||||
|
assert os.path.isfile(os.path.join(LIB_DIR, "libbz2.a")), "libbz2.a not found"
|
||||||
|
assert os.path.isfile(os.path.join(INCLUDE_DIR, "bzlib.h")), "bzlib.h not found"
|
||||||
@@ -3,13 +3,13 @@ requires = ["setuptools>=64", "wheel"]
|
|||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "python3-dev"
|
name = "bzip2"
|
||||||
version = "3.12.8"
|
version = "1.0.8"
|
||||||
description = "CPython development headers"
|
description = "bzip2 compression library (static build)"
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.8"
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
include = ["python3_dev*"]
|
include = ["bzip2*"]
|
||||||
|
|
||||||
[tool.setuptools.package-data]
|
[tool.setuptools.package-data]
|
||||||
python3_dev = ["install/**/*"]
|
bzip2 = ["install/**/*"]
|
||||||
@@ -10,21 +10,18 @@ except ImportError:
|
|||||||
bdist_wheel = None
|
bdist_wheel = None
|
||||||
|
|
||||||
|
|
||||||
class BuildOpenssl(build_py):
|
class BuildBzip2(build_py):
|
||||||
"""Run build.sh to compile OpenSSL before collecting package data."""
|
"""Run build.sh to compile bzip2 before collecting package data."""
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
marker = os.path.join(pkg_dir, "openssl3", "install", "lib", "libcrypto.a")
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
if not os.path.exists(marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|
||||||
cmdclass = {"build_py": BuildOpenssl}
|
cmdclass = {"build_py": BuildBzip2}
|
||||||
|
|
||||||
if bdist_wheel is not None:
|
if bdist_wheel is not None:
|
||||||
|
|
||||||
@@ -7,18 +7,15 @@ cd "$DIR"
|
|||||||
VERSION="1.0.1"
|
VERSION="1.0.1"
|
||||||
INSTALL_DIR="$DIR/capnproto/install"
|
INSTALL_DIR="$DIR/capnproto/install"
|
||||||
|
|
||||||
# Idempotent: skip if already built
|
|
||||||
if [ -x "$INSTALL_DIR/bin/capnp" ]; then
|
|
||||||
echo "capnproto already present, skipping build."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
||||||
|
|
||||||
# Clone
|
# Clone/update source
|
||||||
if [ ! -d "capnproto-src" ]; then
|
if [ ! -d "capnproto-src/.git" ]; then
|
||||||
git clone --depth 1 --branch "v${VERSION}" https://github.com/capnproto/capnproto.git capnproto-src
|
rm -rf capnproto-src
|
||||||
|
git clone --depth 1 https://github.com/capnproto/capnproto.git capnproto-src
|
||||||
fi
|
fi
|
||||||
|
git -C capnproto-src fetch --depth 1 origin "v${VERSION}"
|
||||||
|
git -C capnproto-src checkout --force FETCH_HEAD
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
PREFIX="$DIR/build/prefix"
|
PREFIX="$DIR/build/prefix"
|
||||||
@@ -30,6 +27,8 @@ cmake -S capnproto-src -B "$DIR/build" \
|
|||||||
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
||||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||||
|
-DCMAKE_C_FLAGS="-fPIC" \
|
||||||
|
-DCMAKE_CXX_FLAGS="-fPIC" \
|
||||||
-DWITH_OPENSSL=OFF \
|
-DWITH_OPENSSL=OFF \
|
||||||
-DBUILD_TESTING=OFF \
|
-DBUILD_TESTING=OFF \
|
||||||
-DBUILD_SHARED_LIBS=OFF
|
-DBUILD_SHARED_LIBS=OFF
|
||||||
@@ -62,8 +61,5 @@ for obj in filesystem.c++.o main.c++.o test-helpers.c++.o; do
|
|||||||
ar d "$INSTALL_DIR/lib/libkj.a" "$obj" 2>/dev/null || true
|
ar d "$INSTALL_DIR/lib/libkj.a" "$obj" 2>/dev/null || true
|
||||||
done
|
done
|
||||||
|
|
||||||
# Clean up
|
|
||||||
rm -rf capnproto-src "$DIR/build"
|
|
||||||
|
|
||||||
echo "Installed capnproto to $INSTALL_DIR"
|
echo "Installed capnproto to $INSTALL_DIR"
|
||||||
du -sh "$INSTALL_DIR"
|
du -sh "$INSTALL_DIR"
|
||||||
|
|||||||
@@ -29,3 +29,16 @@ def _run_capnpc():
|
|||||||
|
|
||||||
def _run_capnpc_cpp():
|
def _run_capnpc_cpp():
|
||||||
_run("capnpc-c++")
|
_run("capnpc-c++")
|
||||||
|
|
||||||
|
|
||||||
|
def smoketest():
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
capnp = os.path.join(BIN_DIR, "capnp")
|
||||||
|
capnpc = os.path.join(BIN_DIR, "capnpc")
|
||||||
|
capnpc_cpp = os.path.join(BIN_DIR, "capnpc-c++")
|
||||||
|
env = os.environ.copy()
|
||||||
|
env["PATH"] = BIN_DIR + ":" + env.get("PATH", "")
|
||||||
|
subprocess.run([capnp, "--version"], check=True, env=env)
|
||||||
|
subprocess.run([capnpc, "--version"], check=True, env=env)
|
||||||
|
subprocess.run([capnpc_cpp, "--version"], check=True, env=env)
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ class BuildCapnproto(build_py):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
marker = os.path.join(pkg_dir, "capnproto", "install", "bin", "capnp")
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
if not os.path.exists(marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|||||||
@@ -7,18 +7,16 @@ cd "$DIR"
|
|||||||
VERSION="2.16.0"
|
VERSION="2.16.0"
|
||||||
INSTALL_DIR="$DIR/cppcheck/install"
|
INSTALL_DIR="$DIR/cppcheck/install"
|
||||||
|
|
||||||
# Idempotent: skip if already built
|
|
||||||
if [ -x "$INSTALL_DIR/cppcheck" ]; then
|
|
||||||
echo "cppcheck already present, skipping build."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
||||||
|
CXX="ccache ${CXX:-c++}"
|
||||||
|
|
||||||
# Clone
|
# Clone/update source
|
||||||
if [ ! -d "cppcheck-src" ]; then
|
if [ ! -d "cppcheck-src/.git" ]; then
|
||||||
git clone --depth 1 --branch "$VERSION" https://github.com/danmar/cppcheck.git cppcheck-src
|
rm -rf cppcheck-src
|
||||||
|
git clone --depth 1 https://github.com/danmar/cppcheck.git cppcheck-src
|
||||||
fi
|
fi
|
||||||
|
git -C cppcheck-src fetch --depth 1 origin "$VERSION"
|
||||||
|
git -C cppcheck-src checkout --force FETCH_HEAD
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
cd cppcheck-src
|
cd cppcheck-src
|
||||||
@@ -35,8 +33,5 @@ cp -r cppcheck-src/cfg "$INSTALL_DIR/"
|
|||||||
cp -r cppcheck-src/platforms "$INSTALL_DIR/"
|
cp -r cppcheck-src/platforms "$INSTALL_DIR/"
|
||||||
strip "$INSTALL_DIR/cppcheck" 2>/dev/null || true
|
strip "$INSTALL_DIR/cppcheck" 2>/dev/null || true
|
||||||
|
|
||||||
# Clean up
|
|
||||||
rm -rf cppcheck-src
|
|
||||||
|
|
||||||
echo "Installed cppcheck to $INSTALL_DIR"
|
echo "Installed cppcheck to $INSTALL_DIR"
|
||||||
du -sh "$INSTALL_DIR"
|
du -sh "$INSTALL_DIR"
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ class BuildCppcheck(build_py):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
marker = os.path.join(pkg_dir, "cppcheck", "install", "cppcheck")
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
if not os.path.exists(marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|||||||
@@ -7,28 +7,19 @@ cd "$DIR"
|
|||||||
VERSION="3.4.0"
|
VERSION="3.4.0"
|
||||||
INSTALL_DIR="$DIR/eigen/install"
|
INSTALL_DIR="$DIR/eigen/install"
|
||||||
|
|
||||||
# Idempotent: skip if already present
|
# Clone/update source
|
||||||
if [ -d "$INSTALL_DIR/eigen3/Eigen" ]; then
|
if [ ! -d "eigen-src/.git" ]; then
|
||||||
echo "eigen already present, skipping download."
|
rm -rf eigen-src
|
||||||
exit 0
|
git clone --depth 1 https://gitlab.com/libeigen/eigen.git eigen-src
|
||||||
fi
|
fi
|
||||||
|
git -C eigen-src fetch --depth 1 origin "$VERSION"
|
||||||
|
git -C eigen-src checkout --force FETCH_HEAD
|
||||||
|
|
||||||
TARBALL="eigen-${VERSION}.tar.gz"
|
# Copy headers
|
||||||
URL="https://gitlab.com/libeigen/eigen/-/archive/${VERSION}/${TARBALL}"
|
|
||||||
|
|
||||||
echo "Downloading Eigen ${VERSION} ..."
|
|
||||||
curl -fSL -o "$TARBALL" "$URL"
|
|
||||||
|
|
||||||
echo "Extracting headers ..."
|
|
||||||
rm -rf "$INSTALL_DIR"
|
rm -rf "$INSTALL_DIR"
|
||||||
mkdir -p "$INSTALL_DIR/eigen3"
|
mkdir -p "$INSTALL_DIR/eigen3"
|
||||||
|
cp -r eigen-src/Eigen "$INSTALL_DIR/eigen3/"
|
||||||
# Extract only the Eigen/ and unsupported/Eigen/ header directories
|
cp -r eigen-src/unsupported "$INSTALL_DIR/eigen3/"
|
||||||
tar --strip-components=1 -xzf "$TARBALL" -C "$INSTALL_DIR/eigen3" \
|
|
||||||
"eigen-${VERSION}/Eigen" \
|
|
||||||
"eigen-${VERSION}/unsupported"
|
|
||||||
|
|
||||||
rm -f "$TARBALL"
|
|
||||||
|
|
||||||
echo "Installed eigen to $INSTALL_DIR"
|
echo "Installed eigen to $INSTALL_DIR"
|
||||||
du -sh "$INSTALL_DIR"
|
du -sh "$INSTALL_DIR"
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ class BuildEigen(build_py):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
marker = os.path.join(pkg_dir, "eigen", "install", "eigen3", "Eigen")
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
if not os.path.isdir(marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|||||||
52
ffmpeg/build.sh
Normal file → Executable file
52
ffmpeg/build.sh
Normal file → Executable file
@@ -5,25 +5,39 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
|||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
|
|
||||||
FFMPEG_VERSION="7.1"
|
FFMPEG_VERSION="7.1"
|
||||||
|
ZLIB_VERSION="da607da739fa6047df13e66a2af6b8bec7c2a498" # v1.3.2
|
||||||
|
X264_BRANCH="stable"
|
||||||
INSTALL_DIR="$DIR/ffmpeg/install"
|
INSTALL_DIR="$DIR/ffmpeg/install"
|
||||||
|
|
||||||
# Idempotent: skip if already built
|
|
||||||
if [ -x "$INSTALL_DIR/bin/ffmpeg" ]; then
|
|
||||||
echo "ffmpeg already present, skipping build."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
||||||
|
CC="ccache ${CC:-cc}"
|
||||||
PREFIX="$DIR/build/prefix"
|
PREFIX="$DIR/build/prefix"
|
||||||
mkdir -p "$DIR/build"
|
mkdir -p "$DIR/build"
|
||||||
|
|
||||||
# --- Build x264 (static) ---
|
# --- Build zlib (static) ---
|
||||||
if [ ! -d "x264-src" ]; then
|
if [ ! -d "zlib-src/.git" ]; then
|
||||||
git clone --depth 1 --branch stable https://code.videolan.org/videolan/x264.git x264-src
|
rm -rf zlib-src
|
||||||
|
git clone --depth 1 https://github.com/madler/zlib.git zlib-src
|
||||||
fi
|
fi
|
||||||
|
git -C zlib-src fetch --depth 1 origin "$ZLIB_VERSION"
|
||||||
|
git -C zlib-src checkout --force "$ZLIB_VERSION"
|
||||||
|
|
||||||
|
cd zlib-src
|
||||||
|
./configure --prefix="$PREFIX" --static
|
||||||
|
make -j"$NJOBS"
|
||||||
|
make install
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
# --- Build x264 (static) ---
|
||||||
|
if [ ! -d "x264-src/.git" ]; then
|
||||||
|
rm -rf x264-src
|
||||||
|
git clone --depth 1 https://code.videolan.org/videolan/x264.git x264-src
|
||||||
|
fi
|
||||||
|
git -C x264-src fetch --depth 1 origin "$X264_BRANCH"
|
||||||
|
git -C x264-src checkout --force FETCH_HEAD
|
||||||
|
|
||||||
cd x264-src
|
cd x264-src
|
||||||
./configure \
|
CFLAGS="-fno-finite-math-only" ./configure \
|
||||||
--prefix="$PREFIX" \
|
--prefix="$PREFIX" \
|
||||||
--enable-static \
|
--enable-static \
|
||||||
--disable-shared \
|
--disable-shared \
|
||||||
@@ -35,26 +49,31 @@ make install
|
|||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
|
|
||||||
# --- Build FFmpeg ---
|
# --- Build FFmpeg ---
|
||||||
if [ ! -d "ffmpeg-src" ]; then
|
if [ ! -d "ffmpeg-src/.git" ]; then
|
||||||
git clone --depth 1 --branch "n${FFMPEG_VERSION}" https://github.com/FFmpeg/FFmpeg.git ffmpeg-src
|
rm -rf ffmpeg-src
|
||||||
|
git clone --depth 1 https://github.com/FFmpeg/FFmpeg.git ffmpeg-src
|
||||||
fi
|
fi
|
||||||
|
git -C ffmpeg-src fetch --depth 1 origin "n${FFMPEG_VERSION}"
|
||||||
|
git -C ffmpeg-src checkout --force FETCH_HEAD
|
||||||
|
|
||||||
cd ffmpeg-src
|
cd ffmpeg-src
|
||||||
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" \
|
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" \
|
||||||
./configure \
|
./configure \
|
||||||
|
--cc="${CC:-cc}" \
|
||||||
--prefix="$PREFIX" \
|
--prefix="$PREFIX" \
|
||||||
--enable-gpl \
|
--enable-gpl \
|
||||||
--enable-static \
|
--enable-static \
|
||||||
--disable-shared \
|
--disable-shared \
|
||||||
|
--enable-zlib \
|
||||||
--enable-libx264 \
|
--enable-libx264 \
|
||||||
--enable-pic \
|
--enable-pic \
|
||||||
--disable-doc \
|
--disable-doc \
|
||||||
--disable-ffplay \
|
--disable-ffplay \
|
||||||
--disable-autodetect \
|
--disable-autodetect \
|
||||||
--disable-everything \
|
--disable-everything \
|
||||||
--enable-encoder=libx264,aac,ffvhuff,rawvideo,png \
|
--enable-encoder=libx264,aac,ffvhuff,rawvideo,png,mjpeg \
|
||||||
--enable-decoder=h264,hevc,ffvhuff,aac,rawvideo,png,mjpeg,mp3,pcm_s16le \
|
--enable-decoder=h264,hevc,ffvhuff,aac,rawvideo,png,mjpeg,mp3,pcm_s16le \
|
||||||
--enable-muxer=mpegts,matroska,mp4,hevc,rawvideo,image2,null,mov \
|
--enable-muxer=mpegts,matroska,mp4,hevc,rawvideo,image2,null,mov,framehash \
|
||||||
--enable-demuxer=hevc,matroska,mpegts,mov,rawvideo,image2,aac,concat \
|
--enable-demuxer=hevc,matroska,mpegts,mov,rawvideo,image2,aac,concat \
|
||||||
--enable-parser=h264,hevc,aac,mpegaudio \
|
--enable-parser=h264,hevc,aac,mpegaudio \
|
||||||
--enable-protocol=file,pipe \
|
--enable-protocol=file,pipe \
|
||||||
@@ -75,7 +94,7 @@ cp "$PREFIX/bin/ffmpeg" "$INSTALL_DIR/bin/"
|
|||||||
cp "$PREFIX/bin/ffprobe" "$INSTALL_DIR/bin/"
|
cp "$PREFIX/bin/ffprobe" "$INSTALL_DIR/bin/"
|
||||||
|
|
||||||
# Libraries
|
# Libraries
|
||||||
for lib in libavformat.a libavcodec.a libavutil.a libswresample.a libx264.a; do
|
for lib in libavformat.a libavcodec.a libavutil.a libswresample.a libx264.a libz.a; do
|
||||||
cp "$PREFIX/lib/$lib" "$INSTALL_DIR/lib/"
|
cp "$PREFIX/lib/$lib" "$INSTALL_DIR/lib/"
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -87,8 +106,5 @@ done
|
|||||||
# Strip binaries
|
# Strip binaries
|
||||||
strip "$INSTALL_DIR/bin/ffmpeg" "$INSTALL_DIR/bin/ffprobe" 2>/dev/null || true
|
strip "$INSTALL_DIR/bin/ffmpeg" "$INSTALL_DIR/bin/ffprobe" 2>/dev/null || true
|
||||||
|
|
||||||
# Clean up
|
|
||||||
rm -rf x264-src ffmpeg-src "$DIR/build"
|
|
||||||
|
|
||||||
echo "Installed ffmpeg to $INSTALL_DIR"
|
echo "Installed ffmpeg to $INSTALL_DIR"
|
||||||
du -sh "$INSTALL_DIR"
|
du -sh "$INSTALL_DIR"
|
||||||
|
|||||||
@@ -18,3 +18,12 @@ def _run_ffmpeg():
|
|||||||
|
|
||||||
def _run_ffprobe():
|
def _run_ffprobe():
|
||||||
_run("ffprobe")
|
_run("ffprobe")
|
||||||
|
|
||||||
|
|
||||||
|
def smoketest():
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
ffmpeg = os.path.join(BIN_DIR, "ffmpeg")
|
||||||
|
ffprobe = os.path.join(BIN_DIR, "ffprobe")
|
||||||
|
subprocess.run([ffmpeg, "-version"], check=True)
|
||||||
|
subprocess.run([ffprobe, "-version"], check=True)
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ class BuildFFmpeg(build_py):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
marker = os.path.join(pkg_dir, "ffmpeg", "install", "bin", "ffmpeg")
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
if not os.path.exists(marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,11 @@ TOOLCHAIN_BASE="arm-gnu-toolchain-${TOOLCHAIN_VERSION}"
|
|||||||
GCC_VERSION="13.2.1"
|
GCC_VERSION="13.2.1"
|
||||||
|
|
||||||
INSTALL_DIR="$DIR/gcc_arm_none_eabi/toolchain"
|
INSTALL_DIR="$DIR/gcc_arm_none_eabi/toolchain"
|
||||||
|
VERSION_FILE="$INSTALL_DIR/.version"
|
||||||
|
|
||||||
# Idempotent: skip if already built
|
# Skip if already at correct version
|
||||||
if [ -x "$INSTALL_DIR/bin/arm-none-eabi-gcc" ]; then
|
if [ -f "$VERSION_FILE" ] && [ "$(cat "$VERSION_FILE")" = "$TOOLCHAIN_VERSION" ]; then
|
||||||
echo "Toolchain already present, skipping download."
|
echo "Toolchain $TOOLCHAIN_VERSION already present, skipping."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -112,6 +113,7 @@ find "$INSTALL_DIR" -type f \( -executable -o -name '*.so' \) -exec strip {} + 2
|
|||||||
# --- clean up download artifacts ---
|
# --- clean up download artifacts ---
|
||||||
rm -rf "$EXTRACT_DIR"
|
rm -rf "$EXTRACT_DIR"
|
||||||
rm -f "$TARBALL"
|
rm -f "$TARBALL"
|
||||||
|
echo "$TOOLCHAIN_VERSION" > "$VERSION_FILE"
|
||||||
|
|
||||||
echo "Installed to $INSTALL_DIR"
|
echo "Installed to $INSTALL_DIR"
|
||||||
du -sh "$INSTALL_DIR"
|
du -sh "$INSTALL_DIR"
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
|
||||||
|
|
||||||
from setuptools.command.build_py import build_py
|
from setuptools.command.build_py import build_py
|
||||||
from setuptools.dist import Distribution
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from wheel.bdist_wheel import bdist_wheel
|
from wheel.bdist_wheel import bdist_wheel
|
||||||
@@ -17,13 +15,8 @@ class BuildToolchain(build_py):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
toolchain_marker = os.path.join(
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
pkg_dir, "gcc_arm_none_eabi", "toolchain", "bin", "arm-none-eabi-gcc"
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
)
|
|
||||||
|
|
||||||
if not os.path.exists(toolchain_marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ cd "$DIR"
|
|||||||
|
|
||||||
VERSION="3.6.1"
|
VERSION="3.6.1"
|
||||||
INSTALL_DIR="$DIR/git_lfs/bin"
|
INSTALL_DIR="$DIR/git_lfs/bin"
|
||||||
|
VERSION_FILE="$INSTALL_DIR/.version"
|
||||||
|
|
||||||
# Idempotent: skip if already present
|
# Skip if already at correct version
|
||||||
if [ -x "$INSTALL_DIR/git-lfs" ]; then
|
if [ -f "$VERSION_FILE" ] && [ "$(cat "$VERSION_FILE")" = "$VERSION" ]; then
|
||||||
echo "git-lfs already present, skipping download."
|
echo "git-lfs $VERSION already present, skipping."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -51,6 +52,7 @@ fi
|
|||||||
chmod +x "$INSTALL_DIR/git-lfs"
|
chmod +x "$INSTALL_DIR/git-lfs"
|
||||||
|
|
||||||
rm -f "$FILENAME"
|
rm -f "$FILENAME"
|
||||||
|
echo "$VERSION" > "$VERSION_FILE"
|
||||||
|
|
||||||
echo "Installed git-lfs to $INSTALL_DIR"
|
echo "Installed git-lfs to $INSTALL_DIR"
|
||||||
du -sh "$INSTALL_DIR"
|
du -sh "$INSTALL_DIR"
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ class BuildGitLfs(build_py):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
marker = os.path.join(pkg_dir, "git_lfs", "bin", "git-lfs")
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
if not os.path.exists(marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|||||||
67
imgui/build.sh
Executable file
67
imgui/build.sh
Executable file
@@ -0,0 +1,67 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
INSTALL_DIR="$DIR/imgui/install"
|
||||||
|
|
||||||
|
# Dear ImGui (docking branch, version 1.92.7)
|
||||||
|
IMGUI_COMMIT="934c6a5f5ef2355d6df25395d555cb71f790c4e9"
|
||||||
|
# ImPlot
|
||||||
|
IMPLOT_COMMIT="93c801b4bb801c5c11031d880b6af1d1f70bd79d"
|
||||||
|
# rlImGui
|
||||||
|
RLIMGUI_COMMIT="286e11acd6c785004c9550c7ed3762add2ae3d47"
|
||||||
|
|
||||||
|
# Clone/update imgui
|
||||||
|
if [ ! -d "imgui-src/.git" ]; then
|
||||||
|
rm -rf imgui-src
|
||||||
|
git clone --depth 1 https://github.com/ocornut/imgui.git imgui-src
|
||||||
|
fi
|
||||||
|
git -C imgui-src fetch --depth 1 origin "$IMGUI_COMMIT"
|
||||||
|
git -C imgui-src checkout --force "$IMGUI_COMMIT"
|
||||||
|
|
||||||
|
# Clone/update implot
|
||||||
|
if [ ! -d "implot-src/.git" ]; then
|
||||||
|
rm -rf implot-src
|
||||||
|
git clone --depth 1 https://github.com/epezent/implot.git implot-src
|
||||||
|
fi
|
||||||
|
git -C implot-src fetch --depth 1 origin "$IMPLOT_COMMIT"
|
||||||
|
git -C implot-src checkout --force "$IMPLOT_COMMIT"
|
||||||
|
|
||||||
|
# Clone/update rlimgui
|
||||||
|
if [ ! -d "rlimgui-src/.git" ]; then
|
||||||
|
rm -rf rlimgui-src
|
||||||
|
git clone --depth 1 https://github.com/raylib-extras/rlImGui.git rlimgui-src
|
||||||
|
fi
|
||||||
|
git -C rlimgui-src fetch --depth 1 origin "$RLIMGUI_COMMIT"
|
||||||
|
git -C rlimgui-src checkout --force "$RLIMGUI_COMMIT"
|
||||||
|
|
||||||
|
# Install
|
||||||
|
rm -rf "$INSTALL_DIR"
|
||||||
|
mkdir -p "$INSTALL_DIR/include/extras" "$INSTALL_DIR/src"
|
||||||
|
|
||||||
|
# imgui
|
||||||
|
cp imgui-src/imgui.h imgui-src/imgui_internal.h imgui-src/imconfig.h \
|
||||||
|
imgui-src/imstb_rectpack.h imgui-src/imstb_textedit.h imgui-src/imstb_truetype.h \
|
||||||
|
"$INSTALL_DIR/include/"
|
||||||
|
cp imgui-src/imgui.cpp imgui-src/imgui_draw.cpp imgui-src/imgui_tables.cpp \
|
||||||
|
imgui-src/imgui_widgets.cpp imgui-src/imgui_demo.cpp \
|
||||||
|
"$INSTALL_DIR/src/"
|
||||||
|
cp imgui-src/backends/imgui_impl_opengl3.h imgui-src/backends/imgui_impl_opengl3_loader.h \
|
||||||
|
"$INSTALL_DIR/include/"
|
||||||
|
cp imgui-src/backends/imgui_impl_opengl3.cpp "$INSTALL_DIR/src/"
|
||||||
|
|
||||||
|
# implot
|
||||||
|
cp implot-src/implot.h implot-src/implot_internal.h "$INSTALL_DIR/include/"
|
||||||
|
cp implot-src/implot.cpp implot-src/implot_items.cpp "$INSTALL_DIR/src/"
|
||||||
|
|
||||||
|
# rlimgui
|
||||||
|
cp rlimgui-src/rlImGui.h rlimgui-src/rlImGuiColors.h rlimgui-src/imgui_impl_raylib.h \
|
||||||
|
"$INSTALL_DIR/include/"
|
||||||
|
cp rlimgui-src/extras/FA6FreeSolidFontData.h rlimgui-src/extras/IconsFontAwesome6.h \
|
||||||
|
"$INSTALL_DIR/include/extras/"
|
||||||
|
cp rlimgui-src/rlImGui.cpp "$INSTALL_DIR/src/"
|
||||||
|
|
||||||
|
echo "Installed imgui to $INSTALL_DIR"
|
||||||
|
du -sh "$INSTALL_DIR"
|
||||||
10
imgui/imgui/__init__.py
Normal file
10
imgui/imgui/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
DIR = os.path.join(os.path.dirname(__file__), "install")
|
||||||
|
INCLUDE_DIR = os.path.join(DIR, "include")
|
||||||
|
SRC_DIR = os.path.join(DIR, "src")
|
||||||
|
|
||||||
|
|
||||||
|
def smoketest():
|
||||||
|
assert os.path.isfile(os.path.join(INCLUDE_DIR, "imgui.h")), "imgui.h not found"
|
||||||
|
assert os.path.isfile(os.path.join(SRC_DIR, "imgui.cpp")), "imgui.cpp not found"
|
||||||
@@ -3,13 +3,13 @@ requires = ["setuptools>=64", "wheel"]
|
|||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "openssl3"
|
name = "imgui"
|
||||||
version = "3.4.1"
|
version = "1.92.7"
|
||||||
description = "OpenSSL cryptography library (static build)"
|
description = "Dear ImGui + ImPlot + rlImGui (source distribution)"
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.8"
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
include = ["openssl3*"]
|
include = ["imgui*"]
|
||||||
|
|
||||||
[tool.setuptools.package-data]
|
[tool.setuptools.package-data]
|
||||||
openssl3 = ["install/**/*"]
|
imgui = ["install/**/*"]
|
||||||
58
imgui/setup.py
Normal file
58
imgui/setup.py
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
import os
|
||||||
|
import platform
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from setuptools.command.build_py import build_py
|
||||||
|
|
||||||
|
try:
|
||||||
|
from wheel.bdist_wheel import bdist_wheel
|
||||||
|
except ImportError:
|
||||||
|
bdist_wheel = None
|
||||||
|
|
||||||
|
|
||||||
|
class BuildImgui(build_py):
|
||||||
|
"""Run build.sh to download imgui sources before collecting package data."""
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
|
|
||||||
|
super().run()
|
||||||
|
|
||||||
|
|
||||||
|
cmdclass = {"build_py": BuildImgui}
|
||||||
|
|
||||||
|
if bdist_wheel is not None:
|
||||||
|
|
||||||
|
class PlatformWheel(bdist_wheel):
|
||||||
|
"""Produce a platform-specific, Python-version-agnostic wheel."""
|
||||||
|
|
||||||
|
def finalize_options(self):
|
||||||
|
super().finalize_options()
|
||||||
|
self.root_is_pure = False
|
||||||
|
|
||||||
|
def get_tag(self):
|
||||||
|
system = platform.system()
|
||||||
|
machine = platform.machine()
|
||||||
|
|
||||||
|
if system == "Linux":
|
||||||
|
plat = f"linux_{machine}"
|
||||||
|
elif system == "Darwin":
|
||||||
|
plat = "macosx_11_0_arm64"
|
||||||
|
else:
|
||||||
|
plat = f"{system.lower()}_{machine}"
|
||||||
|
|
||||||
|
return "py3", "none", plat
|
||||||
|
|
||||||
|
cmdclass["bdist_wheel"] = PlatformWheel
|
||||||
|
|
||||||
|
|
||||||
|
def setup():
|
||||||
|
from setuptools import setup as _setup
|
||||||
|
|
||||||
|
_setup(cmdclass=cmdclass)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
setup()
|
||||||
31
json11/build.sh
Executable file
31
json11/build.sh
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
VERSION="db00e9369a92aa74bf630a2ffb092a4b0b132c01"
|
||||||
|
INSTALL_DIR="$DIR/json11/install"
|
||||||
|
CXX="ccache ${CXX:-c++}"
|
||||||
|
|
||||||
|
if [ ! -d "$DIR/json11-src/.git" ]; then
|
||||||
|
git clone --depth 1 https://github.com/dropbox/json11.git json11-src
|
||||||
|
fi
|
||||||
|
|
||||||
|
git -C json11-src fetch --depth 1 origin "$VERSION"
|
||||||
|
git -C json11-src checkout --force "$VERSION"
|
||||||
|
|
||||||
|
BUILD_DIR="$DIR/build"
|
||||||
|
mkdir -p "$BUILD_DIR"
|
||||||
|
rm -rf "$INSTALL_DIR"
|
||||||
|
mkdir -p "$INSTALL_DIR/lib" "$INSTALL_DIR/include/json11"
|
||||||
|
|
||||||
|
CXX="${CXX:-c++}"
|
||||||
|
AR="${AR:-ar}"
|
||||||
|
|
||||||
|
$CXX -std=c++11 -fPIC -O2 -c "$DIR/json11-src/json11.cpp" -o "$BUILD_DIR/json11.o"
|
||||||
|
"$AR" rcs "$INSTALL_DIR/lib/libjson11.a" "$BUILD_DIR/json11.o"
|
||||||
|
cp "$DIR/json11-src/json11.hpp" "$INSTALL_DIR/include/json11/json11.hpp"
|
||||||
|
|
||||||
|
echo "Installed json11 to $INSTALL_DIR"
|
||||||
|
du -sh "$INSTALL_DIR"
|
||||||
10
json11/json11/__init__.py
Normal file
10
json11/json11/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
DIR = os.path.join(os.path.dirname(__file__), "install")
|
||||||
|
LIB_DIR = os.path.join(DIR, "lib")
|
||||||
|
INCLUDE_DIR = os.path.join(DIR, "include")
|
||||||
|
|
||||||
|
|
||||||
|
def smoketest():
|
||||||
|
assert os.path.isfile(os.path.join(LIB_DIR, "libjson11.a")), "libjson11.a not found"
|
||||||
|
assert os.path.isfile(os.path.join(INCLUDE_DIR, "json11", "json11.hpp")), "json11/json11.hpp not found"
|
||||||
15
json11/pyproject.toml
Normal file
15
json11/pyproject.toml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools>=64", "wheel"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "json11"
|
||||||
|
version = "20170411.0"
|
||||||
|
description = "json11 JSON parser library (static build)"
|
||||||
|
requires-python = ">=3.8"
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
include = ["json11*"]
|
||||||
|
|
||||||
|
[tool.setuptools.package-data]
|
||||||
|
json11 = ["install/**/*"]
|
||||||
58
json11/setup.py
Normal file
58
json11/setup.py
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
import os
|
||||||
|
import platform
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from setuptools.command.build_py import build_py
|
||||||
|
|
||||||
|
try:
|
||||||
|
from wheel.bdist_wheel import bdist_wheel
|
||||||
|
except ImportError:
|
||||||
|
bdist_wheel = None
|
||||||
|
|
||||||
|
|
||||||
|
class BuildJson11(build_py):
|
||||||
|
"""Run build.sh to compile json11 before collecting package data."""
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
|
|
||||||
|
super().run()
|
||||||
|
|
||||||
|
|
||||||
|
cmdclass = {"build_py": BuildJson11}
|
||||||
|
|
||||||
|
if bdist_wheel is not None:
|
||||||
|
|
||||||
|
class PlatformWheel(bdist_wheel):
|
||||||
|
"""Produce a platform-specific, Python-version-agnostic wheel."""
|
||||||
|
|
||||||
|
def finalize_options(self):
|
||||||
|
super().finalize_options()
|
||||||
|
self.root_is_pure = False
|
||||||
|
|
||||||
|
def get_tag(self):
|
||||||
|
system = platform.system()
|
||||||
|
machine = platform.machine()
|
||||||
|
|
||||||
|
if system == "Linux":
|
||||||
|
plat = f"linux_{machine}"
|
||||||
|
elif system == "Darwin":
|
||||||
|
plat = "macosx_11_0_arm64"
|
||||||
|
else:
|
||||||
|
plat = f"{system.lower()}_{machine}"
|
||||||
|
|
||||||
|
return "py3", "none", plat
|
||||||
|
|
||||||
|
cmdclass["bdist_wheel"] = PlatformWheel
|
||||||
|
|
||||||
|
|
||||||
|
def setup():
|
||||||
|
from setuptools import setup as _setup
|
||||||
|
|
||||||
|
_setup(cmdclass=cmdclass)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
setup()
|
||||||
@@ -7,18 +7,15 @@ cd "$DIR"
|
|||||||
VERSION="3.1.0"
|
VERSION="3.1.0"
|
||||||
INSTALL_DIR="$DIR/libjpeg/install"
|
INSTALL_DIR="$DIR/libjpeg/install"
|
||||||
|
|
||||||
# Idempotent: skip if already built
|
|
||||||
if [ -f "$INSTALL_DIR/lib/libjpeg.a" ]; then
|
|
||||||
echo "libjpeg already present, skipping build."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
||||||
|
|
||||||
# Clone
|
# Clone/update source
|
||||||
if [ ! -d "libjpeg-turbo-src" ]; then
|
if [ ! -d "libjpeg-turbo-src/.git" ]; then
|
||||||
git clone --depth 1 --branch "${VERSION}" https://github.com/libjpeg-turbo/libjpeg-turbo.git libjpeg-turbo-src
|
rm -rf libjpeg-turbo-src
|
||||||
|
git clone --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo.git libjpeg-turbo-src
|
||||||
fi
|
fi
|
||||||
|
git -C libjpeg-turbo-src fetch --depth 1 origin "${VERSION}"
|
||||||
|
git -C libjpeg-turbo-src checkout --force FETCH_HEAD
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
PREFIX="$DIR/build/prefix"
|
PREFIX="$DIR/build/prefix"
|
||||||
@@ -29,6 +26,7 @@ cmake -S libjpeg-turbo-src -B "$DIR/build" \
|
|||||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF \
|
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF \
|
||||||
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
||||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||||
|
-DCMAKE_C_FLAGS="-fPIC" \
|
||||||
-DENABLE_SHARED=OFF \
|
-DENABLE_SHARED=OFF \
|
||||||
-DENABLE_STATIC=ON \
|
-DENABLE_STATIC=ON \
|
||||||
-DWITH_TURBOJPEG=OFF
|
-DWITH_TURBOJPEG=OFF
|
||||||
@@ -49,8 +47,5 @@ cp "$PREFIX/include/jconfig.h" "$INSTALL_DIR/include/"
|
|||||||
cp "$PREFIX/include/jerror.h" "$INSTALL_DIR/include/"
|
cp "$PREFIX/include/jerror.h" "$INSTALL_DIR/include/"
|
||||||
cp "$PREFIX/include/jmorecfg.h" "$INSTALL_DIR/include/"
|
cp "$PREFIX/include/jmorecfg.h" "$INSTALL_DIR/include/"
|
||||||
|
|
||||||
# Clean up
|
|
||||||
rm -rf libjpeg-turbo-src "$DIR/build"
|
|
||||||
|
|
||||||
echo "Installed libjpeg to $INSTALL_DIR"
|
echo "Installed libjpeg to $INSTALL_DIR"
|
||||||
du -sh "$INSTALL_DIR"
|
du -sh "$INSTALL_DIR"
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ class BuildLibjpeg(build_py):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
marker = os.path.join(pkg_dir, "libjpeg", "install", "lib", "libjpeg.a")
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
if not os.path.exists(marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|||||||
44
libyuv/build.sh
Executable file
44
libyuv/build.sh
Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
VERSION="6067afde563c3946eebd94f146b3824ab7a97a9c"
|
||||||
|
INSTALL_DIR="$DIR/libyuv/install"
|
||||||
|
|
||||||
|
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
||||||
|
|
||||||
|
if [ ! -d "libyuv-src/.git" ]; then
|
||||||
|
git clone --depth 1 https://chromium.googlesource.com/libyuv/libyuv libyuv-src
|
||||||
|
fi
|
||||||
|
|
||||||
|
git -C libyuv-src fetch --depth 1 origin "$VERSION"
|
||||||
|
git -C libyuv-src checkout --force "$VERSION"
|
||||||
|
|
||||||
|
BUILD_DIR="$DIR/build"
|
||||||
|
mkdir -p "$BUILD_DIR"
|
||||||
|
|
||||||
|
cmake -S "$DIR/libyuv-src" -B "$BUILD_DIR" \
|
||||||
|
-DCMAKE_BUILD_TYPE=MinSizeRel \
|
||||||
|
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF \
|
||||||
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||||
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
|
-DCMAKE_C_FLAGS="-fPIC" \
|
||||||
|
-DCMAKE_CXX_FLAGS="-fPIC"
|
||||||
|
|
||||||
|
cmake --build "$BUILD_DIR" -j"$NJOBS"
|
||||||
|
|
||||||
|
LIBYUV_STATIC="$(find "$BUILD_DIR" -name "libyuv.a" -type f | head -n 1)"
|
||||||
|
if [ -z "$LIBYUV_STATIC" ]; then
|
||||||
|
echo "libyuv.a not found in build output" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf "$INSTALL_DIR"
|
||||||
|
mkdir -p "$INSTALL_DIR"/{lib,include}
|
||||||
|
cp "$LIBYUV_STATIC" "$INSTALL_DIR/lib/libyuv.a"
|
||||||
|
cp -r "$DIR/libyuv-src/include/." "$INSTALL_DIR/include/"
|
||||||
|
|
||||||
|
echo "Installed libyuv to $INSTALL_DIR"
|
||||||
|
du -sh "$INSTALL_DIR"
|
||||||
11
libyuv/libyuv/__init__.py
Normal file
11
libyuv/libyuv/__init__.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
DIR = os.path.join(os.path.dirname(__file__), "install")
|
||||||
|
LIB_DIR = os.path.join(DIR, "lib")
|
||||||
|
INCLUDE_DIR = os.path.join(DIR, "include")
|
||||||
|
|
||||||
|
|
||||||
|
def smoketest():
|
||||||
|
assert os.path.isfile(os.path.join(LIB_DIR, "libyuv.a")), "libyuv.a not found"
|
||||||
|
assert os.path.isfile(os.path.join(INCLUDE_DIR, "libyuv.h")), "libyuv.h not found"
|
||||||
|
assert os.path.isfile(os.path.join(INCLUDE_DIR, "libyuv", "version.h")), "libyuv/version.h not found"
|
||||||
15
libyuv/pyproject.toml
Normal file
15
libyuv/pyproject.toml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools>=64", "wheel"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "libyuv"
|
||||||
|
version = "1922.0"
|
||||||
|
description = "libyuv image processing library (static build)"
|
||||||
|
requires-python = ">=3.8"
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
include = ["libyuv*"]
|
||||||
|
|
||||||
|
[tool.setuptools.package-data]
|
||||||
|
libyuv = ["install/**/*"]
|
||||||
58
libyuv/setup.py
Normal file
58
libyuv/setup.py
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
import os
|
||||||
|
import platform
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from setuptools.command.build_py import build_py
|
||||||
|
|
||||||
|
try:
|
||||||
|
from wheel.bdist_wheel import bdist_wheel
|
||||||
|
except ImportError:
|
||||||
|
bdist_wheel = None
|
||||||
|
|
||||||
|
|
||||||
|
class BuildLibyuv(build_py):
|
||||||
|
"""Run build.sh to compile libyuv before collecting package data."""
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
|
|
||||||
|
super().run()
|
||||||
|
|
||||||
|
|
||||||
|
cmdclass = {"build_py": BuildLibyuv}
|
||||||
|
|
||||||
|
if bdist_wheel is not None:
|
||||||
|
|
||||||
|
class PlatformWheel(bdist_wheel):
|
||||||
|
"""Produce a platform-specific, Python-version-agnostic wheel."""
|
||||||
|
|
||||||
|
def finalize_options(self):
|
||||||
|
super().finalize_options()
|
||||||
|
self.root_is_pure = False
|
||||||
|
|
||||||
|
def get_tag(self):
|
||||||
|
system = platform.system()
|
||||||
|
machine = platform.machine()
|
||||||
|
|
||||||
|
if system == "Linux":
|
||||||
|
plat = f"linux_{machine}"
|
||||||
|
elif system == "Darwin":
|
||||||
|
plat = "macosx_11_0_arm64"
|
||||||
|
else:
|
||||||
|
plat = f"{system.lower()}_{machine}"
|
||||||
|
|
||||||
|
return "py3", "none", plat
|
||||||
|
|
||||||
|
cmdclass["bdist_wheel"] = PlatformWheel
|
||||||
|
|
||||||
|
|
||||||
|
def setup():
|
||||||
|
from setuptools import setup as _setup
|
||||||
|
|
||||||
|
_setup(cmdclass=cmdclass)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
setup()
|
||||||
25
nanosvg/build.sh
Executable file
25
nanosvg/build.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
COMMIT="5cefd9847949af6df13f65027fd43af5a7513633"
|
||||||
|
INSTALL_DIR="$DIR/nanosvg/install"
|
||||||
|
|
||||||
|
# Clone/update source
|
||||||
|
if [ ! -d "nanosvg-src/.git" ]; then
|
||||||
|
rm -rf nanosvg-src
|
||||||
|
git clone --depth 1 https://github.com/memononen/nanosvg.git nanosvg-src
|
||||||
|
fi
|
||||||
|
git -C nanosvg-src fetch --depth 1 origin "$COMMIT"
|
||||||
|
git -C nanosvg-src checkout --force FETCH_HEAD
|
||||||
|
|
||||||
|
# Copy headers
|
||||||
|
rm -rf "$INSTALL_DIR"
|
||||||
|
mkdir -p "$INSTALL_DIR/include"
|
||||||
|
cp nanosvg-src/src/nanosvg.h "$INSTALL_DIR/include/"
|
||||||
|
cp nanosvg-src/src/nanosvgrast.h "$INSTALL_DIR/include/"
|
||||||
|
|
||||||
|
echo "Installed nanosvg to $INSTALL_DIR"
|
||||||
|
du -sh "$INSTALL_DIR"
|
||||||
10
nanosvg/nanosvg/__init__.py
Normal file
10
nanosvg/nanosvg/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
DIR = os.path.join(os.path.dirname(__file__), "install")
|
||||||
|
INCLUDE_DIR = os.path.join(DIR, "include")
|
||||||
|
LIB_DIR = DIR # header-only; no libraries
|
||||||
|
|
||||||
|
|
||||||
|
def smoketest():
|
||||||
|
assert os.path.isfile(os.path.join(INCLUDE_DIR, "nanosvg.h")), "nanosvg.h not found"
|
||||||
|
assert os.path.isfile(os.path.join(INCLUDE_DIR, "nanosvgrast.h")), "nanosvgrast.h not found"
|
||||||
15
nanosvg/pyproject.toml
Normal file
15
nanosvg/pyproject.toml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools>=64", "wheel"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "nanosvg"
|
||||||
|
version = "0.0.1"
|
||||||
|
description = "NanoSVG: simple SVG parser and rasterizer"
|
||||||
|
requires-python = ">=3.8"
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
include = ["nanosvg*"]
|
||||||
|
|
||||||
|
[tool.setuptools.package-data]
|
||||||
|
nanosvg = ["install/**/*"]
|
||||||
@@ -10,21 +10,18 @@ except ImportError:
|
|||||||
bdist_wheel = None
|
bdist_wheel = None
|
||||||
|
|
||||||
|
|
||||||
class BuildPython3Dev(build_py):
|
class BuildNanosvg(build_py):
|
||||||
"""Run build.sh to download CPython headers before collecting package data."""
|
"""Run build.sh to download nanosvg headers before collecting package data."""
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
marker = os.path.join(pkg_dir, "python3_dev", "install", "include", "Python.h")
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
if not os.path.exists(marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|
||||||
cmdclass = {"build_py": BuildPython3Dev}
|
cmdclass = {"build_py": BuildNanosvg}
|
||||||
|
|
||||||
if bdist_wheel is not None:
|
if bdist_wheel is not None:
|
||||||
|
|
||||||
@@ -6,32 +6,26 @@ cd "$DIR"
|
|||||||
|
|
||||||
VERSION="6.5"
|
VERSION="6.5"
|
||||||
INSTALL_DIR="$DIR/ncurses/install"
|
INSTALL_DIR="$DIR/ncurses/install"
|
||||||
|
VERSION_FILE="$DIR/ncurses-src/.version"
|
||||||
# Idempotent: skip if already built
|
|
||||||
if [ -f "$INSTALL_DIR/lib/libncurses.a" ]; then
|
|
||||||
echo "ncurses already present, skipping build."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
||||||
|
export CC="ccache ${CC:-cc}"
|
||||||
|
|
||||||
# Download
|
# Download tarball (v6.5 tag doesn't exist on the GitHub mirror)
|
||||||
TARBALL="ncurses-${VERSION}.tar.gz"
|
if [ ! -f "$VERSION_FILE" ] || [ "$(cat "$VERSION_FILE")" != "$VERSION" ]; then
|
||||||
if [ ! -f "$TARBALL" ]; then
|
rm -rf ncurses-src
|
||||||
curl -fsSL "https://ftp.gnu.org/gnu/ncurses/${TARBALL}" -o "$TARBALL"
|
mkdir -p ncurses-src
|
||||||
fi
|
curl -fSL "https://ftp.gnu.org/gnu/ncurses/ncurses-${VERSION}.tar.gz" \
|
||||||
|
| tar xz --strip-components=1 -C ncurses-src
|
||||||
# Extract
|
echo "$VERSION" > "$VERSION_FILE"
|
||||||
if [ ! -d "ncurses-${VERSION}" ]; then
|
|
||||||
tar xf "$TARBALL"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
PREFIX="$DIR/build/prefix"
|
PREFIX="$DIR/build/prefix"
|
||||||
mkdir -p "$DIR/build"
|
mkdir -p "$DIR/build"
|
||||||
|
|
||||||
cd "ncurses-${VERSION}"
|
cd ncurses-src
|
||||||
./configure \
|
CFLAGS="-fPIC" ./configure \
|
||||||
--prefix="$PREFIX" \
|
--prefix="$PREFIX" \
|
||||||
--without-shared \
|
--without-shared \
|
||||||
--with-normal \
|
--with-normal \
|
||||||
@@ -66,8 +60,5 @@ cp "$PREFIX/include/unctrl.h" "$INSTALL_DIR/include/"
|
|||||||
cp "$PREFIX/include/term.h" "$INSTALL_DIR/include/"
|
cp "$PREFIX/include/term.h" "$INSTALL_DIR/include/"
|
||||||
cp "$PREFIX/include/termcap.h" "$INSTALL_DIR/include/"
|
cp "$PREFIX/include/termcap.h" "$INSTALL_DIR/include/"
|
||||||
|
|
||||||
# Clean up
|
|
||||||
rm -rf "ncurses-${VERSION}" "$TARBALL" "$DIR/build"
|
|
||||||
|
|
||||||
echo "Installed ncurses to $INSTALL_DIR"
|
echo "Installed ncurses to $INSTALL_DIR"
|
||||||
du -sh "$INSTALL_DIR"
|
du -sh "$INSTALL_DIR"
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ class BuildNcurses(build_py):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
marker = os.path.join(pkg_dir, "ncurses", "install", "lib", "libncurses.a")
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
if not os.path.exists(marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
|
||||||
cd "$DIR"
|
|
||||||
|
|
||||||
VERSION="3.4.1"
|
|
||||||
INSTALL_DIR="$DIR/openssl3/install"
|
|
||||||
|
|
||||||
# Idempotent: skip if already built
|
|
||||||
if [ -f "$INSTALL_DIR/lib/libcrypto.a" ]; then
|
|
||||||
echo "openssl already present, skipping build."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
|
||||||
|
|
||||||
# Download
|
|
||||||
TARBALL="openssl-${VERSION}.tar.gz"
|
|
||||||
if [ ! -d "openssl-src" ]; then
|
|
||||||
curl -fSL -o "$TARBALL" "https://github.com/openssl/openssl/releases/download/openssl-${VERSION}/${TARBALL}"
|
|
||||||
mkdir -p openssl-src
|
|
||||||
tar -xf "$TARBALL" -C openssl-src --strip-components=1
|
|
||||||
rm -f "$TARBALL"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Configure
|
|
||||||
PREFIX="$DIR/build/prefix"
|
|
||||||
cd openssl-src
|
|
||||||
|
|
||||||
if [ "$(uname)" = "Darwin" ]; then
|
|
||||||
TARGET="darwin64-arm64-cc"
|
|
||||||
else
|
|
||||||
MACHINE="$(uname -m)"
|
|
||||||
if [ "$MACHINE" = "x86_64" ]; then
|
|
||||||
TARGET="linux-x86_64"
|
|
||||||
elif [ "$MACHINE" = "aarch64" ]; then
|
|
||||||
TARGET="linux-aarch64"
|
|
||||||
else
|
|
||||||
TARGET="linux-${MACHINE}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
./Configure "$TARGET" \
|
|
||||||
--prefix="$PREFIX" \
|
|
||||||
--libdir=lib \
|
|
||||||
no-shared \
|
|
||||||
no-tests \
|
|
||||||
no-docs \
|
|
||||||
no-apps \
|
|
||||||
-Os
|
|
||||||
|
|
||||||
# Build
|
|
||||||
make -j"$NJOBS"
|
|
||||||
make install_sw
|
|
||||||
|
|
||||||
cd "$DIR"
|
|
||||||
|
|
||||||
# Copy to package install dir
|
|
||||||
rm -rf "$INSTALL_DIR"
|
|
||||||
mkdir -p "$INSTALL_DIR"/{lib,include}
|
|
||||||
|
|
||||||
# Libraries
|
|
||||||
cp "$PREFIX/lib/libcrypto.a" "$INSTALL_DIR/lib/"
|
|
||||||
cp "$PREFIX/lib/libssl.a" "$INSTALL_DIR/lib/"
|
|
||||||
|
|
||||||
# Headers
|
|
||||||
cp -r "$PREFIX/include/openssl" "$INSTALL_DIR/include/"
|
|
||||||
|
|
||||||
# Clean up
|
|
||||||
rm -rf openssl-src "$DIR/build"
|
|
||||||
|
|
||||||
echo "Installed openssl to $INSTALL_DIR"
|
|
||||||
du -sh "$INSTALL_DIR"
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import os
|
|
||||||
|
|
||||||
DIR = os.path.join(os.path.dirname(__file__), "install")
|
|
||||||
LIB_DIR = os.path.join(DIR, "lib")
|
|
||||||
INCLUDE_DIR = os.path.join(DIR, "include")
|
|
||||||
|
|
||||||
|
|
||||||
def smoketest():
|
|
||||||
assert os.path.isfile(os.path.join(LIB_DIR, "libcrypto.a")), "libcrypto.a not found"
|
|
||||||
assert os.path.isfile(os.path.join(LIB_DIR, "libssl.a")), "libssl.a not found"
|
|
||||||
assert os.path.isdir(os.path.join(INCLUDE_DIR, "openssl")), "openssl headers not found"
|
|
||||||
19
pyproject.toml
Normal file
19
pyproject.toml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[tool.uv.workspace]
|
||||||
|
members = [
|
||||||
|
"bzip2",
|
||||||
|
"capnproto",
|
||||||
|
"cppcheck",
|
||||||
|
"eigen",
|
||||||
|
"ffmpeg",
|
||||||
|
"gcc-arm-none-eabi",
|
||||||
|
"git-lfs",
|
||||||
|
"imgui",
|
||||||
|
"json11",
|
||||||
|
"libjpeg",
|
||||||
|
"libyuv",
|
||||||
|
"nanosvg",
|
||||||
|
"ncurses",
|
||||||
|
"raylib",
|
||||||
|
"zeromq",
|
||||||
|
"zstd",
|
||||||
|
]
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
|
||||||
cd "$DIR"
|
|
||||||
|
|
||||||
VERSION="3.12.8"
|
|
||||||
INSTALL_DIR="$DIR/python3_dev/install"
|
|
||||||
|
|
||||||
# Idempotent: skip if already present
|
|
||||||
if [ -f "$INSTALL_DIR/include/Python.h" ]; then
|
|
||||||
echo "python3-dev headers already present, skipping."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
TARBALL="Python-${VERSION}.tgz"
|
|
||||||
URL="https://www.python.org/ftp/python/${VERSION}/${TARBALL}"
|
|
||||||
|
|
||||||
echo "Downloading CPython ${VERSION} source ..."
|
|
||||||
curl -fSL -o "$TARBALL" "$URL"
|
|
||||||
|
|
||||||
echo "Extracting ..."
|
|
||||||
tar xzf "$TARBALL"
|
|
||||||
|
|
||||||
cd "Python-${VERSION}"
|
|
||||||
|
|
||||||
# Run configure to generate pyconfig.h for this platform
|
|
||||||
echo "Running configure to generate pyconfig.h ..."
|
|
||||||
./configure --disable-shared --without-ensurepip > /dev/null 2>&1
|
|
||||||
|
|
||||||
cd "$DIR"
|
|
||||||
|
|
||||||
# Copy headers
|
|
||||||
rm -rf "$INSTALL_DIR"
|
|
||||||
mkdir -p "$INSTALL_DIR/include"
|
|
||||||
|
|
||||||
cp -r "Python-${VERSION}/Include/"* "$INSTALL_DIR/include/"
|
|
||||||
cp "Python-${VERSION}/pyconfig.h" "$INSTALL_DIR/include/"
|
|
||||||
|
|
||||||
# Clean up
|
|
||||||
rm -rf "Python-${VERSION}" "$TARBALL"
|
|
||||||
|
|
||||||
echo "Installed python3-dev headers to $INSTALL_DIR"
|
|
||||||
du -sh "$INSTALL_DIR"
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import os
|
|
||||||
|
|
||||||
DIR = os.path.join(os.path.dirname(__file__), "install")
|
|
||||||
INCLUDE_DIR = os.path.join(DIR, "include")
|
|
||||||
|
|
||||||
|
|
||||||
def smoketest():
|
|
||||||
assert os.path.isfile(os.path.join(INCLUDE_DIR, "Python.h")), "Python.h not found"
|
|
||||||
assert os.path.isfile(os.path.join(INCLUDE_DIR, "pyconfig.h")), "pyconfig.h not found"
|
|
||||||
4
raylib/.gitignore
vendored
Normal file
4
raylib/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
raylib-src/
|
||||||
|
raylib/install/
|
||||||
|
raylib/*.modified
|
||||||
|
raylib/_raylib_cffi*
|
||||||
121
raylib/build.sh
Executable file
121
raylib/build.sh
Executable file
@@ -0,0 +1,121 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
INSTALL_DIR="$DIR/raylib/install"
|
||||||
|
|
||||||
|
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
||||||
|
CC="ccache ${CC:-cc}"
|
||||||
|
|
||||||
|
# Detect platform: PLATFORM_COMMA for comma devices, PLATFORM_DESKTOP otherwise
|
||||||
|
RAYLIB_PLATFORM="${RAYLIB_PLATFORM:-PLATFORM_DESKTOP}"
|
||||||
|
if [ -f /TICI ]; then
|
||||||
|
RAYLIB_PLATFORM="PLATFORM_COMMA"
|
||||||
|
fi
|
||||||
|
export RAYLIB_PLATFORM
|
||||||
|
|
||||||
|
# Install build dependencies
|
||||||
|
if [[ "$(uname)" == "Linux" ]]; then
|
||||||
|
if [ "$RAYLIB_PLATFORM" = "PLATFORM_COMMA" ]; then
|
||||||
|
# comma device: needs DRM/EGL/GLES headers (usually already present on AGNOS)
|
||||||
|
# apt may fail on devices due to read-only rootfs or package conflicts — that's OK
|
||||||
|
if command -v apt-get &>/dev/null; then
|
||||||
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
apt-get update && apt-get install -y libdrm-dev libgbm-dev libgles2-mesa-dev libegl1-mesa-dev || true
|
||||||
|
else
|
||||||
|
sudo apt-get update && sudo apt-get install -y libdrm-dev libgbm-dev libgles2-mesa-dev libegl1-mesa-dev || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
elif [ "$RAYLIB_PLATFORM" = "PLATFORM_OFFSCREEN" ]; then
|
||||||
|
# offscreen (CI): needs EGL/GL dev packages (no X11)
|
||||||
|
if command -v apt-get &>/dev/null; then
|
||||||
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
apt-get update && apt-get install -y libegl-dev libgl-dev
|
||||||
|
else
|
||||||
|
sudo apt-get update && sudo apt-get install -y libegl-dev libgl-dev
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# desktop: needs X11/GL dev packages
|
||||||
|
if command -v dnf &>/dev/null; then
|
||||||
|
dnf install -y libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel libXi-devel mesa-libGL-devel
|
||||||
|
elif command -v apt-get &>/dev/null; then
|
||||||
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
apt-get update && apt-get install -y libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libgl-dev
|
||||||
|
else
|
||||||
|
sudo apt-get update && sudo apt-get install -y libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libgl-dev
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Clone and build raylib C library
|
||||||
|
RAYLIB_COMMIT="d9d7cc1353ec0f73c97e84ddf0973983d1ee25e2"
|
||||||
|
|
||||||
|
if [ ! -d "raylib-src/.git" ]; then
|
||||||
|
rm -rf raylib-src
|
||||||
|
git clone --depth 1 -b platform-offscreen --no-tags https://github.com/commaai/raylib.git raylib-src
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd raylib-src
|
||||||
|
git fetch --depth 1 origin "$RAYLIB_COMMIT"
|
||||||
|
git reset --hard "$RAYLIB_COMMIT"
|
||||||
|
|
||||||
|
cd src
|
||||||
|
make clean
|
||||||
|
make -j"$NJOBS" PLATFORM="$RAYLIB_PLATFORM" CC="${CC:-gcc}"
|
||||||
|
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
# Install lib + headers
|
||||||
|
rm -rf "$INSTALL_DIR"
|
||||||
|
mkdir -p "$INSTALL_DIR"/{lib,include}
|
||||||
|
|
||||||
|
cp raylib-src/src/libraylib.a "$INSTALL_DIR/lib/"
|
||||||
|
cp raylib-src/src/raylib.h raylib-src/src/raymath.h raylib-src/src/rlgl.h "$INSTALL_DIR/include/"
|
||||||
|
|
||||||
|
# On x86_64 Linux, also build the offscreen variant for CI headless rendering
|
||||||
|
if [[ "$(uname)" == "Linux" && "$(uname -m)" == "x86_64" && "$RAYLIB_PLATFORM" != "PLATFORM_OFFSCREEN" ]]; then
|
||||||
|
echo "Building offscreen variant..."
|
||||||
|
|
||||||
|
# Install EGL/GL dev packages needed for offscreen build + bundling
|
||||||
|
if command -v dnf &>/dev/null; then
|
||||||
|
dnf install -y mesa-libEGL-devel mesa-libGL-devel libglvnd-opengl libglvnd-core-devel 2>/dev/null || true
|
||||||
|
elif command -v apt-get &>/dev/null; then
|
||||||
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
apt-get update && apt-get install -y libegl-dev libgl-dev
|
||||||
|
else
|
||||||
|
sudo apt-get update && sudo apt-get install -y libegl-dev libgl-dev
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd raylib-src/src
|
||||||
|
make clean
|
||||||
|
make -j"$NJOBS" PLATFORM=PLATFORM_OFFSCREEN CC="${CC:-gcc}"
|
||||||
|
cp libraylib.a "$INSTALL_DIR/lib/libraylib_offscreen.a"
|
||||||
|
cd "$DIR"
|
||||||
|
|
||||||
|
# Bundle GLVND dispatchers so offscreen rendering works without extra system packages
|
||||||
|
MESA_DIR="$INSTALL_DIR/lib/mesa"
|
||||||
|
mkdir -p "$MESA_DIR"
|
||||||
|
ldconfig 2>/dev/null || true
|
||||||
|
for lib in libEGL.so.1 libOpenGL.so.0 libGLdispatch.so.0; do
|
||||||
|
src="$(ldconfig -p 2>/dev/null | grep "$lib" | grep -E 'x86.64|libc6,' | awk '{print $NF}' | head -1)"
|
||||||
|
if [ -n "$src" ] && [ -f "$src" ]; then
|
||||||
|
cp -L "$src" "$MESA_DIR/"
|
||||||
|
# Create unversioned symlink for the linker
|
||||||
|
base="${lib%%.so.*}"
|
||||||
|
ln -sf "$lib" "$MESA_DIR/${base}.so"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Download raygui header
|
||||||
|
RAYGUI_COMMIT="76b36b597edb70ffaf96f046076adc20d67e7827"
|
||||||
|
curl -fsSLo "$INSTALL_DIR/include/raygui.h" \
|
||||||
|
"https://raw.githubusercontent.com/raysan5/raygui/$RAYGUI_COMMIT/src/raygui.h"
|
||||||
|
|
||||||
|
echo "Installed raylib to $INSTALL_DIR"
|
||||||
|
du -sh "$INSTALL_DIR"
|
||||||
16
raylib/pyproject.toml
Normal file
16
raylib/pyproject.toml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools>=64", "wheel", "cffi>=1.17.1"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "raylib"
|
||||||
|
version = "5.5.0.8"
|
||||||
|
description = "raylib + pyray Python bindings (commaai fork)"
|
||||||
|
requires-python = ">=3.8"
|
||||||
|
dependencies = ["cffi>=1.17.1"]
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
include = ["raylib*", "pyray*"]
|
||||||
|
|
||||||
|
[tool.setuptools.package-data]
|
||||||
|
raylib = ["install/**/*", "_raylib_cffi*.so"]
|
||||||
159
raylib/pyray/__init__.py
Normal file
159
raylib/pyray/__init__.py
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
# Copyright (c) 2021 Richard Smith and others
|
||||||
|
#
|
||||||
|
# This program and the accompanying materials are made available under the
|
||||||
|
# terms of the Eclipse Public License 2.0 which is available at
|
||||||
|
# http://www.eclipse.org/legal/epl-2.0.
|
||||||
|
#
|
||||||
|
# This Source Code may also be made available under the following Secondary
|
||||||
|
# licenses when the conditions for such availability set forth in the Eclipse
|
||||||
|
# Public License, v. 2.0 are satisfied: GNU General Public License, version 2
|
||||||
|
# with the GNU Classpath Exception which is
|
||||||
|
# available at https://www.gnu.org/software/classpath/license.html.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
||||||
|
import re
|
||||||
|
import weakref
|
||||||
|
from array import array
|
||||||
|
|
||||||
|
from raylib import rl, ffi
|
||||||
|
from raylib.colors import *
|
||||||
|
|
||||||
|
try:
|
||||||
|
from raylib.defines import *
|
||||||
|
except AttributeError:
|
||||||
|
print("sorry deprecated enums dont work on dynamic version")
|
||||||
|
|
||||||
|
from inspect import getmembers, isbuiltin
|
||||||
|
|
||||||
|
current_module = __import__(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def _underscore(word: str) -> str:
|
||||||
|
word = re.sub('2D$', '_2d', word)
|
||||||
|
word = re.sub('3D$', '_3d', word)
|
||||||
|
word = re.sub(r"([A-Z]+)([A-Z][a-z])", r'\1_\2', word)
|
||||||
|
word = re.sub(r"([a-z\d])([A-Z])", r'\1_\2', word)
|
||||||
|
word = word.replace("-", "_")
|
||||||
|
return word.lower()
|
||||||
|
|
||||||
|
|
||||||
|
def _wrap_function(original_func):
|
||||||
|
c_args = [str(x) for x in ffi.typeof(original_func).args]
|
||||||
|
number_of_args = len(c_args)
|
||||||
|
c_arg_is_pointer = [x.kind == 'pointer' for x in ffi.typeof(original_func).args]
|
||||||
|
c_arg_is_string = [str(x) == "<ctype 'char *'>" for x in ffi.typeof(original_func).args]
|
||||||
|
# c_arg_is_void_pointer = [str(x) == "<ctype 'void *'>" for x in ffi.typeof(original_func).args]
|
||||||
|
|
||||||
|
def wrapped_func(*args):
|
||||||
|
args = list(args) # tuple is immutable, converting it to mutable list is faster than constructing new list!
|
||||||
|
for i in range(number_of_args):
|
||||||
|
try:
|
||||||
|
arg = args[i]
|
||||||
|
except IndexError:
|
||||||
|
raise RuntimeError(f"function requires {number_of_args} arguments but you supplied {len(args)}")
|
||||||
|
if c_arg_is_pointer[i]:
|
||||||
|
if c_arg_is_string[i]: # we assume c_arg is 'const char *'
|
||||||
|
try: # if it's a non-const 'char *' then user should be supplying a ctype pointer, not a Python
|
||||||
|
# string
|
||||||
|
args[i] = arg.encode('utf-8') # in that case this conversion will fail
|
||||||
|
except AttributeError: # but those functions are uncommon, so quicker on average to try the
|
||||||
|
# conversion
|
||||||
|
pass # and ignore the exception
|
||||||
|
# if user supplied a Python string but c_arg is a 'char *' not a 'const char *' then we ought to raise
|
||||||
|
# exception because its an out
|
||||||
|
# parameter and user should supply a ctype pointer, but we cant because cffi cant detect 'const'
|
||||||
|
# so we would have to get the info from raylib.json
|
||||||
|
elif c_args[i] == "<ctype 'char * *'>" and type(arg) is list:
|
||||||
|
args[i] = [ffi.new("char[]", x.encode('utf-8')) for x in arg]
|
||||||
|
elif is_cdata(arg) and "*" not in str(arg):
|
||||||
|
args[i] = ffi.addressof(arg)
|
||||||
|
elif arg is None:
|
||||||
|
args[i] = ffi.NULL
|
||||||
|
elif not is_cdata(arg):
|
||||||
|
if c_args[i] == "<ctype '_Bool *'>":
|
||||||
|
raise TypeError(
|
||||||
|
f"Argument {i} ({arg}) must be a ctype bool, please create one with: pyray.ffi.new('bool "
|
||||||
|
f"*', True)")
|
||||||
|
elif c_args[i] == "<ctype 'int *'>":
|
||||||
|
raise TypeError(
|
||||||
|
f"Argument {i} ({arg}) must be a ctype int, please create one with: pyray.ffi.new('int "
|
||||||
|
f"*', 1)")
|
||||||
|
elif c_args[i] == "<ctype 'float *'>":
|
||||||
|
raise TypeError(
|
||||||
|
f"Argument {i} ({arg}) must be a ctype float, please create one with: pyray.ffi.new("
|
||||||
|
f"'float *', 1.0)")
|
||||||
|
elif c_args[i] == "<ctype 'void *'>":
|
||||||
|
# we could assume it's a string and try to convert it but we would have to be sure it's
|
||||||
|
# const. that seems reasonable assumption for char* but i'm not confident it is for void*
|
||||||
|
raise TypeError(
|
||||||
|
f"Argument {i} ({arg}) must be a cdata pointer. Type is void so I don't know what type it "
|
||||||
|
f"should be."
|
||||||
|
"If it's a const string you can create it with pyray.ffi.new('char []', b\"whatever\") . "
|
||||||
|
"If it's a float you can create it with pyray.ffi.new('float *', 1.0)")
|
||||||
|
|
||||||
|
result = original_func(*args)
|
||||||
|
if result is None:
|
||||||
|
return
|
||||||
|
elif is_cdata(result) and str(result).startswith("<cdata 'char *'"):
|
||||||
|
if str(result) == "<cdata 'char *' NULL>":
|
||||||
|
return ""
|
||||||
|
else:
|
||||||
|
return ffi.string(result).decode('utf-8')
|
||||||
|
else:
|
||||||
|
return result
|
||||||
|
|
||||||
|
# apparently pypy and cpython produce different types so check for both
|
||||||
|
def is_cdata(arg):
|
||||||
|
return str(type(arg)) == "<class '_cffi_backend.__CDataOwn'>" or str(
|
||||||
|
type(arg)) == "<class '_cffi_backend._CDataBase'>"
|
||||||
|
|
||||||
|
return wrapped_func
|
||||||
|
|
||||||
|
|
||||||
|
global_weakkeydict = weakref.WeakKeyDictionary()
|
||||||
|
|
||||||
|
|
||||||
|
def _make_struct_constructor_function(struct):
|
||||||
|
def func(*args):
|
||||||
|
# print(struct, args)
|
||||||
|
modified_args = []
|
||||||
|
for (field, arg) in zip(ffi.typeof(struct).fields, args):
|
||||||
|
# print("arg:", str(arg), "field:", field[1], "field type:", field[1].type, "type(arg):", str(type(arg)))
|
||||||
|
if arg is None:
|
||||||
|
arg = ffi.NULL
|
||||||
|
elif (field[1].type.kind == 'pointer'
|
||||||
|
and (str(type(arg)) == "<class 'numpy.ndarray'>"
|
||||||
|
or isinstance(arg, (array, bytes, bytearray, memoryview)))):
|
||||||
|
arg = ffi.from_buffer(field[1].type, arg)
|
||||||
|
modified_args.append(arg)
|
||||||
|
s = ffi.new(f"struct {struct} *", modified_args)[0]
|
||||||
|
global_weakkeydict[s] = modified_args
|
||||||
|
return s
|
||||||
|
|
||||||
|
return func
|
||||||
|
|
||||||
|
|
||||||
|
for name, attr in getmembers(rl):
|
||||||
|
# print(name, attr)
|
||||||
|
uname = _underscore(name)
|
||||||
|
if isbuiltin(attr) or str(type(attr)) == "<class '_cffi_backend.__FFIFunctionWrapper'>" or str(
|
||||||
|
type(attr)) == "<class '_cffi_backend._CDataBase'>":
|
||||||
|
# print(attr.__call__)
|
||||||
|
# print(attr.__doc__)
|
||||||
|
# print(dir(attr))
|
||||||
|
# print(dir(attr.__repr__))
|
||||||
|
f = _wrap_function(attr)
|
||||||
|
setattr(current_module, uname, f)
|
||||||
|
else:
|
||||||
|
setattr(current_module, name, attr)
|
||||||
|
|
||||||
|
for struct in ffi.list_types()[0]:
|
||||||
|
f = _make_struct_constructor_function(struct)
|
||||||
|
setattr(current_module, struct, f)
|
||||||
|
|
||||||
|
# overwrite ffi enums with our own
|
||||||
|
from raylib.enums import *
|
||||||
|
|
||||||
|
|
||||||
|
def text_format(*args):
|
||||||
|
raise RuntimeError("Use Python f-strings etc rather than calling text_format().")
|
||||||
71
raylib/raylib/__init__.py
Normal file
71
raylib/raylib/__init__.py
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
import os
|
||||||
|
import platform as _platform
|
||||||
|
|
||||||
|
DIR = os.path.join(os.path.dirname(__file__), "install")
|
||||||
|
LIB_DIR = os.path.join(DIR, "lib")
|
||||||
|
INCLUDE_DIR = os.path.join(DIR, "include")
|
||||||
|
|
||||||
|
|
||||||
|
def _detect_platform():
|
||||||
|
"""Auto-detect the raylib platform. In CI on Linux x86_64, use offscreen EGL rendering."""
|
||||||
|
explicit = os.environ.get("RAYLIB_PLATFORM", "")
|
||||||
|
if explicit:
|
||||||
|
return explicit
|
||||||
|
if os.environ.get("CI") and _platform.system() == "Linux" and _platform.machine() == "x86_64":
|
||||||
|
return "PLATFORM_OFFSCREEN"
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
def smoketest():
|
||||||
|
assert os.path.isfile(os.path.join(LIB_DIR, "libraylib.a")), "libraylib.a not found"
|
||||||
|
assert os.path.isfile(os.path.join(INCLUDE_DIR, "raylib.h")), "raylib.h not found"
|
||||||
|
|
||||||
|
|
||||||
|
# Build CFFI extension on first import if not already compiled,
|
||||||
|
# or rebuild if the target platform changed since last build.
|
||||||
|
def _ensure_cffi_built():
|
||||||
|
import glob
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
pkg_dir = os.path.dirname(__file__)
|
||||||
|
platform_marker = os.path.join(pkg_dir, ".raylib_platform")
|
||||||
|
requested = _detect_platform()
|
||||||
|
|
||||||
|
# Export so build.py picks it up
|
||||||
|
if requested:
|
||||||
|
os.environ["RAYLIB_PLATFORM"] = requested
|
||||||
|
# Mesa llvmpipe for software rendering in headless CI
|
||||||
|
if requested == "PLATFORM_OFFSCREEN":
|
||||||
|
os.environ.setdefault("LIBGL_ALWAYS_SOFTWARE", "1")
|
||||||
|
|
||||||
|
cffi_files = glob.glob(os.path.join(pkg_dir, "_raylib_cffi*"))
|
||||||
|
|
||||||
|
# Rebuild if platform changed
|
||||||
|
if cffi_files and requested:
|
||||||
|
built_for = open(platform_marker).read().strip() if os.path.isfile(platform_marker) else ""
|
||||||
|
if built_for != requested:
|
||||||
|
for f in cffi_files:
|
||||||
|
os.remove(f)
|
||||||
|
cffi_files = []
|
||||||
|
|
||||||
|
if not cffi_files:
|
||||||
|
build_script = os.path.join(pkg_dir, "build.py")
|
||||||
|
if os.path.isfile(build_script) and os.path.isfile(os.path.join(LIB_DIR, "libraylib.a")):
|
||||||
|
try:
|
||||||
|
subprocess.check_call([sys.executable, build_script], cwd=os.path.dirname(pkg_dir))
|
||||||
|
with open(platform_marker, "w") as f:
|
||||||
|
f.write(requested)
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
_ensure_cffi_built()
|
||||||
|
|
||||||
|
# CFFI bindings (available when graphics libraries are present)
|
||||||
|
try:
|
||||||
|
from ._raylib_cffi import ffi, lib as rl
|
||||||
|
from raylib._raylib_cffi.lib import * # noqa: F403
|
||||||
|
from raylib.colors import * # noqa: F403
|
||||||
|
from raylib.defines import * # noqa: F403
|
||||||
|
from .version import __version__
|
||||||
|
except (ImportError, OSError):
|
||||||
|
pass
|
||||||
137
raylib/raylib/build.py
Normal file
137
raylib/raylib/build.py
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
# Based on commaai/raylib-python-cffi (commit ab0191f)
|
||||||
|
# Modified to use local install paths and compile standalone (no cffi_modules)
|
||||||
|
|
||||||
|
import re
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
|
import subprocess
|
||||||
|
import time
|
||||||
|
|
||||||
|
from cffi import FFI
|
||||||
|
|
||||||
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
RAYLIB_INCLUDE_PATH = os.path.join(HERE, "install", "include")
|
||||||
|
RAYLIB_LIB_PATH = os.path.join(HERE, "install", "lib")
|
||||||
|
RAYLIB_PLATFORM = os.getenv("RAYLIB_PLATFORM", "")
|
||||||
|
|
||||||
|
ffibuilder = FFI()
|
||||||
|
|
||||||
|
|
||||||
|
def check_raylib_installed():
|
||||||
|
return os.path.isfile(os.path.join(RAYLIB_LIB_PATH, 'libraylib.a'))
|
||||||
|
|
||||||
|
|
||||||
|
def pre_process_header(filename, remove_function_bodies=False):
|
||||||
|
print("Pre-processing " + filename)
|
||||||
|
file = open(filename, "r")
|
||||||
|
filetext = "".join([line for line in file if '#include' not in line])
|
||||||
|
command = ['gcc', '-CC', '-P', '-undef', '-nostdinc', '-DRL_MATRIX_TYPE',
|
||||||
|
'-DRL_QUATERNION_TYPE', '-DRL_VECTOR4_TYPE', '-DRL_VECTOR3_TYPE', '-DRL_VECTOR2_TYPE',
|
||||||
|
'-DRLAPI=', '-DPHYSACDEF=', '-DRAYGUIDEF=', '-DRMAPI=',
|
||||||
|
'-dDI', '-E', '-']
|
||||||
|
filetext = subprocess.run(command, text=True, input=filetext, stdout=subprocess.PIPE).stdout
|
||||||
|
filetext = filetext.replace("va_list", "void *")
|
||||||
|
if remove_function_bodies:
|
||||||
|
filetext = re.sub('\n{\n(.|\n)*?\n}\n', ';', filetext)
|
||||||
|
filetext = "\n".join([line for line in filetext.splitlines() if not line.startswith("#")])
|
||||||
|
modified_path = os.path.join(HERE, os.path.basename(filename) + ".modified")
|
||||||
|
with open(modified_path, "w") as f:
|
||||||
|
f.write(filetext)
|
||||||
|
return filetext
|
||||||
|
|
||||||
|
|
||||||
|
def check_header_exists(file):
|
||||||
|
if not os.path.isfile(file):
|
||||||
|
print(f"\nWARNING: {file} not found. Build will not contain these extra functions.\n")
|
||||||
|
time.sleep(1)
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def build_ffi():
|
||||||
|
"""Set up the FFI builder. Must be called after libraylib.a and headers exist."""
|
||||||
|
if not check_raylib_installed():
|
||||||
|
raise Exception("ERROR: raylib not found. Please run build.sh first.")
|
||||||
|
|
||||||
|
raylib_h = os.path.join(RAYLIB_INCLUDE_PATH, "raylib.h")
|
||||||
|
rlgl_h = os.path.join(RAYLIB_INCLUDE_PATH, "rlgl.h")
|
||||||
|
raymath_h = os.path.join(RAYLIB_INCLUDE_PATH, "raymath.h")
|
||||||
|
|
||||||
|
for h in (raylib_h, rlgl_h, raymath_h):
|
||||||
|
if not os.path.isfile(h):
|
||||||
|
raise Exception(f"ERROR: {h} not found. Please run build.sh first.")
|
||||||
|
|
||||||
|
ffi_includes = """
|
||||||
|
#include "raylib.h"
|
||||||
|
#include "rlgl.h"
|
||||||
|
#include "raymath.h"
|
||||||
|
"""
|
||||||
|
|
||||||
|
raygui_h = os.path.join(RAYLIB_INCLUDE_PATH, "raygui.h")
|
||||||
|
if check_header_exists(raygui_h):
|
||||||
|
ffi_includes += """
|
||||||
|
#define RAYGUI_IMPLEMENTATION
|
||||||
|
#define RAYGUI_SUPPORT_RICONS
|
||||||
|
#include "raygui.h"
|
||||||
|
"""
|
||||||
|
|
||||||
|
ffibuilder.cdef(pre_process_header(raylib_h))
|
||||||
|
ffibuilder.cdef(pre_process_header(rlgl_h))
|
||||||
|
ffibuilder.cdef(pre_process_header(raymath_h, True))
|
||||||
|
|
||||||
|
if os.path.isfile(raygui_h):
|
||||||
|
ffibuilder.cdef(pre_process_header(raygui_h))
|
||||||
|
|
||||||
|
if platform.system() == "Darwin":
|
||||||
|
print("BUILDING FOR MAC")
|
||||||
|
extra_link_args = [
|
||||||
|
os.path.join(RAYLIB_LIB_PATH, 'libraylib.a'),
|
||||||
|
'-framework', 'OpenGL',
|
||||||
|
'-framework', 'Cocoa',
|
||||||
|
'-framework', 'IOKit',
|
||||||
|
'-framework', 'CoreFoundation',
|
||||||
|
'-framework', 'CoreVideo',
|
||||||
|
]
|
||||||
|
libraries = []
|
||||||
|
extra_compile_args = ["-Wno-error=incompatible-function-pointer-types"]
|
||||||
|
else:
|
||||||
|
print("BUILDING FOR LINUX")
|
||||||
|
extra_link_args = [
|
||||||
|
f'-L{RAYLIB_LIB_PATH}', '-lraylib',
|
||||||
|
'-lm', '-lpthread', '-lGL',
|
||||||
|
'-lrt', '-ldl', '-lpthread', '-latomic',
|
||||||
|
]
|
||||||
|
if RAYLIB_PLATFORM == "PLATFORM_COMMA":
|
||||||
|
extra_link_args.remove('-lGL')
|
||||||
|
extra_link_args += ['-lGLESv2', '-lEGL', '-lgbm', '-ldrm']
|
||||||
|
elif RAYLIB_PLATFORM == "PLATFORM_OFFSCREEN":
|
||||||
|
# Use offscreen variant if available, otherwise fall back to default
|
||||||
|
offscreen_lib = os.path.join(RAYLIB_LIB_PATH, 'libraylib_offscreen.a')
|
||||||
|
if os.path.isfile(offscreen_lib):
|
||||||
|
extra_link_args[extra_link_args.index('-lraylib')] = '-lraylib_offscreen'
|
||||||
|
extra_link_args.remove('-lGL')
|
||||||
|
# Use bundled GLVND dispatchers if available, with RPATH for runtime
|
||||||
|
mesa_dir = os.path.join(RAYLIB_LIB_PATH, 'mesa')
|
||||||
|
if os.path.isdir(mesa_dir):
|
||||||
|
extra_link_args += [f'-L{mesa_dir}', f'-Wl,-rpath,$ORIGIN/install/lib/mesa']
|
||||||
|
extra_link_args += ['-lOpenGL', '-lEGL']
|
||||||
|
else:
|
||||||
|
extra_link_args += ['-lX11']
|
||||||
|
extra_compile_args = ["-Wno-incompatible-pointer-types"]
|
||||||
|
libraries = []
|
||||||
|
|
||||||
|
print("extra_link_args: " + str(extra_link_args))
|
||||||
|
ffibuilder.set_source("raylib._raylib_cffi",
|
||||||
|
ffi_includes,
|
||||||
|
py_limited_api=True,
|
||||||
|
include_dirs=[RAYLIB_INCLUDE_PATH],
|
||||||
|
extra_link_args=extra_link_args,
|
||||||
|
extra_compile_args=extra_compile_args,
|
||||||
|
libraries=libraries)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
build_ffi()
|
||||||
|
# compile with output going to the package root (parent of raylib/)
|
||||||
|
pkg_root = os.path.dirname(HERE)
|
||||||
|
ffibuilder.compile(verbose=True, tmpdir=pkg_root)
|
||||||
41
raylib/raylib/colors.py
Normal file
41
raylib/raylib/colors.py
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# Copyright (c) 2021 Richard Smith and others
|
||||||
|
#
|
||||||
|
# This program and the accompanying materials are made available under the
|
||||||
|
# terms of the Eclipse Public License 2.0 which is available at
|
||||||
|
# http://www.eclipse.org/legal/epl-2.0.
|
||||||
|
#
|
||||||
|
# This Source Code may also be made available under the following Secondary
|
||||||
|
# licenses when the conditions for such availability set forth in the Eclipse
|
||||||
|
# Public License, v. 2.0 are satisfied: GNU General Public License, version 2
|
||||||
|
# with the GNU Classpath Exception which is
|
||||||
|
# available at https://www.gnu.org/software/classpath/license.html.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
||||||
|
|
||||||
|
LIGHTGRAY =( 200, 200, 200, 255 )
|
||||||
|
GRAY =( 130, 130, 130, 255 )
|
||||||
|
DARKGRAY =( 80, 80, 80, 255 )
|
||||||
|
YELLOW =( 253, 249, 0, 255 )
|
||||||
|
GOLD =( 255, 203, 0, 255 )
|
||||||
|
ORANGE =( 255, 161, 0, 255 )
|
||||||
|
PINK =( 255, 109, 194, 255 )
|
||||||
|
RED =( 230, 41, 55, 255 )
|
||||||
|
MAROON =( 190, 33, 55, 255 )
|
||||||
|
GREEN =( 0, 228, 48, 255 )
|
||||||
|
LIME =( 0, 158, 47, 255 )
|
||||||
|
DARKGREEN =( 0, 117, 44, 255 )
|
||||||
|
SKYBLUE =( 102, 191, 255, 255 )
|
||||||
|
BLUE =( 0, 121, 241, 255 )
|
||||||
|
DARKBLUE =( 0, 82, 172, 255 )
|
||||||
|
PURPLE =( 200, 122, 255, 255 )
|
||||||
|
VIOLET =( 135, 60, 190, 255 )
|
||||||
|
DARKPURPLE =( 112, 31, 126, 255 )
|
||||||
|
BEIGE =( 211, 176, 131, 255 )
|
||||||
|
BROWN =( 127, 106, 79, 255 )
|
||||||
|
DARKBROWN =( 76, 63, 47, 255 )
|
||||||
|
WHITE =( 255, 255, 255, 255 )
|
||||||
|
BLACK =( 0, 0, 0, 255 )
|
||||||
|
BLANK =( 0, 0, 0, 0 )
|
||||||
|
MAGENTA =( 255, 0, 255, 255 )
|
||||||
|
RAYWHITE =( 245, 245, 245, 255 )
|
||||||
|
|
||||||
510
raylib/raylib/defines.py
Normal file
510
raylib/raylib/defines.py
Normal file
@@ -0,0 +1,510 @@
|
|||||||
|
import raylib
|
||||||
|
|
||||||
|
RAYLIB_VERSION_MAJOR: int = 5
|
||||||
|
RAYLIB_VERSION_MINOR: int = 5
|
||||||
|
RAYLIB_VERSION_PATCH: int = 0
|
||||||
|
RAYLIB_VERSION: str = "5.5"
|
||||||
|
PI: float = 3.141592653589793
|
||||||
|
DEG2RAD = PI / 180.0
|
||||||
|
RAD2DEG = 180.0 / PI
|
||||||
|
MOUSE_LEFT_BUTTON = raylib.MOUSE_BUTTON_LEFT
|
||||||
|
MOUSE_RIGHT_BUTTON = raylib.MOUSE_BUTTON_RIGHT
|
||||||
|
MOUSE_MIDDLE_BUTTON = raylib.MOUSE_BUTTON_MIDDLE
|
||||||
|
MATERIAL_MAP_DIFFUSE = raylib.MATERIAL_MAP_ALBEDO
|
||||||
|
MATERIAL_MAP_SPECULAR = raylib.MATERIAL_MAP_METALNESS
|
||||||
|
SHADER_LOC_MAP_DIFFUSE = raylib.SHADER_LOC_MAP_ALBEDO
|
||||||
|
SHADER_LOC_MAP_SPECULAR = raylib.SHADER_LOC_MAP_METALNESS
|
||||||
|
EPSILON: float = 1e-06
|
||||||
|
RLGL_VERSION: str = "5.0"
|
||||||
|
RL_DEFAULT_BATCH_BUFFER_ELEMENTS: int = 8192
|
||||||
|
RL_DEFAULT_BATCH_BUFFERS: int = 1
|
||||||
|
RL_DEFAULT_BATCH_DRAWCALLS: int = 256
|
||||||
|
RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS: int = 4
|
||||||
|
RL_MAX_MATRIX_STACK_SIZE: int = 32
|
||||||
|
RL_MAX_SHADER_LOCATIONS: int = 32
|
||||||
|
RL_TEXTURE_WRAP_S: int = 10242
|
||||||
|
RL_TEXTURE_WRAP_T: int = 10243
|
||||||
|
RL_TEXTURE_MAG_FILTER: int = 10240
|
||||||
|
RL_TEXTURE_MIN_FILTER: int = 10241
|
||||||
|
RL_TEXTURE_FILTER_NEAREST: int = 9728
|
||||||
|
RL_TEXTURE_FILTER_LINEAR: int = 9729
|
||||||
|
RL_TEXTURE_FILTER_MIP_NEAREST: int = 9984
|
||||||
|
RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR: int = 9986
|
||||||
|
RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST: int = 9985
|
||||||
|
RL_TEXTURE_FILTER_MIP_LINEAR: int = 9987
|
||||||
|
RL_TEXTURE_FILTER_ANISOTROPIC: int = 12288
|
||||||
|
RL_TEXTURE_MIPMAP_BIAS_RATIO: int = 16384
|
||||||
|
RL_TEXTURE_WRAP_REPEAT: int = 10497
|
||||||
|
RL_TEXTURE_WRAP_CLAMP: int = 33071
|
||||||
|
RL_TEXTURE_WRAP_MIRROR_REPEAT: int = 33648
|
||||||
|
RL_TEXTURE_WRAP_MIRROR_CLAMP: int = 34626
|
||||||
|
RL_MODELVIEW: int = 5888
|
||||||
|
RL_PROJECTION: int = 5889
|
||||||
|
RL_TEXTURE: int = 5890
|
||||||
|
RL_LINES: int = 1
|
||||||
|
RL_TRIANGLES: int = 4
|
||||||
|
RL_QUADS: int = 7
|
||||||
|
RL_UNSIGNED_BYTE: int = 5121
|
||||||
|
RL_FLOAT: int = 5126
|
||||||
|
RL_STREAM_DRAW: int = 35040
|
||||||
|
RL_STREAM_READ: int = 35041
|
||||||
|
RL_STREAM_COPY: int = 35042
|
||||||
|
RL_STATIC_DRAW: int = 35044
|
||||||
|
RL_STATIC_READ: int = 35045
|
||||||
|
RL_STATIC_COPY: int = 35046
|
||||||
|
RL_DYNAMIC_DRAW: int = 35048
|
||||||
|
RL_DYNAMIC_READ: int = 35049
|
||||||
|
RL_DYNAMIC_COPY: int = 35050
|
||||||
|
RL_FRAGMENT_SHADER: int = 35632
|
||||||
|
RL_VERTEX_SHADER: int = 35633
|
||||||
|
RL_COMPUTE_SHADER: int = 37305
|
||||||
|
RL_ZERO: int = 0
|
||||||
|
RL_ONE: int = 1
|
||||||
|
RL_SRC_COLOR: int = 768
|
||||||
|
RL_ONE_MINUS_SRC_COLOR: int = 769
|
||||||
|
RL_SRC_ALPHA: int = 770
|
||||||
|
RL_ONE_MINUS_SRC_ALPHA: int = 771
|
||||||
|
RL_DST_ALPHA: int = 772
|
||||||
|
RL_ONE_MINUS_DST_ALPHA: int = 773
|
||||||
|
RL_DST_COLOR: int = 774
|
||||||
|
RL_ONE_MINUS_DST_COLOR: int = 775
|
||||||
|
RL_SRC_ALPHA_SATURATE: int = 776
|
||||||
|
RL_CONSTANT_COLOR: int = 32769
|
||||||
|
RL_ONE_MINUS_CONSTANT_COLOR: int = 32770
|
||||||
|
RL_CONSTANT_ALPHA: int = 32771
|
||||||
|
RL_ONE_MINUS_CONSTANT_ALPHA: int = 32772
|
||||||
|
RL_FUNC_ADD: int = 32774
|
||||||
|
RL_MIN: int = 32775
|
||||||
|
RL_MAX: int = 32776
|
||||||
|
RL_FUNC_SUBTRACT: int = 32778
|
||||||
|
RL_FUNC_REVERSE_SUBTRACT: int = 32779
|
||||||
|
RL_BLEND_EQUATION: int = 32777
|
||||||
|
RL_BLEND_EQUATION_RGB: int = 32777
|
||||||
|
RL_BLEND_EQUATION_ALPHA: int = 34877
|
||||||
|
RL_BLEND_DST_RGB: int = 32968
|
||||||
|
RL_BLEND_SRC_RGB: int = 32969
|
||||||
|
RL_BLEND_DST_ALPHA: int = 32970
|
||||||
|
RL_BLEND_SRC_ALPHA: int = 32971
|
||||||
|
RL_BLEND_COLOR: int = 32773
|
||||||
|
RL_READ_FRAMEBUFFER: int = 36008
|
||||||
|
RL_DRAW_FRAMEBUFFER: int = 36009
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION: int = 0
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD: int = 1
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL: int = 2
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR: int = 3
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT: int = 4
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2: int = 5
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES: int = 6
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS: int = 7
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS: int = 8
|
||||||
|
RL_SHADER_LOC_MAP_DIFFUSE = raylib.RL_SHADER_LOC_MAP_ALBEDO
|
||||||
|
RL_SHADER_LOC_MAP_SPECULAR = raylib.RL_SHADER_LOC_MAP_METALNESS
|
||||||
|
GL_SHADING_LANGUAGE_VERSION: int = 35724
|
||||||
|
GL_COMPRESSED_RGB_S3TC_DXT1_EXT: int = 33776
|
||||||
|
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: int = 33777
|
||||||
|
GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: int = 33778
|
||||||
|
GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: int = 33779
|
||||||
|
GL_ETC1_RGB8_OES: int = 36196
|
||||||
|
GL_COMPRESSED_RGB8_ETC2: int = 37492
|
||||||
|
GL_COMPRESSED_RGBA8_ETC2_EAC: int = 37496
|
||||||
|
GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG: int = 35840
|
||||||
|
GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: int = 35842
|
||||||
|
GL_COMPRESSED_RGBA_ASTC_4x4_KHR: int = 37808
|
||||||
|
GL_COMPRESSED_RGBA_ASTC_8x8_KHR: int = 37815
|
||||||
|
GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: int = 34047
|
||||||
|
GL_TEXTURE_MAX_ANISOTROPY_EXT: int = 34046
|
||||||
|
GL_PROGRAM_POINT_SIZE: int = 34370
|
||||||
|
GL_LINE_WIDTH: int = 2849
|
||||||
|
GL_UNSIGNED_SHORT_5_6_5: int = 33635
|
||||||
|
GL_UNSIGNED_SHORT_5_5_5_1: int = 32820
|
||||||
|
GL_UNSIGNED_SHORT_4_4_4_4: int = 32819
|
||||||
|
GL_LUMINANCE: int = 6409
|
||||||
|
GL_LUMINANCE_ALPHA: int = 6410
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION: str = "vertexPosition"
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD: str = "vertexTexCoord"
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL: str = "vertexNormal"
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR: str = "vertexColor"
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT: str = "vertexTangent"
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2: str = "vertexTexCoord2"
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_NAME_BONEIDS: str = "vertexBoneIds"
|
||||||
|
RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS: str = "vertexBoneWeights"
|
||||||
|
RL_DEFAULT_SHADER_UNIFORM_NAME_MVP: str = "mvp"
|
||||||
|
RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW: str = "matView"
|
||||||
|
RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION: str = "matProjection"
|
||||||
|
RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL: str = "matModel"
|
||||||
|
RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL: str = "matNormal"
|
||||||
|
RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR: str = "colDiffuse"
|
||||||
|
RL_DEFAULT_SHADER_UNIFORM_NAME_BONE_MATRICES: str = "boneMatrices"
|
||||||
|
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0: str = "texture0"
|
||||||
|
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1: str = "texture1"
|
||||||
|
RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2: str = "texture2"
|
||||||
|
RAYGUI_VERSION_MAJOR: int = 4
|
||||||
|
RAYGUI_VERSION_MINOR: int = 5
|
||||||
|
RAYGUI_VERSION_PATCH: int = 0
|
||||||
|
RAYGUI_VERSION: str = "4.5-dev"
|
||||||
|
SCROLLBAR_LEFT_SIDE: int = 0
|
||||||
|
SCROLLBAR_RIGHT_SIDE: int = 1
|
||||||
|
RAYGUI_ICON_SIZE: int = 16
|
||||||
|
RAYGUI_ICON_MAX_ICONS: int = 256
|
||||||
|
RAYGUI_ICON_MAX_NAME_LENGTH: int = 32
|
||||||
|
RAYGUI_MAX_CONTROLS: int = 16
|
||||||
|
RAYGUI_MAX_PROPS_BASE: int = 16
|
||||||
|
RAYGUI_MAX_PROPS_EXTENDED: int = 8
|
||||||
|
KEY_RIGHT: int = 262
|
||||||
|
KEY_LEFT: int = 263
|
||||||
|
KEY_DOWN: int = 264
|
||||||
|
KEY_UP: int = 265
|
||||||
|
KEY_BACKSPACE: int = 259
|
||||||
|
KEY_ENTER: int = 257
|
||||||
|
MOUSE_LEFT_BUTTON: int = 0
|
||||||
|
RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT: int = 24
|
||||||
|
RAYGUI_GROUPBOX_LINE_THICK: int = 1
|
||||||
|
RAYGUI_LINE_MARGIN_TEXT: int = 12
|
||||||
|
RAYGUI_LINE_TEXT_PADDING: int = 4
|
||||||
|
RAYGUI_PANEL_BORDER_WIDTH: int = 1
|
||||||
|
RAYGUI_TABBAR_ITEM_WIDTH: int = 160
|
||||||
|
RAYGUI_MIN_SCROLLBAR_WIDTH: int = 40
|
||||||
|
RAYGUI_MIN_SCROLLBAR_HEIGHT: int = 40
|
||||||
|
RAYGUI_MIN_MOUSE_WHEEL_SPEED: int = 20
|
||||||
|
RAYGUI_TOGGLEGROUP_MAX_ITEMS: int = 32
|
||||||
|
RAYGUI_TEXTBOX_AUTO_CURSOR_COOLDOWN: int = 40
|
||||||
|
RAYGUI_TEXTBOX_AUTO_CURSOR_DELAY: int = 1
|
||||||
|
RAYGUI_VALUEBOX_MAX_CHARS: int = 32
|
||||||
|
RAYGUI_COLORBARALPHA_CHECKED_SIZE: int = 10
|
||||||
|
RAYGUI_MESSAGEBOX_BUTTON_HEIGHT: int = 24
|
||||||
|
RAYGUI_MESSAGEBOX_BUTTON_PADDING: int = 12
|
||||||
|
RAYGUI_TEXTINPUTBOX_BUTTON_HEIGHT: int = 24
|
||||||
|
RAYGUI_TEXTINPUTBOX_BUTTON_PADDING: int = 12
|
||||||
|
RAYGUI_TEXTINPUTBOX_HEIGHT: int = 26
|
||||||
|
RAYGUI_GRID_ALPHA: float = 0.15
|
||||||
|
MAX_LINE_BUFFER_SIZE: int = 256
|
||||||
|
ICON_TEXT_PADDING: int = 4
|
||||||
|
RAYGUI_MAX_TEXT_LINES: int = 128
|
||||||
|
RAYGUI_TEXTSPLIT_MAX_ITEMS: int = 128
|
||||||
|
RAYGUI_TEXTSPLIT_MAX_TEXT_SIZE: int = 1024
|
||||||
|
RAYGUI_TEXTFORMAT_MAX_SIZE: int = 256
|
||||||
|
PHYSAC_MAX_BODIES: int = 64
|
||||||
|
PHYSAC_MAX_MANIFOLDS: int = 4096
|
||||||
|
PHYSAC_MAX_VERTICES: int = 24
|
||||||
|
PHYSAC_DEFAULT_CIRCLE_VERTICES: int = 24
|
||||||
|
PHYSAC_COLLISION_ITERATIONS: int = 100
|
||||||
|
PHYSAC_PENETRATION_ALLOWANCE: float = 0.05
|
||||||
|
PHYSAC_PENETRATION_CORRECTION: float = 0.4
|
||||||
|
PHYSAC_PI: float = 3.141592653589793
|
||||||
|
PHYSAC_DEG2RAD = PHYSAC_PI / 180.0
|
||||||
|
PHYSAC_FLT_MAX: float = 3.402823466e+38
|
||||||
|
PHYSAC_EPSILON: float = 1e-06
|
||||||
|
GLFW_VERSION_MAJOR: int = 3
|
||||||
|
GLFW_VERSION_MINOR: int = 4
|
||||||
|
GLFW_VERSION_REVISION: int = 0
|
||||||
|
GLFW_TRUE: int = 1
|
||||||
|
GLFW_FALSE: int = 0
|
||||||
|
GLFW_RELEASE: int = 0
|
||||||
|
GLFW_PRESS: int = 1
|
||||||
|
GLFW_REPEAT: int = 2
|
||||||
|
GLFW_HAT_CENTERED: int = 0
|
||||||
|
GLFW_HAT_UP: int = 1
|
||||||
|
GLFW_HAT_RIGHT: int = 2
|
||||||
|
GLFW_HAT_DOWN: int = 4
|
||||||
|
GLFW_HAT_LEFT: int = 8
|
||||||
|
GLFW_HAT_RIGHT_UP = GLFW_HAT_RIGHT | GLFW_HAT_UP
|
||||||
|
GLFW_HAT_RIGHT_DOWN = GLFW_HAT_RIGHT | GLFW_HAT_DOWN
|
||||||
|
GLFW_HAT_LEFT_UP = GLFW_HAT_LEFT | GLFW_HAT_UP
|
||||||
|
GLFW_HAT_LEFT_DOWN = GLFW_HAT_LEFT | GLFW_HAT_DOWN
|
||||||
|
GLFW_KEY_SPACE: int = 32
|
||||||
|
GLFW_KEY_APOSTROPHE: int = 39
|
||||||
|
GLFW_KEY_COMMA: int = 44
|
||||||
|
GLFW_KEY_MINUS: int = 45
|
||||||
|
GLFW_KEY_PERIOD: int = 46
|
||||||
|
GLFW_KEY_SLASH: int = 47
|
||||||
|
GLFW_KEY_0: int = 48
|
||||||
|
GLFW_KEY_1: int = 49
|
||||||
|
GLFW_KEY_2: int = 50
|
||||||
|
GLFW_KEY_3: int = 51
|
||||||
|
GLFW_KEY_4: int = 52
|
||||||
|
GLFW_KEY_5: int = 53
|
||||||
|
GLFW_KEY_6: int = 54
|
||||||
|
GLFW_KEY_7: int = 55
|
||||||
|
GLFW_KEY_8: int = 56
|
||||||
|
GLFW_KEY_9: int = 57
|
||||||
|
GLFW_KEY_SEMICOLON: int = 59
|
||||||
|
GLFW_KEY_EQUAL: int = 61
|
||||||
|
GLFW_KEY_A: int = 65
|
||||||
|
GLFW_KEY_B: int = 66
|
||||||
|
GLFW_KEY_C: int = 67
|
||||||
|
GLFW_KEY_D: int = 68
|
||||||
|
GLFW_KEY_E: int = 69
|
||||||
|
GLFW_KEY_F: int = 70
|
||||||
|
GLFW_KEY_G: int = 71
|
||||||
|
GLFW_KEY_H: int = 72
|
||||||
|
GLFW_KEY_I: int = 73
|
||||||
|
GLFW_KEY_J: int = 74
|
||||||
|
GLFW_KEY_K: int = 75
|
||||||
|
GLFW_KEY_L: int = 76
|
||||||
|
GLFW_KEY_M: int = 77
|
||||||
|
GLFW_KEY_N: int = 78
|
||||||
|
GLFW_KEY_O: int = 79
|
||||||
|
GLFW_KEY_P: int = 80
|
||||||
|
GLFW_KEY_Q: int = 81
|
||||||
|
GLFW_KEY_R: int = 82
|
||||||
|
GLFW_KEY_S: int = 83
|
||||||
|
GLFW_KEY_T: int = 84
|
||||||
|
GLFW_KEY_U: int = 85
|
||||||
|
GLFW_KEY_V: int = 86
|
||||||
|
GLFW_KEY_W: int = 87
|
||||||
|
GLFW_KEY_X: int = 88
|
||||||
|
GLFW_KEY_Y: int = 89
|
||||||
|
GLFW_KEY_Z: int = 90
|
||||||
|
GLFW_KEY_LEFT_BRACKET: int = 91
|
||||||
|
GLFW_KEY_BACKSLASH: int = 92
|
||||||
|
GLFW_KEY_RIGHT_BRACKET: int = 93
|
||||||
|
GLFW_KEY_GRAVE_ACCENT: int = 96
|
||||||
|
GLFW_KEY_WORLD_1: int = 161
|
||||||
|
GLFW_KEY_WORLD_2: int = 162
|
||||||
|
GLFW_KEY_ESCAPE: int = 256
|
||||||
|
GLFW_KEY_ENTER: int = 257
|
||||||
|
GLFW_KEY_TAB: int = 258
|
||||||
|
GLFW_KEY_BACKSPACE: int = 259
|
||||||
|
GLFW_KEY_INSERT: int = 260
|
||||||
|
GLFW_KEY_DELETE: int = 261
|
||||||
|
GLFW_KEY_RIGHT: int = 262
|
||||||
|
GLFW_KEY_LEFT: int = 263
|
||||||
|
GLFW_KEY_DOWN: int = 264
|
||||||
|
GLFW_KEY_UP: int = 265
|
||||||
|
GLFW_KEY_PAGE_UP: int = 266
|
||||||
|
GLFW_KEY_PAGE_DOWN: int = 267
|
||||||
|
GLFW_KEY_HOME: int = 268
|
||||||
|
GLFW_KEY_END: int = 269
|
||||||
|
GLFW_KEY_CAPS_LOCK: int = 280
|
||||||
|
GLFW_KEY_SCROLL_LOCK: int = 281
|
||||||
|
GLFW_KEY_NUM_LOCK: int = 282
|
||||||
|
GLFW_KEY_PRINT_SCREEN: int = 283
|
||||||
|
GLFW_KEY_PAUSE: int = 284
|
||||||
|
GLFW_KEY_F1: int = 290
|
||||||
|
GLFW_KEY_F2: int = 291
|
||||||
|
GLFW_KEY_F3: int = 292
|
||||||
|
GLFW_KEY_F4: int = 293
|
||||||
|
GLFW_KEY_F5: int = 294
|
||||||
|
GLFW_KEY_F6: int = 295
|
||||||
|
GLFW_KEY_F7: int = 296
|
||||||
|
GLFW_KEY_F8: int = 297
|
||||||
|
GLFW_KEY_F9: int = 298
|
||||||
|
GLFW_KEY_F10: int = 299
|
||||||
|
GLFW_KEY_F11: int = 300
|
||||||
|
GLFW_KEY_F12: int = 301
|
||||||
|
GLFW_KEY_F13: int = 302
|
||||||
|
GLFW_KEY_F14: int = 303
|
||||||
|
GLFW_KEY_F15: int = 304
|
||||||
|
GLFW_KEY_F16: int = 305
|
||||||
|
GLFW_KEY_F17: int = 306
|
||||||
|
GLFW_KEY_F18: int = 307
|
||||||
|
GLFW_KEY_F19: int = 308
|
||||||
|
GLFW_KEY_F20: int = 309
|
||||||
|
GLFW_KEY_F21: int = 310
|
||||||
|
GLFW_KEY_F22: int = 311
|
||||||
|
GLFW_KEY_F23: int = 312
|
||||||
|
GLFW_KEY_F24: int = 313
|
||||||
|
GLFW_KEY_F25: int = 314
|
||||||
|
GLFW_KEY_KP_0: int = 320
|
||||||
|
GLFW_KEY_KP_1: int = 321
|
||||||
|
GLFW_KEY_KP_2: int = 322
|
||||||
|
GLFW_KEY_KP_3: int = 323
|
||||||
|
GLFW_KEY_KP_4: int = 324
|
||||||
|
GLFW_KEY_KP_5: int = 325
|
||||||
|
GLFW_KEY_KP_6: int = 326
|
||||||
|
GLFW_KEY_KP_7: int = 327
|
||||||
|
GLFW_KEY_KP_8: int = 328
|
||||||
|
GLFW_KEY_KP_9: int = 329
|
||||||
|
GLFW_KEY_KP_DECIMAL: int = 330
|
||||||
|
GLFW_KEY_KP_DIVIDE: int = 331
|
||||||
|
GLFW_KEY_KP_MULTIPLY: int = 332
|
||||||
|
GLFW_KEY_KP_SUBTRACT: int = 333
|
||||||
|
GLFW_KEY_KP_ADD: int = 334
|
||||||
|
GLFW_KEY_KP_ENTER: int = 335
|
||||||
|
GLFW_KEY_KP_EQUAL: int = 336
|
||||||
|
GLFW_KEY_LEFT_SHIFT: int = 340
|
||||||
|
GLFW_KEY_LEFT_CONTROL: int = 341
|
||||||
|
GLFW_KEY_LEFT_ALT: int = 342
|
||||||
|
GLFW_KEY_LEFT_SUPER: int = 343
|
||||||
|
GLFW_KEY_RIGHT_SHIFT: int = 344
|
||||||
|
GLFW_KEY_RIGHT_CONTROL: int = 345
|
||||||
|
GLFW_KEY_RIGHT_ALT: int = 346
|
||||||
|
GLFW_KEY_RIGHT_SUPER: int = 347
|
||||||
|
GLFW_KEY_MENU: int = 348
|
||||||
|
GLFW_MOD_SHIFT: int = 1
|
||||||
|
GLFW_MOD_CONTROL: int = 2
|
||||||
|
GLFW_MOD_ALT: int = 4
|
||||||
|
GLFW_MOD_SUPER: int = 8
|
||||||
|
GLFW_MOD_CAPS_LOCK: int = 16
|
||||||
|
GLFW_MOD_NUM_LOCK: int = 32
|
||||||
|
GLFW_MOUSE_BUTTON_1: int = 0
|
||||||
|
GLFW_MOUSE_BUTTON_2: int = 1
|
||||||
|
GLFW_MOUSE_BUTTON_3: int = 2
|
||||||
|
GLFW_MOUSE_BUTTON_4: int = 3
|
||||||
|
GLFW_MOUSE_BUTTON_5: int = 4
|
||||||
|
GLFW_MOUSE_BUTTON_6: int = 5
|
||||||
|
GLFW_MOUSE_BUTTON_7: int = 6
|
||||||
|
GLFW_MOUSE_BUTTON_8: int = 7
|
||||||
|
GLFW_JOYSTICK_1: int = 0
|
||||||
|
GLFW_JOYSTICK_2: int = 1
|
||||||
|
GLFW_JOYSTICK_3: int = 2
|
||||||
|
GLFW_JOYSTICK_4: int = 3
|
||||||
|
GLFW_JOYSTICK_5: int = 4
|
||||||
|
GLFW_JOYSTICK_6: int = 5
|
||||||
|
GLFW_JOYSTICK_7: int = 6
|
||||||
|
GLFW_JOYSTICK_8: int = 7
|
||||||
|
GLFW_JOYSTICK_9: int = 8
|
||||||
|
GLFW_JOYSTICK_10: int = 9
|
||||||
|
GLFW_JOYSTICK_11: int = 10
|
||||||
|
GLFW_JOYSTICK_12: int = 11
|
||||||
|
GLFW_JOYSTICK_13: int = 12
|
||||||
|
GLFW_JOYSTICK_14: int = 13
|
||||||
|
GLFW_JOYSTICK_15: int = 14
|
||||||
|
GLFW_JOYSTICK_16: int = 15
|
||||||
|
GLFW_GAMEPAD_BUTTON_A: int = 0
|
||||||
|
GLFW_GAMEPAD_BUTTON_B: int = 1
|
||||||
|
GLFW_GAMEPAD_BUTTON_X: int = 2
|
||||||
|
GLFW_GAMEPAD_BUTTON_Y: int = 3
|
||||||
|
GLFW_GAMEPAD_BUTTON_LEFT_BUMPER: int = 4
|
||||||
|
GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER: int = 5
|
||||||
|
GLFW_GAMEPAD_BUTTON_BACK: int = 6
|
||||||
|
GLFW_GAMEPAD_BUTTON_START: int = 7
|
||||||
|
GLFW_GAMEPAD_BUTTON_GUIDE: int = 8
|
||||||
|
GLFW_GAMEPAD_BUTTON_LEFT_THUMB: int = 9
|
||||||
|
GLFW_GAMEPAD_BUTTON_RIGHT_THUMB: int = 10
|
||||||
|
GLFW_GAMEPAD_BUTTON_DPAD_UP: int = 11
|
||||||
|
GLFW_GAMEPAD_BUTTON_DPAD_RIGHT: int = 12
|
||||||
|
GLFW_GAMEPAD_BUTTON_DPAD_DOWN: int = 13
|
||||||
|
GLFW_GAMEPAD_BUTTON_DPAD_LEFT: int = 14
|
||||||
|
GLFW_GAMEPAD_AXIS_LEFT_X: int = 0
|
||||||
|
GLFW_GAMEPAD_AXIS_LEFT_Y: int = 1
|
||||||
|
GLFW_GAMEPAD_AXIS_RIGHT_X: int = 2
|
||||||
|
GLFW_GAMEPAD_AXIS_RIGHT_Y: int = 3
|
||||||
|
GLFW_GAMEPAD_AXIS_LEFT_TRIGGER: int = 4
|
||||||
|
GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER: int = 5
|
||||||
|
GLFW_NO_ERROR: int = 0
|
||||||
|
GLFW_NOT_INITIALIZED: int = 65537
|
||||||
|
GLFW_NO_CURRENT_CONTEXT: int = 65538
|
||||||
|
GLFW_INVALID_ENUM: int = 65539
|
||||||
|
GLFW_INVALID_VALUE: int = 65540
|
||||||
|
GLFW_OUT_OF_MEMORY: int = 65541
|
||||||
|
GLFW_API_UNAVAILABLE: int = 65542
|
||||||
|
GLFW_VERSION_UNAVAILABLE: int = 65543
|
||||||
|
GLFW_PLATFORM_ERROR: int = 65544
|
||||||
|
GLFW_FORMAT_UNAVAILABLE: int = 65545
|
||||||
|
GLFW_NO_WINDOW_CONTEXT: int = 65546
|
||||||
|
GLFW_CURSOR_UNAVAILABLE: int = 65547
|
||||||
|
GLFW_FEATURE_UNAVAILABLE: int = 65548
|
||||||
|
GLFW_FEATURE_UNIMPLEMENTED: int = 65549
|
||||||
|
GLFW_PLATFORM_UNAVAILABLE: int = 65550
|
||||||
|
GLFW_FOCUSED: int = 131073
|
||||||
|
GLFW_ICONIFIED: int = 131074
|
||||||
|
GLFW_RESIZABLE: int = 131075
|
||||||
|
GLFW_VISIBLE: int = 131076
|
||||||
|
GLFW_DECORATED: int = 131077
|
||||||
|
GLFW_AUTO_ICONIFY: int = 131078
|
||||||
|
GLFW_FLOATING: int = 131079
|
||||||
|
GLFW_MAXIMIZED: int = 131080
|
||||||
|
GLFW_CENTER_CURSOR: int = 131081
|
||||||
|
GLFW_TRANSPARENT_FRAMEBUFFER: int = 131082
|
||||||
|
GLFW_HOVERED: int = 131083
|
||||||
|
GLFW_FOCUS_ON_SHOW: int = 131084
|
||||||
|
GLFW_MOUSE_PASSTHROUGH: int = 131085
|
||||||
|
GLFW_POSITION_X: int = 131086
|
||||||
|
GLFW_POSITION_Y: int = 131087
|
||||||
|
GLFW_RED_BITS: int = 135169
|
||||||
|
GLFW_GREEN_BITS: int = 135170
|
||||||
|
GLFW_BLUE_BITS: int = 135171
|
||||||
|
GLFW_ALPHA_BITS: int = 135172
|
||||||
|
GLFW_DEPTH_BITS: int = 135173
|
||||||
|
GLFW_STENCIL_BITS: int = 135174
|
||||||
|
GLFW_ACCUM_RED_BITS: int = 135175
|
||||||
|
GLFW_ACCUM_GREEN_BITS: int = 135176
|
||||||
|
GLFW_ACCUM_BLUE_BITS: int = 135177
|
||||||
|
GLFW_ACCUM_ALPHA_BITS: int = 135178
|
||||||
|
GLFW_AUX_BUFFERS: int = 135179
|
||||||
|
GLFW_STEREO: int = 135180
|
||||||
|
GLFW_SAMPLES: int = 135181
|
||||||
|
GLFW_SRGB_CAPABLE: int = 135182
|
||||||
|
GLFW_REFRESH_RATE: int = 135183
|
||||||
|
GLFW_DOUBLEBUFFER: int = 135184
|
||||||
|
GLFW_CLIENT_API: int = 139265
|
||||||
|
GLFW_CONTEXT_VERSION_MAJOR: int = 139266
|
||||||
|
GLFW_CONTEXT_VERSION_MINOR: int = 139267
|
||||||
|
GLFW_CONTEXT_REVISION: int = 139268
|
||||||
|
GLFW_CONTEXT_ROBUSTNESS: int = 139269
|
||||||
|
GLFW_OPENGL_FORWARD_COMPAT: int = 139270
|
||||||
|
GLFW_CONTEXT_DEBUG: int = 139271
|
||||||
|
GLFW_OPENGL_PROFILE: int = 139272
|
||||||
|
GLFW_CONTEXT_RELEASE_BEHAVIOR: int = 139273
|
||||||
|
GLFW_CONTEXT_NO_ERROR: int = 139274
|
||||||
|
GLFW_CONTEXT_CREATION_API: int = 139275
|
||||||
|
GLFW_SCALE_TO_MONITOR: int = 139276
|
||||||
|
GLFW_SCALE_FRAMEBUFFER: int = 139277
|
||||||
|
GLFW_COCOA_RETINA_FRAMEBUFFER: int = 143361
|
||||||
|
GLFW_COCOA_FRAME_NAME: int = 143362
|
||||||
|
GLFW_COCOA_GRAPHICS_SWITCHING: int = 143363
|
||||||
|
GLFW_X11_CLASS_NAME: int = 147457
|
||||||
|
GLFW_X11_INSTANCE_NAME: int = 147458
|
||||||
|
GLFW_WIN32_KEYBOARD_MENU: int = 151553
|
||||||
|
GLFW_WIN32_SHOWDEFAULT: int = 151554
|
||||||
|
GLFW_WAYLAND_APP_ID: int = 155649
|
||||||
|
GLFW_NO_API: int = 0
|
||||||
|
GLFW_OPENGL_API: int = 196609
|
||||||
|
GLFW_OPENGL_ES_API: int = 196610
|
||||||
|
GLFW_NO_ROBUSTNESS: int = 0
|
||||||
|
GLFW_NO_RESET_NOTIFICATION: int = 200705
|
||||||
|
GLFW_LOSE_CONTEXT_ON_RESET: int = 200706
|
||||||
|
GLFW_OPENGL_ANY_PROFILE: int = 0
|
||||||
|
GLFW_OPENGL_CORE_PROFILE: int = 204801
|
||||||
|
GLFW_OPENGL_COMPAT_PROFILE: int = 204802
|
||||||
|
GLFW_CURSOR: int = 208897
|
||||||
|
GLFW_STICKY_KEYS: int = 208898
|
||||||
|
GLFW_STICKY_MOUSE_BUTTONS: int = 208899
|
||||||
|
GLFW_LOCK_KEY_MODS: int = 208900
|
||||||
|
GLFW_RAW_MOUSE_MOTION: int = 208901
|
||||||
|
GLFW_CURSOR_NORMAL: int = 212993
|
||||||
|
GLFW_CURSOR_HIDDEN: int = 212994
|
||||||
|
GLFW_CURSOR_DISABLED: int = 212995
|
||||||
|
GLFW_CURSOR_CAPTURED: int = 212996
|
||||||
|
GLFW_ANY_RELEASE_BEHAVIOR: int = 0
|
||||||
|
GLFW_RELEASE_BEHAVIOR_FLUSH: int = 217089
|
||||||
|
GLFW_RELEASE_BEHAVIOR_NONE: int = 217090
|
||||||
|
GLFW_NATIVE_CONTEXT_API: int = 221185
|
||||||
|
GLFW_EGL_CONTEXT_API: int = 221186
|
||||||
|
GLFW_OSMESA_CONTEXT_API: int = 221187
|
||||||
|
GLFW_ANGLE_PLATFORM_TYPE_NONE: int = 225281
|
||||||
|
GLFW_ANGLE_PLATFORM_TYPE_OPENGL: int = 225282
|
||||||
|
GLFW_ANGLE_PLATFORM_TYPE_OPENGLES: int = 225283
|
||||||
|
GLFW_ANGLE_PLATFORM_TYPE_D3D9: int = 225284
|
||||||
|
GLFW_ANGLE_PLATFORM_TYPE_D3D11: int = 225285
|
||||||
|
GLFW_ANGLE_PLATFORM_TYPE_VULKAN: int = 225287
|
||||||
|
GLFW_ANGLE_PLATFORM_TYPE_METAL: int = 225288
|
||||||
|
GLFW_WAYLAND_PREFER_LIBDECOR: int = 229377
|
||||||
|
GLFW_WAYLAND_DISABLE_LIBDECOR: int = 229378
|
||||||
|
GLFW_ANY_POSITION: int = 2147483648
|
||||||
|
GLFW_ARROW_CURSOR: int = 221185
|
||||||
|
GLFW_IBEAM_CURSOR: int = 221186
|
||||||
|
GLFW_CROSSHAIR_CURSOR: int = 221187
|
||||||
|
GLFW_POINTING_HAND_CURSOR: int = 221188
|
||||||
|
GLFW_RESIZE_EW_CURSOR: int = 221189
|
||||||
|
GLFW_RESIZE_NS_CURSOR: int = 221190
|
||||||
|
GLFW_RESIZE_NWSE_CURSOR: int = 221191
|
||||||
|
GLFW_RESIZE_NESW_CURSOR: int = 221192
|
||||||
|
GLFW_RESIZE_ALL_CURSOR: int = 221193
|
||||||
|
GLFW_NOT_ALLOWED_CURSOR: int = 221194
|
||||||
|
GLFW_CONNECTED: int = 262145
|
||||||
|
GLFW_DISCONNECTED: int = 262146
|
||||||
|
GLFW_JOYSTICK_HAT_BUTTONS: int = 327681
|
||||||
|
GLFW_ANGLE_PLATFORM_TYPE: int = 327682
|
||||||
|
GLFW_PLATFORM: int = 327683
|
||||||
|
GLFW_COCOA_CHDIR_RESOURCES: int = 331777
|
||||||
|
GLFW_COCOA_MENUBAR: int = 331778
|
||||||
|
GLFW_X11_XCB_VULKAN_SURFACE: int = 335873
|
||||||
|
GLFW_WAYLAND_LIBDECOR: int = 339969
|
||||||
|
GLFW_ANY_PLATFORM: int = 393216
|
||||||
|
GLFW_PLATFORM_WIN32: int = 393217
|
||||||
|
GLFW_PLATFORM_COCOA: int = 393218
|
||||||
|
GLFW_PLATFORM_WAYLAND: int = 393219
|
||||||
|
GLFW_PLATFORM_X11: int = 393220
|
||||||
|
GLFW_PLATFORM_NULL: int = 393221
|
||||||
719
raylib/raylib/enums.py
Normal file
719
raylib/raylib/enums.py
Normal file
@@ -0,0 +1,719 @@
|
|||||||
|
from enum import IntEnum
|
||||||
|
|
||||||
|
class ConfigFlags(IntEnum):
|
||||||
|
FLAG_VSYNC_HINT = 64
|
||||||
|
FLAG_FULLSCREEN_MODE = 2
|
||||||
|
FLAG_WINDOW_RESIZABLE = 4
|
||||||
|
FLAG_WINDOW_UNDECORATED = 8
|
||||||
|
FLAG_WINDOW_HIDDEN = 128
|
||||||
|
FLAG_WINDOW_MINIMIZED = 512
|
||||||
|
FLAG_WINDOW_MAXIMIZED = 1024
|
||||||
|
FLAG_WINDOW_UNFOCUSED = 2048
|
||||||
|
FLAG_WINDOW_TOPMOST = 4096
|
||||||
|
FLAG_WINDOW_ALWAYS_RUN = 256
|
||||||
|
FLAG_WINDOW_TRANSPARENT = 16
|
||||||
|
FLAG_WINDOW_HIGHDPI = 8192
|
||||||
|
FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384
|
||||||
|
FLAG_BORDERLESS_WINDOWED_MODE = 32768
|
||||||
|
FLAG_MSAA_4X_HINT = 32
|
||||||
|
FLAG_INTERLACED_HINT = 65536
|
||||||
|
|
||||||
|
class TraceLogLevel(IntEnum):
|
||||||
|
LOG_ALL = 0
|
||||||
|
LOG_TRACE = 1
|
||||||
|
LOG_DEBUG = 2
|
||||||
|
LOG_INFO = 3
|
||||||
|
LOG_WARNING = 4
|
||||||
|
LOG_ERROR = 5
|
||||||
|
LOG_FATAL = 6
|
||||||
|
LOG_NONE = 7
|
||||||
|
|
||||||
|
class KeyboardKey(IntEnum):
|
||||||
|
KEY_NULL = 0
|
||||||
|
KEY_APOSTROPHE = 39
|
||||||
|
KEY_COMMA = 44
|
||||||
|
KEY_MINUS = 45
|
||||||
|
KEY_PERIOD = 46
|
||||||
|
KEY_SLASH = 47
|
||||||
|
KEY_ZERO = 48
|
||||||
|
KEY_ONE = 49
|
||||||
|
KEY_TWO = 50
|
||||||
|
KEY_THREE = 51
|
||||||
|
KEY_FOUR = 52
|
||||||
|
KEY_FIVE = 53
|
||||||
|
KEY_SIX = 54
|
||||||
|
KEY_SEVEN = 55
|
||||||
|
KEY_EIGHT = 56
|
||||||
|
KEY_NINE = 57
|
||||||
|
KEY_SEMICOLON = 59
|
||||||
|
KEY_EQUAL = 61
|
||||||
|
KEY_A = 65
|
||||||
|
KEY_B = 66
|
||||||
|
KEY_C = 67
|
||||||
|
KEY_D = 68
|
||||||
|
KEY_E = 69
|
||||||
|
KEY_F = 70
|
||||||
|
KEY_G = 71
|
||||||
|
KEY_H = 72
|
||||||
|
KEY_I = 73
|
||||||
|
KEY_J = 74
|
||||||
|
KEY_K = 75
|
||||||
|
KEY_L = 76
|
||||||
|
KEY_M = 77
|
||||||
|
KEY_N = 78
|
||||||
|
KEY_O = 79
|
||||||
|
KEY_P = 80
|
||||||
|
KEY_Q = 81
|
||||||
|
KEY_R = 82
|
||||||
|
KEY_S = 83
|
||||||
|
KEY_T = 84
|
||||||
|
KEY_U = 85
|
||||||
|
KEY_V = 86
|
||||||
|
KEY_W = 87
|
||||||
|
KEY_X = 88
|
||||||
|
KEY_Y = 89
|
||||||
|
KEY_Z = 90
|
||||||
|
KEY_LEFT_BRACKET = 91
|
||||||
|
KEY_BACKSLASH = 92
|
||||||
|
KEY_RIGHT_BRACKET = 93
|
||||||
|
KEY_GRAVE = 96
|
||||||
|
KEY_SPACE = 32
|
||||||
|
KEY_ESCAPE = 256
|
||||||
|
KEY_ENTER = 257
|
||||||
|
KEY_TAB = 258
|
||||||
|
KEY_BACKSPACE = 259
|
||||||
|
KEY_INSERT = 260
|
||||||
|
KEY_DELETE = 261
|
||||||
|
KEY_RIGHT = 262
|
||||||
|
KEY_LEFT = 263
|
||||||
|
KEY_DOWN = 264
|
||||||
|
KEY_UP = 265
|
||||||
|
KEY_PAGE_UP = 266
|
||||||
|
KEY_PAGE_DOWN = 267
|
||||||
|
KEY_HOME = 268
|
||||||
|
KEY_END = 269
|
||||||
|
KEY_CAPS_LOCK = 280
|
||||||
|
KEY_SCROLL_LOCK = 281
|
||||||
|
KEY_NUM_LOCK = 282
|
||||||
|
KEY_PRINT_SCREEN = 283
|
||||||
|
KEY_PAUSE = 284
|
||||||
|
KEY_F1 = 290
|
||||||
|
KEY_F2 = 291
|
||||||
|
KEY_F3 = 292
|
||||||
|
KEY_F4 = 293
|
||||||
|
KEY_F5 = 294
|
||||||
|
KEY_F6 = 295
|
||||||
|
KEY_F7 = 296
|
||||||
|
KEY_F8 = 297
|
||||||
|
KEY_F9 = 298
|
||||||
|
KEY_F10 = 299
|
||||||
|
KEY_F11 = 300
|
||||||
|
KEY_F12 = 301
|
||||||
|
KEY_LEFT_SHIFT = 340
|
||||||
|
KEY_LEFT_CONTROL = 341
|
||||||
|
KEY_LEFT_ALT = 342
|
||||||
|
KEY_LEFT_SUPER = 343
|
||||||
|
KEY_RIGHT_SHIFT = 344
|
||||||
|
KEY_RIGHT_CONTROL = 345
|
||||||
|
KEY_RIGHT_ALT = 346
|
||||||
|
KEY_RIGHT_SUPER = 347
|
||||||
|
KEY_KB_MENU = 348
|
||||||
|
KEY_KP_0 = 320
|
||||||
|
KEY_KP_1 = 321
|
||||||
|
KEY_KP_2 = 322
|
||||||
|
KEY_KP_3 = 323
|
||||||
|
KEY_KP_4 = 324
|
||||||
|
KEY_KP_5 = 325
|
||||||
|
KEY_KP_6 = 326
|
||||||
|
KEY_KP_7 = 327
|
||||||
|
KEY_KP_8 = 328
|
||||||
|
KEY_KP_9 = 329
|
||||||
|
KEY_KP_DECIMAL = 330
|
||||||
|
KEY_KP_DIVIDE = 331
|
||||||
|
KEY_KP_MULTIPLY = 332
|
||||||
|
KEY_KP_SUBTRACT = 333
|
||||||
|
KEY_KP_ADD = 334
|
||||||
|
KEY_KP_ENTER = 335
|
||||||
|
KEY_KP_EQUAL = 336
|
||||||
|
KEY_BACK = 4
|
||||||
|
KEY_MENU = 5
|
||||||
|
KEY_VOLUME_UP = 24
|
||||||
|
KEY_VOLUME_DOWN = 25
|
||||||
|
|
||||||
|
class MouseButton(IntEnum):
|
||||||
|
MOUSE_BUTTON_LEFT = 0
|
||||||
|
MOUSE_BUTTON_RIGHT = 1
|
||||||
|
MOUSE_BUTTON_MIDDLE = 2
|
||||||
|
MOUSE_BUTTON_SIDE = 3
|
||||||
|
MOUSE_BUTTON_EXTRA = 4
|
||||||
|
MOUSE_BUTTON_FORWARD = 5
|
||||||
|
MOUSE_BUTTON_BACK = 6
|
||||||
|
|
||||||
|
class MouseCursor(IntEnum):
|
||||||
|
MOUSE_CURSOR_DEFAULT = 0
|
||||||
|
MOUSE_CURSOR_ARROW = 1
|
||||||
|
MOUSE_CURSOR_IBEAM = 2
|
||||||
|
MOUSE_CURSOR_CROSSHAIR = 3
|
||||||
|
MOUSE_CURSOR_POINTING_HAND = 4
|
||||||
|
MOUSE_CURSOR_RESIZE_EW = 5
|
||||||
|
MOUSE_CURSOR_RESIZE_NS = 6
|
||||||
|
MOUSE_CURSOR_RESIZE_NWSE = 7
|
||||||
|
MOUSE_CURSOR_RESIZE_NESW = 8
|
||||||
|
MOUSE_CURSOR_RESIZE_ALL = 9
|
||||||
|
MOUSE_CURSOR_NOT_ALLOWED = 10
|
||||||
|
|
||||||
|
class GamepadButton(IntEnum):
|
||||||
|
GAMEPAD_BUTTON_UNKNOWN = 0
|
||||||
|
GAMEPAD_BUTTON_LEFT_FACE_UP = 1
|
||||||
|
GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2
|
||||||
|
GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3
|
||||||
|
GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4
|
||||||
|
GAMEPAD_BUTTON_RIGHT_FACE_UP = 5
|
||||||
|
GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6
|
||||||
|
GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7
|
||||||
|
GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8
|
||||||
|
GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9
|
||||||
|
GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10
|
||||||
|
GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11
|
||||||
|
GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12
|
||||||
|
GAMEPAD_BUTTON_MIDDLE_LEFT = 13
|
||||||
|
GAMEPAD_BUTTON_MIDDLE = 14
|
||||||
|
GAMEPAD_BUTTON_MIDDLE_RIGHT = 15
|
||||||
|
GAMEPAD_BUTTON_LEFT_THUMB = 16
|
||||||
|
GAMEPAD_BUTTON_RIGHT_THUMB = 17
|
||||||
|
|
||||||
|
class GamepadAxis(IntEnum):
|
||||||
|
GAMEPAD_AXIS_LEFT_X = 0
|
||||||
|
GAMEPAD_AXIS_LEFT_Y = 1
|
||||||
|
GAMEPAD_AXIS_RIGHT_X = 2
|
||||||
|
GAMEPAD_AXIS_RIGHT_Y = 3
|
||||||
|
GAMEPAD_AXIS_LEFT_TRIGGER = 4
|
||||||
|
GAMEPAD_AXIS_RIGHT_TRIGGER = 5
|
||||||
|
|
||||||
|
class MaterialMapIndex(IntEnum):
|
||||||
|
MATERIAL_MAP_ALBEDO = 0
|
||||||
|
MATERIAL_MAP_METALNESS = 1
|
||||||
|
MATERIAL_MAP_NORMAL = 2
|
||||||
|
MATERIAL_MAP_ROUGHNESS = 3
|
||||||
|
MATERIAL_MAP_OCCLUSION = 4
|
||||||
|
MATERIAL_MAP_EMISSION = 5
|
||||||
|
MATERIAL_MAP_HEIGHT = 6
|
||||||
|
MATERIAL_MAP_CUBEMAP = 7
|
||||||
|
MATERIAL_MAP_IRRADIANCE = 8
|
||||||
|
MATERIAL_MAP_PREFILTER = 9
|
||||||
|
MATERIAL_MAP_BRDF = 10
|
||||||
|
|
||||||
|
class ShaderLocationIndex(IntEnum):
|
||||||
|
SHADER_LOC_VERTEX_POSITION = 0
|
||||||
|
SHADER_LOC_VERTEX_TEXCOORD01 = 1
|
||||||
|
SHADER_LOC_VERTEX_TEXCOORD02 = 2
|
||||||
|
SHADER_LOC_VERTEX_NORMAL = 3
|
||||||
|
SHADER_LOC_VERTEX_TANGENT = 4
|
||||||
|
SHADER_LOC_VERTEX_COLOR = 5
|
||||||
|
SHADER_LOC_MATRIX_MVP = 6
|
||||||
|
SHADER_LOC_MATRIX_VIEW = 7
|
||||||
|
SHADER_LOC_MATRIX_PROJECTION = 8
|
||||||
|
SHADER_LOC_MATRIX_MODEL = 9
|
||||||
|
SHADER_LOC_MATRIX_NORMAL = 10
|
||||||
|
SHADER_LOC_VECTOR_VIEW = 11
|
||||||
|
SHADER_LOC_COLOR_DIFFUSE = 12
|
||||||
|
SHADER_LOC_COLOR_SPECULAR = 13
|
||||||
|
SHADER_LOC_COLOR_AMBIENT = 14
|
||||||
|
SHADER_LOC_MAP_ALBEDO = 15
|
||||||
|
SHADER_LOC_MAP_METALNESS = 16
|
||||||
|
SHADER_LOC_MAP_NORMAL = 17
|
||||||
|
SHADER_LOC_MAP_ROUGHNESS = 18
|
||||||
|
SHADER_LOC_MAP_OCCLUSION = 19
|
||||||
|
SHADER_LOC_MAP_EMISSION = 20
|
||||||
|
SHADER_LOC_MAP_HEIGHT = 21
|
||||||
|
SHADER_LOC_MAP_CUBEMAP = 22
|
||||||
|
SHADER_LOC_MAP_IRRADIANCE = 23
|
||||||
|
SHADER_LOC_MAP_PREFILTER = 24
|
||||||
|
SHADER_LOC_MAP_BRDF = 25
|
||||||
|
SHADER_LOC_VERTEX_BONEIDS = 26
|
||||||
|
SHADER_LOC_VERTEX_BONEWEIGHTS = 27
|
||||||
|
SHADER_LOC_BONE_MATRICES = 28
|
||||||
|
|
||||||
|
class ShaderUniformDataType(IntEnum):
|
||||||
|
SHADER_UNIFORM_FLOAT = 0
|
||||||
|
SHADER_UNIFORM_VEC2 = 1
|
||||||
|
SHADER_UNIFORM_VEC3 = 2
|
||||||
|
SHADER_UNIFORM_VEC4 = 3
|
||||||
|
SHADER_UNIFORM_INT = 4
|
||||||
|
SHADER_UNIFORM_IVEC2 = 5
|
||||||
|
SHADER_UNIFORM_IVEC3 = 6
|
||||||
|
SHADER_UNIFORM_IVEC4 = 7
|
||||||
|
SHADER_UNIFORM_SAMPLER2D = 8
|
||||||
|
|
||||||
|
class ShaderAttributeDataType(IntEnum):
|
||||||
|
SHADER_ATTRIB_FLOAT = 0
|
||||||
|
SHADER_ATTRIB_VEC2 = 1
|
||||||
|
SHADER_ATTRIB_VEC3 = 2
|
||||||
|
SHADER_ATTRIB_VEC4 = 3
|
||||||
|
|
||||||
|
class PixelFormat(IntEnum):
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_R32 = 8
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_R16 = 11
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_R16G16B16 = 12
|
||||||
|
PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = 13
|
||||||
|
PIXELFORMAT_COMPRESSED_DXT1_RGB = 14
|
||||||
|
PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15
|
||||||
|
PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16
|
||||||
|
PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17
|
||||||
|
PIXELFORMAT_COMPRESSED_ETC1_RGB = 18
|
||||||
|
PIXELFORMAT_COMPRESSED_ETC2_RGB = 19
|
||||||
|
PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20
|
||||||
|
PIXELFORMAT_COMPRESSED_PVRT_RGB = 21
|
||||||
|
PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22
|
||||||
|
PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23
|
||||||
|
PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24
|
||||||
|
|
||||||
|
class TextureFilter(IntEnum):
|
||||||
|
TEXTURE_FILTER_POINT = 0
|
||||||
|
TEXTURE_FILTER_BILINEAR = 1
|
||||||
|
TEXTURE_FILTER_TRILINEAR = 2
|
||||||
|
TEXTURE_FILTER_ANISOTROPIC_4X = 3
|
||||||
|
TEXTURE_FILTER_ANISOTROPIC_8X = 4
|
||||||
|
TEXTURE_FILTER_ANISOTROPIC_16X = 5
|
||||||
|
|
||||||
|
class TextureWrap(IntEnum):
|
||||||
|
TEXTURE_WRAP_REPEAT = 0
|
||||||
|
TEXTURE_WRAP_CLAMP = 1
|
||||||
|
TEXTURE_WRAP_MIRROR_REPEAT = 2
|
||||||
|
TEXTURE_WRAP_MIRROR_CLAMP = 3
|
||||||
|
|
||||||
|
class CubemapLayout(IntEnum):
|
||||||
|
CUBEMAP_LAYOUT_AUTO_DETECT = 0
|
||||||
|
CUBEMAP_LAYOUT_LINE_VERTICAL = 1
|
||||||
|
CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2
|
||||||
|
CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3
|
||||||
|
CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4
|
||||||
|
|
||||||
|
class FontType(IntEnum):
|
||||||
|
FONT_DEFAULT = 0
|
||||||
|
FONT_BITMAP = 1
|
||||||
|
FONT_SDF = 2
|
||||||
|
|
||||||
|
class BlendMode(IntEnum):
|
||||||
|
BLEND_ALPHA = 0
|
||||||
|
BLEND_ADDITIVE = 1
|
||||||
|
BLEND_MULTIPLIED = 2
|
||||||
|
BLEND_ADD_COLORS = 3
|
||||||
|
BLEND_SUBTRACT_COLORS = 4
|
||||||
|
BLEND_ALPHA_PREMULTIPLY = 5
|
||||||
|
BLEND_CUSTOM = 6
|
||||||
|
BLEND_CUSTOM_SEPARATE = 7
|
||||||
|
|
||||||
|
class Gesture(IntEnum):
|
||||||
|
GESTURE_NONE = 0
|
||||||
|
GESTURE_TAP = 1
|
||||||
|
GESTURE_DOUBLETAP = 2
|
||||||
|
GESTURE_HOLD = 4
|
||||||
|
GESTURE_DRAG = 8
|
||||||
|
GESTURE_SWIPE_RIGHT = 16
|
||||||
|
GESTURE_SWIPE_LEFT = 32
|
||||||
|
GESTURE_SWIPE_UP = 64
|
||||||
|
GESTURE_SWIPE_DOWN = 128
|
||||||
|
GESTURE_PINCH_IN = 256
|
||||||
|
GESTURE_PINCH_OUT = 512
|
||||||
|
|
||||||
|
class CameraMode(IntEnum):
|
||||||
|
CAMERA_CUSTOM = 0
|
||||||
|
CAMERA_FREE = 1
|
||||||
|
CAMERA_ORBITAL = 2
|
||||||
|
CAMERA_FIRST_PERSON = 3
|
||||||
|
CAMERA_THIRD_PERSON = 4
|
||||||
|
|
||||||
|
class CameraProjection(IntEnum):
|
||||||
|
CAMERA_PERSPECTIVE = 0
|
||||||
|
CAMERA_ORTHOGRAPHIC = 1
|
||||||
|
|
||||||
|
class NPatchLayout(IntEnum):
|
||||||
|
NPATCH_NINE_PATCH = 0
|
||||||
|
NPATCH_THREE_PATCH_VERTICAL = 1
|
||||||
|
NPATCH_THREE_PATCH_HORIZONTAL = 2
|
||||||
|
|
||||||
|
class GuiState(IntEnum):
|
||||||
|
STATE_NORMAL = 0
|
||||||
|
STATE_FOCUSED = 1
|
||||||
|
STATE_PRESSED = 2
|
||||||
|
STATE_DISABLED = 3
|
||||||
|
|
||||||
|
class GuiTextAlignment(IntEnum):
|
||||||
|
TEXT_ALIGN_LEFT = 0
|
||||||
|
TEXT_ALIGN_CENTER = 1
|
||||||
|
TEXT_ALIGN_RIGHT = 2
|
||||||
|
|
||||||
|
class GuiTextAlignmentVertical(IntEnum):
|
||||||
|
TEXT_ALIGN_TOP = 0
|
||||||
|
TEXT_ALIGN_MIDDLE = 1
|
||||||
|
TEXT_ALIGN_BOTTOM = 2
|
||||||
|
|
||||||
|
class GuiTextWrapMode(IntEnum):
|
||||||
|
TEXT_WRAP_NONE = 0
|
||||||
|
TEXT_WRAP_CHAR = 1
|
||||||
|
TEXT_WRAP_WORD = 2
|
||||||
|
|
||||||
|
class GuiControl(IntEnum):
|
||||||
|
DEFAULT = 0
|
||||||
|
LABEL = 1
|
||||||
|
BUTTON = 2
|
||||||
|
TOGGLE = 3
|
||||||
|
SLIDER = 4
|
||||||
|
PROGRESSBAR = 5
|
||||||
|
CHECKBOX = 6
|
||||||
|
COMBOBOX = 7
|
||||||
|
DROPDOWNBOX = 8
|
||||||
|
TEXTBOX = 9
|
||||||
|
VALUEBOX = 10
|
||||||
|
SPINNER = 11
|
||||||
|
LISTVIEW = 12
|
||||||
|
COLORPICKER = 13
|
||||||
|
SCROLLBAR = 14
|
||||||
|
STATUSBAR = 15
|
||||||
|
|
||||||
|
class GuiControlProperty(IntEnum):
|
||||||
|
BORDER_COLOR_NORMAL = 0
|
||||||
|
BASE_COLOR_NORMAL = 1
|
||||||
|
TEXT_COLOR_NORMAL = 2
|
||||||
|
BORDER_COLOR_FOCUSED = 3
|
||||||
|
BASE_COLOR_FOCUSED = 4
|
||||||
|
TEXT_COLOR_FOCUSED = 5
|
||||||
|
BORDER_COLOR_PRESSED = 6
|
||||||
|
BASE_COLOR_PRESSED = 7
|
||||||
|
TEXT_COLOR_PRESSED = 8
|
||||||
|
BORDER_COLOR_DISABLED = 9
|
||||||
|
BASE_COLOR_DISABLED = 10
|
||||||
|
TEXT_COLOR_DISABLED = 11
|
||||||
|
BORDER_WIDTH = 12
|
||||||
|
TEXT_PADDING = 13
|
||||||
|
TEXT_ALIGNMENT = 14
|
||||||
|
|
||||||
|
class GuiDefaultProperty(IntEnum):
|
||||||
|
TEXT_SIZE = 16
|
||||||
|
TEXT_SPACING = 17
|
||||||
|
LINE_COLOR = 18
|
||||||
|
BACKGROUND_COLOR = 19
|
||||||
|
TEXT_LINE_SPACING = 20
|
||||||
|
TEXT_ALIGNMENT_VERTICAL = 21
|
||||||
|
TEXT_WRAP_MODE = 22
|
||||||
|
|
||||||
|
class GuiToggleProperty(IntEnum):
|
||||||
|
GROUP_PADDING = 16
|
||||||
|
|
||||||
|
class GuiSliderProperty(IntEnum):
|
||||||
|
SLIDER_WIDTH = 16
|
||||||
|
SLIDER_PADDING = 17
|
||||||
|
|
||||||
|
class GuiProgressBarProperty(IntEnum):
|
||||||
|
PROGRESS_PADDING = 16
|
||||||
|
|
||||||
|
class GuiScrollBarProperty(IntEnum):
|
||||||
|
ARROWS_SIZE = 16
|
||||||
|
ARROWS_VISIBLE = 17
|
||||||
|
SCROLL_SLIDER_PADDING = 18
|
||||||
|
SCROLL_SLIDER_SIZE = 19
|
||||||
|
SCROLL_PADDING = 20
|
||||||
|
SCROLL_SPEED = 21
|
||||||
|
|
||||||
|
class GuiCheckBoxProperty(IntEnum):
|
||||||
|
CHECK_PADDING = 16
|
||||||
|
|
||||||
|
class GuiComboBoxProperty(IntEnum):
|
||||||
|
COMBO_BUTTON_WIDTH = 16
|
||||||
|
COMBO_BUTTON_SPACING = 17
|
||||||
|
|
||||||
|
class GuiDropdownBoxProperty(IntEnum):
|
||||||
|
ARROW_PADDING = 16
|
||||||
|
DROPDOWN_ITEMS_SPACING = 17
|
||||||
|
DROPDOWN_ARROW_HIDDEN = 18
|
||||||
|
DROPDOWN_ROLL_UP = 19
|
||||||
|
|
||||||
|
class GuiTextBoxProperty(IntEnum):
|
||||||
|
TEXT_READONLY = 16
|
||||||
|
|
||||||
|
class GuiSpinnerProperty(IntEnum):
|
||||||
|
SPIN_BUTTON_WIDTH = 16
|
||||||
|
SPIN_BUTTON_SPACING = 17
|
||||||
|
|
||||||
|
class GuiListViewProperty(IntEnum):
|
||||||
|
LIST_ITEMS_HEIGHT = 16
|
||||||
|
LIST_ITEMS_SPACING = 17
|
||||||
|
SCROLLBAR_WIDTH = 18
|
||||||
|
SCROLLBAR_SIDE = 19
|
||||||
|
LIST_ITEMS_BORDER_WIDTH = 20
|
||||||
|
|
||||||
|
class GuiColorPickerProperty(IntEnum):
|
||||||
|
COLOR_SELECTOR_SIZE = 16
|
||||||
|
HUEBAR_WIDTH = 17
|
||||||
|
HUEBAR_PADDING = 18
|
||||||
|
HUEBAR_SELECTOR_HEIGHT = 19
|
||||||
|
HUEBAR_SELECTOR_OVERFLOW = 20
|
||||||
|
|
||||||
|
class GuiIconName(IntEnum):
|
||||||
|
ICON_NONE = 0
|
||||||
|
ICON_FOLDER_FILE_OPEN = 1
|
||||||
|
ICON_FILE_SAVE_CLASSIC = 2
|
||||||
|
ICON_FOLDER_OPEN = 3
|
||||||
|
ICON_FOLDER_SAVE = 4
|
||||||
|
ICON_FILE_OPEN = 5
|
||||||
|
ICON_FILE_SAVE = 6
|
||||||
|
ICON_FILE_EXPORT = 7
|
||||||
|
ICON_FILE_ADD = 8
|
||||||
|
ICON_FILE_DELETE = 9
|
||||||
|
ICON_FILETYPE_TEXT = 10
|
||||||
|
ICON_FILETYPE_AUDIO = 11
|
||||||
|
ICON_FILETYPE_IMAGE = 12
|
||||||
|
ICON_FILETYPE_PLAY = 13
|
||||||
|
ICON_FILETYPE_VIDEO = 14
|
||||||
|
ICON_FILETYPE_INFO = 15
|
||||||
|
ICON_FILE_COPY = 16
|
||||||
|
ICON_FILE_CUT = 17
|
||||||
|
ICON_FILE_PASTE = 18
|
||||||
|
ICON_CURSOR_HAND = 19
|
||||||
|
ICON_CURSOR_POINTER = 20
|
||||||
|
ICON_CURSOR_CLASSIC = 21
|
||||||
|
ICON_PENCIL = 22
|
||||||
|
ICON_PENCIL_BIG = 23
|
||||||
|
ICON_BRUSH_CLASSIC = 24
|
||||||
|
ICON_BRUSH_PAINTER = 25
|
||||||
|
ICON_WATER_DROP = 26
|
||||||
|
ICON_COLOR_PICKER = 27
|
||||||
|
ICON_RUBBER = 28
|
||||||
|
ICON_COLOR_BUCKET = 29
|
||||||
|
ICON_TEXT_T = 30
|
||||||
|
ICON_TEXT_A = 31
|
||||||
|
ICON_SCALE = 32
|
||||||
|
ICON_RESIZE = 33
|
||||||
|
ICON_FILTER_POINT = 34
|
||||||
|
ICON_FILTER_BILINEAR = 35
|
||||||
|
ICON_CROP = 36
|
||||||
|
ICON_CROP_ALPHA = 37
|
||||||
|
ICON_SQUARE_TOGGLE = 38
|
||||||
|
ICON_SYMMETRY = 39
|
||||||
|
ICON_SYMMETRY_HORIZONTAL = 40
|
||||||
|
ICON_SYMMETRY_VERTICAL = 41
|
||||||
|
ICON_LENS = 42
|
||||||
|
ICON_LENS_BIG = 43
|
||||||
|
ICON_EYE_ON = 44
|
||||||
|
ICON_EYE_OFF = 45
|
||||||
|
ICON_FILTER_TOP = 46
|
||||||
|
ICON_FILTER = 47
|
||||||
|
ICON_TARGET_POINT = 48
|
||||||
|
ICON_TARGET_SMALL = 49
|
||||||
|
ICON_TARGET_BIG = 50
|
||||||
|
ICON_TARGET_MOVE = 51
|
||||||
|
ICON_CURSOR_MOVE = 52
|
||||||
|
ICON_CURSOR_SCALE = 53
|
||||||
|
ICON_CURSOR_SCALE_RIGHT = 54
|
||||||
|
ICON_CURSOR_SCALE_LEFT = 55
|
||||||
|
ICON_UNDO = 56
|
||||||
|
ICON_REDO = 57
|
||||||
|
ICON_REREDO = 58
|
||||||
|
ICON_MUTATE = 59
|
||||||
|
ICON_ROTATE = 60
|
||||||
|
ICON_REPEAT = 61
|
||||||
|
ICON_SHUFFLE = 62
|
||||||
|
ICON_EMPTYBOX = 63
|
||||||
|
ICON_TARGET = 64
|
||||||
|
ICON_TARGET_SMALL_FILL = 65
|
||||||
|
ICON_TARGET_BIG_FILL = 66
|
||||||
|
ICON_TARGET_MOVE_FILL = 67
|
||||||
|
ICON_CURSOR_MOVE_FILL = 68
|
||||||
|
ICON_CURSOR_SCALE_FILL = 69
|
||||||
|
ICON_CURSOR_SCALE_RIGHT_FILL = 70
|
||||||
|
ICON_CURSOR_SCALE_LEFT_FILL = 71
|
||||||
|
ICON_UNDO_FILL = 72
|
||||||
|
ICON_REDO_FILL = 73
|
||||||
|
ICON_REREDO_FILL = 74
|
||||||
|
ICON_MUTATE_FILL = 75
|
||||||
|
ICON_ROTATE_FILL = 76
|
||||||
|
ICON_REPEAT_FILL = 77
|
||||||
|
ICON_SHUFFLE_FILL = 78
|
||||||
|
ICON_EMPTYBOX_SMALL = 79
|
||||||
|
ICON_BOX = 80
|
||||||
|
ICON_BOX_TOP = 81
|
||||||
|
ICON_BOX_TOP_RIGHT = 82
|
||||||
|
ICON_BOX_RIGHT = 83
|
||||||
|
ICON_BOX_BOTTOM_RIGHT = 84
|
||||||
|
ICON_BOX_BOTTOM = 85
|
||||||
|
ICON_BOX_BOTTOM_LEFT = 86
|
||||||
|
ICON_BOX_LEFT = 87
|
||||||
|
ICON_BOX_TOP_LEFT = 88
|
||||||
|
ICON_BOX_CENTER = 89
|
||||||
|
ICON_BOX_CIRCLE_MASK = 90
|
||||||
|
ICON_POT = 91
|
||||||
|
ICON_ALPHA_MULTIPLY = 92
|
||||||
|
ICON_ALPHA_CLEAR = 93
|
||||||
|
ICON_DITHERING = 94
|
||||||
|
ICON_MIPMAPS = 95
|
||||||
|
ICON_BOX_GRID = 96
|
||||||
|
ICON_GRID = 97
|
||||||
|
ICON_BOX_CORNERS_SMALL = 98
|
||||||
|
ICON_BOX_CORNERS_BIG = 99
|
||||||
|
ICON_FOUR_BOXES = 100
|
||||||
|
ICON_GRID_FILL = 101
|
||||||
|
ICON_BOX_MULTISIZE = 102
|
||||||
|
ICON_ZOOM_SMALL = 103
|
||||||
|
ICON_ZOOM_MEDIUM = 104
|
||||||
|
ICON_ZOOM_BIG = 105
|
||||||
|
ICON_ZOOM_ALL = 106
|
||||||
|
ICON_ZOOM_CENTER = 107
|
||||||
|
ICON_BOX_DOTS_SMALL = 108
|
||||||
|
ICON_BOX_DOTS_BIG = 109
|
||||||
|
ICON_BOX_CONCENTRIC = 110
|
||||||
|
ICON_BOX_GRID_BIG = 111
|
||||||
|
ICON_OK_TICK = 112
|
||||||
|
ICON_CROSS = 113
|
||||||
|
ICON_ARROW_LEFT = 114
|
||||||
|
ICON_ARROW_RIGHT = 115
|
||||||
|
ICON_ARROW_DOWN = 116
|
||||||
|
ICON_ARROW_UP = 117
|
||||||
|
ICON_ARROW_LEFT_FILL = 118
|
||||||
|
ICON_ARROW_RIGHT_FILL = 119
|
||||||
|
ICON_ARROW_DOWN_FILL = 120
|
||||||
|
ICON_ARROW_UP_FILL = 121
|
||||||
|
ICON_AUDIO = 122
|
||||||
|
ICON_FX = 123
|
||||||
|
ICON_WAVE = 124
|
||||||
|
ICON_WAVE_SINUS = 125
|
||||||
|
ICON_WAVE_SQUARE = 126
|
||||||
|
ICON_WAVE_TRIANGULAR = 127
|
||||||
|
ICON_CROSS_SMALL = 128
|
||||||
|
ICON_PLAYER_PREVIOUS = 129
|
||||||
|
ICON_PLAYER_PLAY_BACK = 130
|
||||||
|
ICON_PLAYER_PLAY = 131
|
||||||
|
ICON_PLAYER_PAUSE = 132
|
||||||
|
ICON_PLAYER_STOP = 133
|
||||||
|
ICON_PLAYER_NEXT = 134
|
||||||
|
ICON_PLAYER_RECORD = 135
|
||||||
|
ICON_MAGNET = 136
|
||||||
|
ICON_LOCK_CLOSE = 137
|
||||||
|
ICON_LOCK_OPEN = 138
|
||||||
|
ICON_CLOCK = 139
|
||||||
|
ICON_TOOLS = 140
|
||||||
|
ICON_GEAR = 141
|
||||||
|
ICON_GEAR_BIG = 142
|
||||||
|
ICON_BIN = 143
|
||||||
|
ICON_HAND_POINTER = 144
|
||||||
|
ICON_LASER = 145
|
||||||
|
ICON_COIN = 146
|
||||||
|
ICON_EXPLOSION = 147
|
||||||
|
ICON_1UP = 148
|
||||||
|
ICON_PLAYER = 149
|
||||||
|
ICON_PLAYER_JUMP = 150
|
||||||
|
ICON_KEY = 151
|
||||||
|
ICON_DEMON = 152
|
||||||
|
ICON_TEXT_POPUP = 153
|
||||||
|
ICON_GEAR_EX = 154
|
||||||
|
ICON_CRACK = 155
|
||||||
|
ICON_CRACK_POINTS = 156
|
||||||
|
ICON_STAR = 157
|
||||||
|
ICON_DOOR = 158
|
||||||
|
ICON_EXIT = 159
|
||||||
|
ICON_MODE_2D = 160
|
||||||
|
ICON_MODE_3D = 161
|
||||||
|
ICON_CUBE = 162
|
||||||
|
ICON_CUBE_FACE_TOP = 163
|
||||||
|
ICON_CUBE_FACE_LEFT = 164
|
||||||
|
ICON_CUBE_FACE_FRONT = 165
|
||||||
|
ICON_CUBE_FACE_BOTTOM = 166
|
||||||
|
ICON_CUBE_FACE_RIGHT = 167
|
||||||
|
ICON_CUBE_FACE_BACK = 168
|
||||||
|
ICON_CAMERA = 169
|
||||||
|
ICON_SPECIAL = 170
|
||||||
|
ICON_LINK_NET = 171
|
||||||
|
ICON_LINK_BOXES = 172
|
||||||
|
ICON_LINK_MULTI = 173
|
||||||
|
ICON_LINK = 174
|
||||||
|
ICON_LINK_BROKE = 175
|
||||||
|
ICON_TEXT_NOTES = 176
|
||||||
|
ICON_NOTEBOOK = 177
|
||||||
|
ICON_SUITCASE = 178
|
||||||
|
ICON_SUITCASE_ZIP = 179
|
||||||
|
ICON_MAILBOX = 180
|
||||||
|
ICON_MONITOR = 181
|
||||||
|
ICON_PRINTER = 182
|
||||||
|
ICON_PHOTO_CAMERA = 183
|
||||||
|
ICON_PHOTO_CAMERA_FLASH = 184
|
||||||
|
ICON_HOUSE = 185
|
||||||
|
ICON_HEART = 186
|
||||||
|
ICON_CORNER = 187
|
||||||
|
ICON_VERTICAL_BARS = 188
|
||||||
|
ICON_VERTICAL_BARS_FILL = 189
|
||||||
|
ICON_LIFE_BARS = 190
|
||||||
|
ICON_INFO = 191
|
||||||
|
ICON_CROSSLINE = 192
|
||||||
|
ICON_HELP = 193
|
||||||
|
ICON_FILETYPE_ALPHA = 194
|
||||||
|
ICON_FILETYPE_HOME = 195
|
||||||
|
ICON_LAYERS_VISIBLE = 196
|
||||||
|
ICON_LAYERS = 197
|
||||||
|
ICON_WINDOW = 198
|
||||||
|
ICON_HIDPI = 199
|
||||||
|
ICON_FILETYPE_BINARY = 200
|
||||||
|
ICON_HEX = 201
|
||||||
|
ICON_SHIELD = 202
|
||||||
|
ICON_FILE_NEW = 203
|
||||||
|
ICON_FOLDER_ADD = 204
|
||||||
|
ICON_ALARM = 205
|
||||||
|
ICON_CPU = 206
|
||||||
|
ICON_ROM = 207
|
||||||
|
ICON_STEP_OVER = 208
|
||||||
|
ICON_STEP_INTO = 209
|
||||||
|
ICON_STEP_OUT = 210
|
||||||
|
ICON_RESTART = 211
|
||||||
|
ICON_BREAKPOINT_ON = 212
|
||||||
|
ICON_BREAKPOINT_OFF = 213
|
||||||
|
ICON_BURGER_MENU = 214
|
||||||
|
ICON_CASE_SENSITIVE = 215
|
||||||
|
ICON_REG_EXP = 216
|
||||||
|
ICON_FOLDER = 217
|
||||||
|
ICON_FILE = 218
|
||||||
|
ICON_SAND_TIMER = 219
|
||||||
|
ICON_WARNING = 220
|
||||||
|
ICON_HELP_BOX = 221
|
||||||
|
ICON_INFO_BOX = 222
|
||||||
|
ICON_PRIORITY = 223
|
||||||
|
ICON_LAYERS_ISO = 224
|
||||||
|
ICON_LAYERS2 = 225
|
||||||
|
ICON_MLAYERS = 226
|
||||||
|
ICON_MAPS = 227
|
||||||
|
ICON_HOT = 228
|
||||||
|
ICON_229 = 229
|
||||||
|
ICON_230 = 230
|
||||||
|
ICON_231 = 231
|
||||||
|
ICON_232 = 232
|
||||||
|
ICON_233 = 233
|
||||||
|
ICON_234 = 234
|
||||||
|
ICON_235 = 235
|
||||||
|
ICON_236 = 236
|
||||||
|
ICON_237 = 237
|
||||||
|
ICON_238 = 238
|
||||||
|
ICON_239 = 239
|
||||||
|
ICON_240 = 240
|
||||||
|
ICON_241 = 241
|
||||||
|
ICON_242 = 242
|
||||||
|
ICON_243 = 243
|
||||||
|
ICON_244 = 244
|
||||||
|
ICON_245 = 245
|
||||||
|
ICON_246 = 246
|
||||||
|
ICON_247 = 247
|
||||||
|
ICON_248 = 248
|
||||||
|
ICON_249 = 249
|
||||||
|
ICON_250 = 250
|
||||||
|
ICON_251 = 251
|
||||||
|
ICON_252 = 252
|
||||||
|
ICON_253 = 253
|
||||||
|
ICON_254 = 254
|
||||||
|
ICON_255 = 255
|
||||||
|
|
||||||
1
raylib/raylib/version.py
Normal file
1
raylib/raylib/version.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
__version__ = "5.5.0.8"
|
||||||
61
raylib/setup.py
Normal file
61
raylib/setup.py
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import glob
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from setuptools import setup
|
||||||
|
from setuptools.command.build_py import build_py
|
||||||
|
|
||||||
|
try:
|
||||||
|
from wheel.bdist_wheel import bdist_wheel
|
||||||
|
except ImportError:
|
||||||
|
bdist_wheel = None
|
||||||
|
|
||||||
|
|
||||||
|
class BuildRaylib(build_py):
|
||||||
|
"""Run build.sh to compile the C library and CFFI extension before collecting package data."""
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
|
|
||||||
|
# Build CFFI extension so it's included in the wheel
|
||||||
|
cffi_so = glob.glob(os.path.join(pkg_dir, "raylib", "_raylib_cffi*"))
|
||||||
|
if not cffi_so:
|
||||||
|
build_cffi = os.path.join(pkg_dir, "raylib", "build.py")
|
||||||
|
if os.path.isfile(build_cffi):
|
||||||
|
subprocess.check_call([sys.executable, build_cffi], cwd=pkg_dir)
|
||||||
|
|
||||||
|
super().run()
|
||||||
|
|
||||||
|
|
||||||
|
cmdclass = {"build_py": BuildRaylib}
|
||||||
|
|
||||||
|
if bdist_wheel is not None:
|
||||||
|
|
||||||
|
class PlatformWheel(bdist_wheel):
|
||||||
|
"""Produce a platform-specific wheel (contains native .a library)."""
|
||||||
|
|
||||||
|
def finalize_options(self):
|
||||||
|
super().finalize_options()
|
||||||
|
self.root_is_pure = False
|
||||||
|
|
||||||
|
def get_tag(self):
|
||||||
|
system = platform.system()
|
||||||
|
machine = platform.machine()
|
||||||
|
|
||||||
|
if system == "Linux":
|
||||||
|
plat = f"linux_{machine}"
|
||||||
|
elif system == "Darwin":
|
||||||
|
plat = "macosx_11_0_arm64"
|
||||||
|
else:
|
||||||
|
plat = f"{system.lower()}_{machine}"
|
||||||
|
|
||||||
|
return "py3", "none", plat
|
||||||
|
|
||||||
|
cmdclass["bdist_wheel"] = PlatformWheel
|
||||||
|
|
||||||
|
|
||||||
|
setup(cmdclass=cmdclass)
|
||||||
131
release.sh
Executable file
131
release.sh
Executable file
@@ -0,0 +1,131 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||||
|
cd "$ROOT_DIR"
|
||||||
|
|
||||||
|
REPO=commaai/dependencies
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Publishing wheels to GitHub Releases ($REPO)"
|
||||||
|
|
||||||
|
shopt -s nullglob
|
||||||
|
for toml in */pyproject.toml; do
|
||||||
|
pkg="$(dirname "$toml")"
|
||||||
|
module="${pkg//-/_}"
|
||||||
|
version="$(python3 -c "import tomllib; print(tomllib.load(open('$toml', 'rb'))['project']['version'])")"
|
||||||
|
tag="${pkg}/v${version}"
|
||||||
|
|
||||||
|
wheels=("dist/${module}-${version}-"*.whl)
|
||||||
|
if [[ ${#wheels[@]} -eq 0 ]]; then
|
||||||
|
echo "missing wheel for $pkg ($module-$version) in dist" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "[$pkg] Uploading ${#wheels[@]} wheel(s) to $tag"
|
||||||
|
|
||||||
|
gh release create "$tag" "${wheels[@]}" --repo "$REPO" --title "$pkg v$version" --notes "Platform wheels for $pkg $version" 2>/dev/null ||
|
||||||
|
gh release upload "$tag" "${wheels[@]}" --repo "$REPO" --clobber
|
||||||
|
done
|
||||||
|
shopt -u nullglob
|
||||||
|
|
||||||
|
TOKEN="$(gh auth token 2>/dev/null)" || { echo "set GH_TOKEN to publish shim branch" >&2; exit 1; }
|
||||||
|
|
||||||
|
TMP_DIR="$(mktemp -d)"
|
||||||
|
python3 - "$TMP_DIR" "$REPO" <<'PY'
|
||||||
|
import json
|
||||||
|
import pathlib
|
||||||
|
import shutil
|
||||||
|
import tomllib
|
||||||
|
import sys
|
||||||
|
|
||||||
|
tmp_dir = pathlib.Path(sys.argv[1])
|
||||||
|
repo = sys.argv[2]
|
||||||
|
repo_url = f"https://github.com/{repo}"
|
||||||
|
shim_setup = pathlib.Path("_shim_setup.py")
|
||||||
|
|
||||||
|
for toml in sorted(pathlib.Path(".").glob("*/pyproject.toml")):
|
||||||
|
pkg = toml.parent.name
|
||||||
|
module = pkg.replace("-", "_")
|
||||||
|
data = tomllib.load(toml.open("rb"))
|
||||||
|
version = str(data["project"]["version"])
|
||||||
|
tag = f"{pkg}/v{version}"
|
||||||
|
description = data["project"]["description"]
|
||||||
|
patterns = data.get("tool", {}).get("setuptools", {}).get("package-data", {}).get(module, [""])
|
||||||
|
datadir = patterns[0].split("/", 1)[0] if patterns and patterns[0] else ""
|
||||||
|
scripts = data.get("project", {}).get("scripts", {}) or {}
|
||||||
|
|
||||||
|
pkg_dir = tmp_dir / pkg
|
||||||
|
mod_dir = pkg_dir / module
|
||||||
|
mod_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
# copy all .py files from the main module
|
||||||
|
src_mod = pathlib.Path(pkg) / module
|
||||||
|
for py_file in src_mod.glob("*.py"):
|
||||||
|
shutil.copy2(py_file, mod_dir / py_file.name)
|
||||||
|
|
||||||
|
# copy extra packages (e.g. pyray for raylib)
|
||||||
|
include_patterns = data.get("tool", {}).get("setuptools", {}).get("packages", {}).get("find", {}).get("include", [])
|
||||||
|
extra_packages = []
|
||||||
|
for pattern in include_patterns:
|
||||||
|
p = pattern.rstrip("*")
|
||||||
|
if p and p != module and p != f"{module}/":
|
||||||
|
src_extra = pathlib.Path(pkg) / p
|
||||||
|
if src_extra.is_dir():
|
||||||
|
dst_extra = pkg_dir / p
|
||||||
|
shutil.copytree(src_extra, dst_extra, dirs_exist_ok=True)
|
||||||
|
extra_packages.append(pattern)
|
||||||
|
|
||||||
|
shutil.copy2(shim_setup, pkg_dir / "setup.py")
|
||||||
|
|
||||||
|
deps = data.get("project", {}).get("dependencies", [])
|
||||||
|
|
||||||
|
lines = [
|
||||||
|
"[build-system]",
|
||||||
|
'requires = ["setuptools>=64", "wheel", \'tomli; python_version < \"3.11\"\']',
|
||||||
|
'build-backend = "setuptools.build_meta"',
|
||||||
|
"",
|
||||||
|
"[project]",
|
||||||
|
f'name = "{pkg}"',
|
||||||
|
f'version = "{version}"',
|
||||||
|
f"description = {json.dumps(description + ' (pre-built)')}",
|
||||||
|
'requires-python = ">=3.8"',
|
||||||
|
]
|
||||||
|
|
||||||
|
if deps:
|
||||||
|
lines.append(f"dependencies = {json.dumps(deps)}")
|
||||||
|
|
||||||
|
if scripts:
|
||||||
|
lines += ["", "[project.scripts]"]
|
||||||
|
for name, target in scripts.items():
|
||||||
|
lines.append(f'"{name}" = {json.dumps(target)}')
|
||||||
|
|
||||||
|
find_include = [f"{module}*"] + extra_packages
|
||||||
|
lines += [
|
||||||
|
"",
|
||||||
|
"[tool.setuptools.packages.find]",
|
||||||
|
f"include = {json.dumps(find_include)}",
|
||||||
|
"",
|
||||||
|
"[tool.setuptools.package-data]",
|
||||||
|
f'{module} = ["{datadir}/**/*", "*.so"]',
|
||||||
|
"",
|
||||||
|
"[tool.shim]",
|
||||||
|
f'repo_url = "{repo_url}"',
|
||||||
|
f'tag = "{tag}"',
|
||||||
|
f'datadir = "{datadir}"',
|
||||||
|
]
|
||||||
|
|
||||||
|
(pkg_dir / "pyproject.toml").write_text("\n".join(lines) + "\n")
|
||||||
|
PY
|
||||||
|
|
||||||
|
(
|
||||||
|
cd "$TMP_DIR"
|
||||||
|
git init
|
||||||
|
git checkout -b releases
|
||||||
|
git add .
|
||||||
|
git -c user.name="github-actions[bot]" -c user.email="github-actions[bot]@users.noreply.github.com" commit -m "update shim packages"
|
||||||
|
git remote add origin "https://x-access-token:${TOKEN}@github.com/${REPO}.git"
|
||||||
|
git push -f origin releases
|
||||||
|
)
|
||||||
|
|
||||||
|
rm -rf "$TMP_DIR"
|
||||||
37
setup.sh
37
setup.sh
@@ -1,8 +1,39 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
# sets up build-time dependencies (NOT runtime dependencies)
|
||||||
|
|
||||||
|
run_as_root() {
|
||||||
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
"$@"
|
||||||
|
elif command -v sudo &>/dev/null; then
|
||||||
|
sudo "$@"
|
||||||
|
else
|
||||||
|
echo "error: root privileges required for: $*" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [ "$(uname)" = "Darwin" ]; then
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
brew install nasm pkg-config
|
brew install nasm pkg-config ccache
|
||||||
else
|
elif command -v dnf &>/dev/null; then
|
||||||
sudo apt-get update && sudo apt-get install -y nasm cmake g++ pkg-config
|
dnf install -y nasm cmake gcc-c++ pkgconfig git perl-IPC-Cmd ccache
|
||||||
|
elif command -v apt-get &>/dev/null; then
|
||||||
|
run_as_root apt-get update
|
||||||
|
run_as_root apt-get install -y nasm cmake g++ pkg-config curl ccache
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v uv &>/dev/null; then
|
||||||
|
command -v curl &>/dev/null || {
|
||||||
|
echo "error: curl is required to install uv" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
UV_BIN_DIR="$HOME/.local/bin"
|
||||||
|
mkdir -p "$UV_BIN_DIR"
|
||||||
|
curl -LsSf https://astral.sh/uv/install.sh | env UV_UNMANAGED_INSTALL="$UV_BIN_DIR" sh
|
||||||
|
export PATH="$UV_BIN_DIR:$PATH"
|
||||||
|
command -v uv &>/dev/null || {
|
||||||
|
echo "error: failed to install uv" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|||||||
18
smoketest.sh
18
smoketest.sh
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
|
||||||
WHEEL_DIR="${1:?Usage: smoketest.sh <wheel-directory>}"
|
|
||||||
WHEEL_DIR="$(cd "$WHEEL_DIR" && pwd)"
|
|
||||||
|
|
||||||
VENV_DIR="$(mktemp -d)"
|
|
||||||
trap 'rm -rf "$VENV_DIR"' EXIT
|
|
||||||
python3 -m venv "$VENV_DIR"
|
|
||||||
source "$VENV_DIR/bin/activate"
|
|
||||||
pip install --upgrade pip >/dev/null
|
|
||||||
pip install "$WHEEL_DIR"/*.whl
|
|
||||||
|
|
||||||
for toml in "$REPO_DIR"/*/pyproject.toml; do
|
|
||||||
module="$(basename "$(dirname "$toml")" | tr '-' '_')"
|
|
||||||
python3 -c "import $module; $module.smoketest()" && echo "$module: OK"
|
|
||||||
done
|
|
||||||
60
test.sh
60
test.sh
@@ -1,60 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
|
||||||
|
|
||||||
# Create a temporary virtualenv
|
|
||||||
VENV_DIR="$(mktemp -d)"
|
|
||||||
trap 'rm -rf "$VENV_DIR"' EXIT
|
|
||||||
python3 -m venv "$VENV_DIR"
|
|
||||||
source "$VENV_DIR/bin/activate"
|
|
||||||
pip install --upgrade pip >/dev/null
|
|
||||||
|
|
||||||
# Auto-discover packages: any subdirectory containing a pyproject.toml
|
|
||||||
PACKAGES=()
|
|
||||||
for toml in "$REPO_DIR"/*/pyproject.toml; do
|
|
||||||
[ -f "$toml" ] || continue
|
|
||||||
PACKAGES+=("$(dirname "$toml")")
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ${#PACKAGES[@]} -eq 0 ]; then
|
|
||||||
echo "No packages found."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
FAILED=()
|
|
||||||
|
|
||||||
for pkg in "${PACKAGES[@]}"; do
|
|
||||||
name="$(basename "$pkg")"
|
|
||||||
echo "========================================="
|
|
||||||
echo "Testing: $name"
|
|
||||||
echo "========================================="
|
|
||||||
|
|
||||||
# Install from git URL with subdirectory (simulates real-world usage)
|
|
||||||
echo "[$name] pip install ..."
|
|
||||||
pip install "$pkg" --verbose
|
|
||||||
|
|
||||||
# Verify import works
|
|
||||||
module="${name//-/_}"
|
|
||||||
echo "[$name] Verifying import of $module ..."
|
|
||||||
python -c "import $module; print(f'{$module.__name__} OK')"
|
|
||||||
|
|
||||||
echo "[$name] PASSED"
|
|
||||||
echo
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ${#FAILED[@]} -ne 0 ]; then
|
|
||||||
echo "FAILED packages: ${FAILED[*]}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "All ${#PACKAGES[@]} package(s) passed."
|
|
||||||
echo
|
|
||||||
echo "Installed sizes:"
|
|
||||||
for pkg in "${PACKAGES[@]}"; do
|
|
||||||
name="$(basename "$pkg")"
|
|
||||||
module="${name//-/_}"
|
|
||||||
mod_dir="$(python -c "import $module, os; print(os.path.dirname($module.__file__))")"
|
|
||||||
size="$(du -sh "$mod_dir" | cut -f1)"
|
|
||||||
echo " $name: $size"
|
|
||||||
done
|
|
||||||
42
test_wheels_in_image.sh
Executable file
42
test_wheels_in_image.sh
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# a small script for testing our built wheels in a variety of linux distros
|
||||||
|
|
||||||
|
IMAGE="${1:?usage: ./test_wheels_in_image.sh <image>}"
|
||||||
|
|
||||||
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||||
|
cd "$ROOT_DIR"
|
||||||
|
|
||||||
|
# setup our deps - should only need a python3 build
|
||||||
|
docker build -t wheeltest -f - . <<DOCKERFILE
|
||||||
|
FROM $IMAGE
|
||||||
|
RUN if command -v apk >/dev/null; then \
|
||||||
|
apk add --no-cache python3 py3-pip bash; \
|
||||||
|
elif command -v apt-get >/dev/null; then \
|
||||||
|
apt-get update && apt-get install -y --no-install-recommends python3 python3-pip python3-venv; \
|
||||||
|
elif command -v dnf >/dev/null; then \
|
||||||
|
dnf install -y python3 python3-pip; \
|
||||||
|
elif command -v pacman >/dev/null; then \
|
||||||
|
pacman -Sy --noconfirm python python-pip; \
|
||||||
|
elif command -v zypper >/dev/null; then \
|
||||||
|
zypper install -y python3 python3-pip; \
|
||||||
|
elif command -v xbps-install >/dev/null; then \
|
||||||
|
xbps-install -Sy python3 python3-pip bash; \
|
||||||
|
fi
|
||||||
|
DOCKERFILE
|
||||||
|
|
||||||
|
# install + smoketest
|
||||||
|
docker run --rm -v "$PWD:/work" -w /work wheeltest bash -lc '
|
||||||
|
set -euo pipefail
|
||||||
|
python3 -m venv /tmp/venv
|
||||||
|
source /tmp/venv/bin/activate
|
||||||
|
pip install dist/*.whl
|
||||||
|
for toml in */pyproject.toml; do
|
||||||
|
module="$(basename "$(dirname "$toml")" | tr "-" "_")"
|
||||||
|
python -c "import $module; $module.smoketest()" && echo "$module: OK"
|
||||||
|
done
|
||||||
|
'
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "All good!"
|
||||||
@@ -7,18 +7,15 @@ cd "$DIR"
|
|||||||
VERSION="4.3.5"
|
VERSION="4.3.5"
|
||||||
INSTALL_DIR="$DIR/zeromq/install"
|
INSTALL_DIR="$DIR/zeromq/install"
|
||||||
|
|
||||||
# Idempotent: skip if already built
|
|
||||||
if [ -f "$INSTALL_DIR/lib/libzmq.a" ]; then
|
|
||||||
echo "zeromq already present, skipping build."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
||||||
|
|
||||||
# Clone
|
# Clone/update source
|
||||||
if [ ! -d "libzmq-src" ]; then
|
if [ ! -d "libzmq-src/.git" ]; then
|
||||||
git clone --depth 1 --branch "v${VERSION}" https://github.com/zeromq/libzmq.git libzmq-src
|
rm -rf libzmq-src
|
||||||
|
git clone --depth 1 https://github.com/zeromq/libzmq.git libzmq-src
|
||||||
fi
|
fi
|
||||||
|
git -C libzmq-src fetch --depth 1 origin "v${VERSION}"
|
||||||
|
git -C libzmq-src checkout --force FETCH_HEAD
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
PREFIX="$DIR/build/prefix"
|
PREFIX="$DIR/build/prefix"
|
||||||
@@ -30,6 +27,8 @@ cmake -S libzmq-src -B "$DIR/build" \
|
|||||||
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
||||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||||
|
-DCMAKE_C_FLAGS="-fPIC" \
|
||||||
|
-DCMAKE_CXX_FLAGS="-fPIC" \
|
||||||
-DWITH_LIBSODIUM=OFF \
|
-DWITH_LIBSODIUM=OFF \
|
||||||
-DWITH_TLS=OFF \
|
-DWITH_TLS=OFF \
|
||||||
-DWITH_DOCS=OFF \
|
-DWITH_DOCS=OFF \
|
||||||
@@ -52,8 +51,5 @@ cp "$PREFIX/lib/libzmq.a" "$INSTALL_DIR/lib/"
|
|||||||
cp "$PREFIX/include/zmq.h" "$INSTALL_DIR/include/"
|
cp "$PREFIX/include/zmq.h" "$INSTALL_DIR/include/"
|
||||||
cp "$PREFIX/include/zmq_utils.h" "$INSTALL_DIR/include/"
|
cp "$PREFIX/include/zmq_utils.h" "$INSTALL_DIR/include/"
|
||||||
|
|
||||||
# Clean up
|
|
||||||
rm -rf libzmq-src "$DIR/build"
|
|
||||||
|
|
||||||
echo "Installed zeromq to $INSTALL_DIR"
|
echo "Installed zeromq to $INSTALL_DIR"
|
||||||
du -sh "$INSTALL_DIR"
|
du -sh "$INSTALL_DIR"
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ class BuildZeromq(build_py):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
marker = os.path.join(pkg_dir, "zeromq", "install", "lib", "libzmq.a")
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
if not os.path.exists(marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|||||||
@@ -7,18 +7,15 @@ cd "$DIR"
|
|||||||
VERSION="1.5.6"
|
VERSION="1.5.6"
|
||||||
INSTALL_DIR="$DIR/zstd/install"
|
INSTALL_DIR="$DIR/zstd/install"
|
||||||
|
|
||||||
# Idempotent: skip if already built
|
|
||||||
if [ -f "$INSTALL_DIR/lib/libzstd.a" ]; then
|
|
||||||
echo "zstd already present, skipping build."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
|
||||||
|
|
||||||
# Clone
|
# Clone/update source
|
||||||
if [ ! -d "zstd-src" ]; then
|
if [ ! -d "zstd-src/.git" ]; then
|
||||||
git clone --depth 1 --branch "v${VERSION}" https://github.com/facebook/zstd.git zstd-src
|
rm -rf zstd-src
|
||||||
|
git clone --depth 1 https://github.com/facebook/zstd.git zstd-src
|
||||||
fi
|
fi
|
||||||
|
git -C zstd-src fetch --depth 1 origin "v${VERSION}"
|
||||||
|
git -C zstd-src checkout --force FETCH_HEAD
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
PREFIX="$DIR/build/prefix"
|
PREFIX="$DIR/build/prefix"
|
||||||
@@ -30,6 +27,7 @@ cmake -S zstd-src/build/cmake -B "$DIR/build" \
|
|||||||
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
||||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||||
|
-DCMAKE_C_FLAGS="-fPIC" \
|
||||||
-DZSTD_BUILD_PROGRAMS=OFF \
|
-DZSTD_BUILD_PROGRAMS=OFF \
|
||||||
-DZSTD_BUILD_TESTS=OFF \
|
-DZSTD_BUILD_TESTS=OFF \
|
||||||
-DZSTD_BUILD_CONTRIB=OFF \
|
-DZSTD_BUILD_CONTRIB=OFF \
|
||||||
@@ -51,8 +49,5 @@ cp "$PREFIX/include/zstd.h" "$INSTALL_DIR/include/"
|
|||||||
cp "$PREFIX/include/zstd_errors.h" "$INSTALL_DIR/include/"
|
cp "$PREFIX/include/zstd_errors.h" "$INSTALL_DIR/include/"
|
||||||
cp "$PREFIX/include/zdict.h" "$INSTALL_DIR/include/"
|
cp "$PREFIX/include/zdict.h" "$INSTALL_DIR/include/"
|
||||||
|
|
||||||
# Clean up
|
|
||||||
rm -rf zstd-src "$DIR/build"
|
|
||||||
|
|
||||||
echo "Installed zstd to $INSTALL_DIR"
|
echo "Installed zstd to $INSTALL_DIR"
|
||||||
du -sh "$INSTALL_DIR"
|
du -sh "$INSTALL_DIR"
|
||||||
|
|||||||
@@ -15,11 +15,8 @@ class BuildZstd(build_py):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
pkg_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
marker = os.path.join(pkg_dir, "zstd", "install", "lib", "libzstd.a")
|
build_script = os.path.join(pkg_dir, "build.sh")
|
||||||
|
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
||||||
if not os.path.exists(marker):
|
|
||||||
build_script = os.path.join(pkg_dir, "build.sh")
|
|
||||||
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
|
|
||||||
|
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user