Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions recipes/recipes_emscripten/pyxel/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -euo pipefail

# Build SDL2 for emscripten (required by pyxel)
embuilder build sdl2 --pic

# Set environment variables for maturin and emscripten
export MATURIN_PYTHON_SYSCONFIGDATA_DIR=${PREFIX}/etc/conda/_sysconfigdata__emscripten_wasm32-emscripten.py
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1

# Change to the Python subdirectory where pyproject.toml is located
cd python

# Copy LICENSE file
cp ../LICENSE pyxel/

# Install using pip (which will use maturin via pyproject.toml)
${PYTHON} -m pip install . -vvv
56 changes: 56 additions & 0 deletions recipes/recipes_emscripten/pyxel/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
context:
name: pyxel
version: "2.5.4"

package:
name: ${{ name }}
version: ${{ version }}

source:
url: https://github.com/kitao/pyxel/archive/refs/tags/v${{ version }}.tar.gz
sha256: da328a30f76dae5f9df0130ae746248f8ef23efba6f3a5e5429df34ba81c345a

build:
number: 0

requirements:
build:
- cross-python_${{ target_platform }}
- ${{ compiler("c") }}
- setuptools-rust
- rust
- rust-src
- maturin
host:
- python
- openssl
run:
- python

tests:
- script: pytester
requirements:
build:
- pytester
run:
- pytester-run
files:
recipe:
- test_import_pyxel.py

about:
summary: A retro game engine for Python
description: |
Pyxel is a retro game engine for Python. Thanks to its simple specifications
inspired by retro gaming consoles, such as only 16 colors can be displayed
and only 4 sounds can be played back at the same time, you can feel free to
enjoy making pixel art style games.
homepage: https://github.com/kitao/pyxel
license: MIT
license_file: LICENSE
repository: https://github.com/kitao/pyxel
documentation: https://github.com/kitao/pyxel

extra:
recipe-maintainers:
- Copilot
22 changes: 22 additions & 0 deletions recipes/recipes_emscripten/pyxel/test_import_pyxel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
def test_import_pyxel():
"""Test that pyxel can be imported successfully."""
import pyxel
print("pyxel import successful")


def test_pyxel_version():
"""Test that pyxel version is accessible."""
import pyxel
print(f"pyxel version: {pyxel.__version__}")


def test_pyxel_basic_attributes():
"""Test that basic pyxel attributes are available."""
import pyxel

# Try to access some basic pyxel attributes
assert hasattr(pyxel, 'init'), "pyxel.init not found"
assert hasattr(pyxel, 'run'), "pyxel.run not found"
assert hasattr(pyxel, 'cls'), "pyxel.cls not found"

print("All basic pyxel imports and attributes are available")
Loading