Skip to content

Commit

Permalink
Merge branch 'main' of github.com:paxo-phone/PaxOS-9
Browse files Browse the repository at this point in the history
  • Loading branch information
paxo-rch committed Apr 30, 2024
2 parents c94ee03 + 76b1d77 commit 0c81e8e
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 5 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/platformio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: PlatformIO

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
espBuild:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Build PlatformIO Project for Paxo ESP32
run: pio run -e paxo-v5

linuxBuild:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Install SDL2
run: sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse" && sudo apt-get update -y -qq && sudo apt-get install libsdl2-dev

- name: Build PlatformIO Project for Linux
run: pio run -e linux

macOSBuild:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Install SDL2
run: brew install SDL2

- name: Build PlatformIO Project for macOS
run: DYLD_LIBRARY_PATH="`brew --prefix sdl2`/lib" pio run -e macos
windowsBuild:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Build PlatformIO Project for Windows
run: pio run -e windows-build-only
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

![logo](https://github.com/paxo-phone/PaxOS-9/assets/45568523/ddb3b517-605c-41b4-8c1e-c8e5d156431b)

[![PlatformIO](https://github.com/paxo-phone/PaxOS-9/actions/workflows/platformio.yml/badge.svg)](https://github.com/paxo-phone/PaxOS-9/actions/workflows/platformio.yml)

**PaxOS 9** est la dernière version du **PaxOS**, un système d'exploitation léger destiné aux PaxoPhones.

- [Licence](#licence)
Expand Down
24 changes: 24 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ extra_scripts =
scripts/platformio/windows/execute.py
targets = execute

[env:windows-build-only]
platform = native
lib_deps =
lovyan03/LovyanGFX@^1.1.9
plerup/EspSoftwareSerial@^8.2.0
maxgerhardt/ghostl@^1.0.1
mbed-babylonica/[email protected]+sha.278f7f125495
build_flags =
-std=c++17
-lm
-Iextern/SDL2-2.28.5/x86_64-w64-mingw32/include/SDL2
-Lextern/SDL2-2.28.5/x86_64-w64-mingw32/lib
-lSDL2main
-lSDL2
-m64
-Wa,-mbig-obj
extra_scripts =
pre:scripts/platformio/windows/setup_workspace.py
pre:scripts/platformio/windows/copy_dependencies.py

[env:linux]
platform = native
lib_deps =
Expand Down Expand Up @@ -106,6 +126,10 @@ build_flags =
-lm
-lSDL2main
-lSDL2
-I/usr/local/include/SDL2 # we include both /usr/local/ and /opt/homebrew/ to support the macOS silicon and Intel as explained here https://stackoverflow.com/a/71186857/16456439
-L/usr/local/lib
-I/opt/homebrew/include/SDL2
-L/opt/homebrew/lib

[env:test]
platform = native
Expand Down
13 changes: 8 additions & 5 deletions scripts/platformio/windows/setup_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
import zipfile
import shutil


Import("env")


def SDL2_cleanup():
if os.path.exists("temp"):
if os.path.exists("temp\\SDL2.zip"):
os.remove("temp\\SDL2.zip")
os.remove("temp")
try:
if os.path.exists("temp"):
if os.path.exists("temp\\SDL2.zip"):
os.remove("temp\\SDL2.zip")
os.remove("temp")
except PermissionError:
print("Could not delete temp directory or the SDL2.zip file. Please delete them manually.")



def SDL2_download():
Expand Down

0 comments on commit 0c81e8e

Please sign in to comment.