Metadata-Version: 2.1
Name: attacus
Version: 0.1.0
Summary: Python Flutter Extension
Author-email: Kurtis Fields <kurtisfields@gmail.com>
License: MIT License        
        Copyright (c) 2023 Kurtis Fields        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.        
Project-URL: homepage, https://github.com/crunge/attacus
Project-URL: documentation, https://crungelab.github.io/attacus/
Project-URL: repository, https://github.com/crungelab/attacus
Project-URL: changelog, https://github.com/crungelab/attacus/blob/main/CHANGELOG.md
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: loguru (==0.7.0)
Requires-Dist: platformdirs (==3.5.1)
Provides-Extra: dev
Requires-Dist: black (~=22.12.0) ; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest (~=7.2.1) ; extra == 'test'

# Attacus :butterfly: :snake:

Flutter SDL Python

[Flutter](https://flutter.dev/)

[SDL](https://github.com/libsdl-org/SDL/)

## Required

* [Hatch](https://hatch.pypa.io/)

## Optional

* [Ninja](https://ninja-build.org/)

## Clone

```bash
git clone https://github.com/crungelab/attacus
cd attacus
```

## Extra Steps

You need to download the Flutter engine binaries from: [Custom-Flutter-Engine-Embedders](https://github.com/flutter/flutter/wiki/Custom-Flutter-Engine-Embedders)

Extract to: [project-root]/binaries/flutter

# Development

## Tool Chain

[cxbuild](https://github.com/crungelab/cxbuild)

[pybind11](https://github.com/pybind/pybind11)

## Develop
```bash
hatch shell
procure
cxbuild develop
```

### Release
```bash
cxbuild
```

## Quick Start
```bash
git clone --recursive https://github.com/kfields/attacus
cd attacus
mkdir build
cd build
cmake ..
```
### Or
```bash
mkdir build-debug
cd build-debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
```
## Wayland
```bash
sudo apt install libwayland-dev
sudo apt install libxkbcommon-dev
sudo add-apt-repository ppa:christianrauch/libdecoration

cmake -DATT_WM_WAYLAND=ON -DCMAKE_BUILD_TYPE=Debug ..
```

## Glad
    v1
    glad --generator c --no-loader --out-path src
    
    v2
    glad --api gl:core --out-path src/glad c


## [Flutter Custom Devices](https://github.com/flutter/flutter/wiki/Using-custom-embedders-with-the-Flutter-CLI)
```
flutter channel master
flutter config --enable-custom-devices
flutter custom-devices
```
C:\Users\kurti\AppData\Roaming\.flutter_custom_devices.json

``` json
    {
      "id": "attacus",
      "label": "Attacus",
      "sdkNameAndVersion": "Attacus 0.1",
      "platform": null,
      "enabled": true,
      "ping": [
        "ping",
        "-n",
        "1",
        "-w",
        "500",
        "localhost"
      ],
      "pingSuccessRegex": "[<=]\\d+ms",
      "postBuild": null,
      "install": [
        "python",
        "--version"
      ],
      "uninstall": [
        "python",
        "--version"
      ],
      "runDebug": [
        "python",
        "main.py"
      ],
      "forwardPort": null,
      "forwardPortSuccessRegex": null,
      "screenshot": null
    }
```

## [Flutter Embedder](https://github.com/flutter/flutter/wiki/Custom-Flutter-Engine-Embedders)
Get the SHA of the Flutter engine you wish to use
```bash
cd flutter/bin/internal
cat engine.version
```

## Flutter Examples
```bash
flutter build bundle
python main.py
```
or
```bash
flutter run
```


## icudtl.dat
```
flutter\bin\cache\artifacts\engine\windows-x64\icudtl.dat
```
I'm manually copying this into the build directory.  Not good.
It needs to be copied over automatically
