Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b915667fba | ||
|
|
b7d60634dc | ||
|
|
d190a8b5f8 | ||
|
|
b757b35709 | ||
|
|
ce7316af29 | ||
|
|
bbc3bb3896 | ||
|
|
155545660e | ||
|
|
e5af8ea27d | ||
|
|
c2ed18a8ed | ||
|
|
9a24c2eb61 | ||
|
|
962343f220 | ||
|
|
b2ca454d44 | ||
|
|
114976b912 | ||
|
|
1c1ccd631a |
No files matched your search
@@ -0,0 +1,55 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Flatpak bundle for x86_64 and aarch64, built in Flathub's GNOME container. Runs when the
|
||||
# manifest changes, on demand, and on vX.Y.Z tags (the bundle is then attached to the release).
|
||||
name: Flatpak
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: ["packaging/flatpak/**", ".github/workflows/flatpak.yml"]
|
||||
tags: ["v*"]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
flatpak:
|
||||
name: Flatpak ${{ matrix.arch }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: x86_64
|
||||
runner: ubuntu-24.04
|
||||
- arch: aarch64
|
||||
runner: ubuntu-24.04-arm
|
||||
runs-on: ${{ matrix.runner }}
|
||||
container:
|
||||
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-51
|
||||
options: --privileged
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
|
||||
with:
|
||||
bundle: OpenPU-${{ matrix.arch }}.flatpak
|
||||
manifest-path: packaging/flatpak/io.github.openpu.OpenPU.yml
|
||||
arch: ${{ matrix.arch }}
|
||||
cache-key: flatpak-builder-${{ matrix.arch }}-${{ hashFiles('packaging/flatpak/*.yml') }}
|
||||
|
||||
- name: Attach to the release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ github.ref_name }}
|
||||
run: |
|
||||
git config --global --add safe.directory "$PWD"
|
||||
bundle="OpenPU-${TAG#v}-${{ matrix.arch }}.flatpak"
|
||||
mv "OpenPU-${{ matrix.arch }}.flatpak" "$bundle"
|
||||
gh release view "$TAG" >/dev/null 2>&1 ||
|
||||
gh release create "$TAG" --verify-tag --title "OpenPU ${TAG#v}" --notes-from-tag ||
|
||||
gh release view "$TAG" >/dev/null
|
||||
gh release upload "$TAG" "$bundle" --clobber
|
||||
@@ -0,0 +1,83 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Release binaries for Linux x86_64 and arm64: Debian package, AppImage and a tarball of the
|
||||
# command-line tool. On a vX.Y.Z tag they are attached to the GitHub release (created here if
|
||||
# tools/release.sh has not created it yet); a manual run keeps them as workflow artifacts.
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
name: Linux ${{ matrix.arch }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: x86_64
|
||||
runner: ubuntu-24.04
|
||||
- arch: arm64
|
||||
runner: ubuntu-24.04-arm
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0 # tags are needed for the version description
|
||||
|
||||
- name: Dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
build-essential cmake ninja-build pkg-config gettext file desktop-file-utils \
|
||||
libcurl4-openssl-dev libarchive-dev nlohmann-json3-dev doctest-dev \
|
||||
libglib2.0-dev libgtkmm-4.0-dev librsvg2-common
|
||||
|
||||
- name: Build and test
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DOPENPU_WERROR=ON -DOPENPU_UI_GTK=ON
|
||||
cmake --build build
|
||||
ctest --test-dir build --output-on-failure
|
||||
|
||||
- name: Debian package
|
||||
run: |
|
||||
cd build && cpack -G DEB
|
||||
dpkg-deb -I openpu_*.deb
|
||||
|
||||
- name: Command-line tool
|
||||
run: |
|
||||
version=$(build/src/cli/openpu-cli --version | awk '{print $2}')
|
||||
mkdir -p "dist/openpu-cli-$version-linux-${{ matrix.arch }}"
|
||||
cp build/src/cli/openpu-cli LICENSE README.md "dist/openpu-cli-$version-linux-${{ matrix.arch }}/"
|
||||
strip "dist/openpu-cli-$version-linux-${{ matrix.arch }}/openpu-cli"
|
||||
tar -C dist -czf "openpu-cli-$version-linux-${{ matrix.arch }}.tar.gz" "openpu-cli-$version-linux-${{ matrix.arch }}"
|
||||
|
||||
- name: AppImage
|
||||
run: tools/appimage.sh "$PWD/build-appimage"
|
||||
|
||||
- name: Collect
|
||||
run: |
|
||||
mkdir -p out
|
||||
mv build/openpu_*.deb openpu-cli-*.tar.gz OpenPU-*.AppImage out/
|
||||
(cd out && sha256sum * > SHA256SUMS-linux-${{ matrix.arch }}.txt && ls -l)
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: openpu-linux-${{ matrix.arch }}
|
||||
path: out/*
|
||||
|
||||
- name: Attach to the release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ github.ref_name }}
|
||||
run: |
|
||||
gh release view "$TAG" >/dev/null 2>&1 ||
|
||||
gh release create "$TAG" --verify-tag --title "OpenPU ${TAG#v}" --notes-from-tag ||
|
||||
gh release view "$TAG" >/dev/null # the other architecture may have created it meanwhile
|
||||
gh release upload "$TAG" out/* --clobber
|
||||
@@ -1,47 +1,89 @@
|
||||
# Changelog
|
||||
|
||||
Format: [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/). Versions follow
|
||||
[Semantic Versioning](https://semver.org/lang/fr/): `0.x` until the Linux and Haiku applications are
|
||||
Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions follow
|
||||
[Semantic Versioning](https://semver.org/): `0.x` until the Linux and Haiku applications are
|
||||
complete; every release is an annotated git tag `vX.Y.Z` (see `tools/release.sh`).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.3.0] - 2026-11-29
|
||||
|
||||
### Added
|
||||
- Haiku development VM tooling: `tools/haiku-vm.sh` (Haiku R1/beta6 x86_64 under QEMU/KVM, with a
|
||||
virtual USB stick) and `tools/qmp.py` (headless screenshots, clicks and typing through QMP).
|
||||
- Haiku USB backend (Storage Kit disk device API): lists USB drives, writes an MBR with one FAT32
|
||||
partition at 1 MiB, mounts, unmounts and ejects. Validated end to end in the VM.
|
||||
- The core library and `openpu-cli` build and pass all unit tests on Haiku R1/beta6 x86_64.
|
||||
- Haiku graphical interface (Interface Kit): the same screens as the GTK interface (vehicles,
|
||||
adding a vehicle, updates, download folder, resumable download, USB stick, writing, installation
|
||||
guide), Preferences window, About window and new-version check. It uses the gettext catalogs of
|
||||
the GTK interface, and the language of the Locale preferences by default.
|
||||
- Application icon: an original shield with a "PU" monogram, as SVG, HVIF (embedded in the Haiku
|
||||
executable) and PNG from 16 to 512 px (installed in the hicolor icon theme on Linux), generated
|
||||
by `tools/make_icons.py`.
|
||||
- Debian package through CPack (dependencies from `dpkg-shlibdeps`, `udisks2` recommended) and
|
||||
AppStream metadata (`io.github.openpu.OpenPU.metainfo.xml`).
|
||||
- `tools/appimage.sh`: AppImage of the GTK interface and `openpu-cli` (linuxdeploy + GTK plugin).
|
||||
- `Release` GitHub workflow: Debian package, AppImage and `openpu-cli` tarball for Linux x86_64
|
||||
and arm64, attached to the release of every `vX.Y.Z` tag.
|
||||
- Haiku package: `tools/haiku-package.sh` builds an `.hpkg` (application, `openpu-cli`,
|
||||
translations, Deskbar entry), and `packaging/haiku/openpu.recipe` is a HaikuPorts recipe
|
||||
template.
|
||||
|
||||
### Changed
|
||||
- The Haiku application is installed in `apps/` and finds its translations in the `data/locale`
|
||||
directory of its installation location.
|
||||
- The GTK interface looks for its translations in `../share/locale` next to the executable first,
|
||||
so that relocatable installs (AppImage) are translated.
|
||||
- `tools/release.sh` adds the release to the AppStream metadata and updates a GitHub release
|
||||
that the release workflow created first.
|
||||
|
||||
### Fixed
|
||||
- `cmake --install --strip` dropped the resources of the Haiku application (icon, signature,
|
||||
version): they are attached again to the installed file.
|
||||
- Translations were installed in `/<language>/LC_MESSAGES` instead of the locale directory.
|
||||
- Archive extraction failed when the destination path contained a symbolic link (e.g. `/tmp` on
|
||||
Haiku).
|
||||
- `tools/release.sh` produced empty release notes.
|
||||
|
||||
## [0.2.0] - 2026-11-28
|
||||
|
||||
### Ajouté
|
||||
- Interface graphique GTK4 (gtkmm) : véhicules, ajout par VIN, mises à jour disponibles, choix du
|
||||
dossier, téléchargement avec reprise, choix de la clé USB, écriture, guide d'installation.
|
||||
- Versionnage : version CMake + `git describe` à chaque compilation, `openpu-cli --version`,
|
||||
boîte « À propos », User-Agent `OpenPU/<version>`, script `tools/release.sh`.
|
||||
- Infrastructure de traduction gettext (textes sources en anglais, français fourni).
|
||||
- Liens vers les guides d'installation officiels (PDF) en français et en anglais.
|
||||
- Préférences : dossier de téléchargement, langue (langue du système par défaut), recherche
|
||||
automatique d'une nouvelle version d'OpenPU au démarrage.
|
||||
- Recherche d'une nouvelle version d'OpenPU (releases GitHub) : proposition d'ouvrir la page de
|
||||
téléchargement dans le navigateur ; `openpu-cli app-update`.
|
||||
- Licence MIT (`LICENSE`, en-têtes SPDX).
|
||||
- Intégration continue GitHub Actions : compilation et tests sur Linux x86_64 et arm64, ASan/UBSan.
|
||||
### Added
|
||||
- GTK4 (gtkmm) graphical interface: vehicles, adding a vehicle by VIN, available updates, download
|
||||
folder, resumable download, USB stick selection, writing, installation guide.
|
||||
- Versioning: CMake version + `git describe` on every build, `openpu-cli --version`, About dialog,
|
||||
`OpenPU/<version>` User-Agent, `tools/release.sh`.
|
||||
- gettext translation infrastructure (English source strings, French translation).
|
||||
- Links to the official installation guides (PDF) in French and English.
|
||||
- Preferences: download folder, language (system language by default), automatic check for a new
|
||||
OpenPU version at startup.
|
||||
- New OpenPU version check (GitHub releases), offering to open the download page in the browser;
|
||||
`openpu-cli app-update`.
|
||||
- MIT license (`LICENSE`, SPDX headers).
|
||||
- GitHub Actions continuous integration: build and tests on Linux x86_64 and arm64, ASan/UBSan.
|
||||
|
||||
### Prévu
|
||||
- Paquets Linux `.deb`, Flatpak et AppImage ; paquet Haiku `.hpkg`.
|
||||
- À partir de 1.0.0, binaires joints à chaque release, x86_64 et arm64.
|
||||
### Changed
|
||||
- The main repository is now https://github.com/yann64/openpu.
|
||||
- `vehicles.json` keeps the order in which vehicles were added.
|
||||
|
||||
### Modifié
|
||||
- Le dépôt principal est désormais https://github.com/yann64/openpu (Gitea reste un miroir).
|
||||
- `vehicles.json` garde l'ordre d'ajout des véhicules.
|
||||
### Planned
|
||||
- Linux `.deb`, Flatpak and AppImage packages; Haiku `.hpkg` package.
|
||||
- From 1.0.0 on, binaries attached to every release, for x86_64 and arm64.
|
||||
|
||||
## [0.1.0] - 2026-11-28
|
||||
|
||||
### Ajouté
|
||||
- Analyse de « Peugeot Update » 1.6.1 (`docs/analysis/`).
|
||||
- `libopenpu` : client de l'API Majestic (VIN, calculateurs, mises à jour), téléchargement avec
|
||||
reprise (Range), licence (placeholder vide de Majestic géré), archives tar (vérification,
|
||||
extraction sécurisée sans `UpdateInfo.xml`), réglages et véhicules compatibles avec l'app
|
||||
officielle, USB Linux via UDisks2 (MBR + FAT32, montage, éjection).
|
||||
- `openpu-cli` : `check`, `download`, `verify`, `extract`, `usb-list`, `write-usb`, `write-dir`.
|
||||
- Qualité : tests doctest, ASan/UBSan, valgrind, clang-tidy, cppcheck (`tools/check.sh`), test USB
|
||||
de bout en bout sur image loop (`tools/e2e-usb.sh`).
|
||||
### Added
|
||||
- Analysis of "Peugeot Update" 1.6.1 (`docs/analysis/`).
|
||||
- `libopenpu`: Majestic API client (VIN, head units, updates), resumable downloads (HTTP Range),
|
||||
license download (including the empty placeholder Majestic returns while generating it), tar
|
||||
archives (integrity check, safe extraction skipping `UpdateInfo.xml`), settings and vehicles
|
||||
compatible with the official application, Linux USB support through UDisks2 (MBR + FAT32,
|
||||
mounting, ejecting).
|
||||
- `openpu-cli`: `check`, `download`, `verify`, `extract`, `usb-list`, `write-usb`, `write-dir`.
|
||||
- Quality: doctest unit tests, ASan/UBSan, valgrind, clang-tidy, cppcheck (`tools/check.sh`),
|
||||
end-to-end USB test on a loop image (`tools/e2e-usb.sh`).
|
||||
|
||||
[Unreleased]: https://github.com/yann64/openpu/compare/v0.2.0...HEAD
|
||||
[Unreleased]: https://github.com/yann64/openpu/compare/v0.3.0...HEAD
|
||||
[0.3.0]: https://github.com/yann64/openpu/releases/tag/v0.3.0
|
||||
[0.2.0]: https://github.com/yann64/openpu/releases/tag/v0.2.0
|
||||
[0.1.0]: https://github.com/yann64/openpu/releases/tag/v0.1.0
|
||||
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(openpu VERSION 0.2.0 LANGUAGES CXX)
|
||||
project(openpu VERSION 0.3.0 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
@@ -9,15 +9,16 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
option(OPENPU_BUILD_CLI "Build openpu-cli" ON)
|
||||
option(OPENPU_BUILD_TESTS "Build unit tests" ON)
|
||||
option(OPENPU_UI_GTK "Build the GTK4 user interface" OFF)
|
||||
option(OPENPU_UI_HAIKU "Build the Haiku user interface" OFF)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
|
||||
set(OPENPU_UI_HAIKU_DEFAULT ON)
|
||||
else()
|
||||
set(OPENPU_UI_HAIKU_DEFAULT OFF)
|
||||
endif()
|
||||
option(OPENPU_UI_HAIKU "Build the Haiku user interface" ${OPENPU_UI_HAIKU_DEFAULT})
|
||||
option(OPENPU_WERROR "Treat warnings as errors" OFF)
|
||||
option(OPENPU_CLANG_TIDY "Run clang-tidy while compiling" OFF)
|
||||
option(OPENPU_SANITIZE "Build with ASan + UBSan" OFF)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
|
||||
set(OPENPU_UI_HAIKU_DEFAULT ON)
|
||||
endif()
|
||||
|
||||
add_library(openpu_warnings INTERFACE)
|
||||
target_compile_options(openpu_warnings INTERFACE -Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wno-sign-conversion)
|
||||
if(OPENPU_WERROR)
|
||||
@@ -42,6 +43,11 @@ endif()
|
||||
|
||||
if(OPENPU_UI_GTK)
|
||||
add_subdirectory(src/ui-gtk)
|
||||
endif()
|
||||
if(OPENPU_UI_HAIKU)
|
||||
add_subdirectory(src/ui-haiku)
|
||||
endif()
|
||||
if(OPENPU_UI_GTK OR OPENPU_UI_HAIKU)
|
||||
add_subdirectory(po)
|
||||
endif()
|
||||
|
||||
@@ -49,3 +55,7 @@ if(OPENPU_BUILD_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Haiku") # Haiku packages are built from a HaikuPorts recipe
|
||||
include(cmake/Packaging.cmake)
|
||||
endif()
|
||||
@@ -1,3 +1,5 @@
|
||||
<p align="center"><img src="data/icons/png/openpu-128.png" width="128" height="128" alt="OpenPU logo"></p>
|
||||
|
||||
# OpenPU
|
||||
|
||||
A free and native client to download updates for Peugeot head units
|
||||
@@ -8,22 +10,25 @@ It is an alternative to the official "Peugeot Update" application (Windows/macOS
|
||||
> Independent project, not affiliated with Stellantis or Peugeot. The names mentioned are
|
||||
> trademarks of their respective owners.
|
||||
|
||||
- Repository: https://github.com/yann64/openpu (mirror: https://git.barbel.synology.me/yann64/opu)
|
||||
- Repository: https://github.com/yann64/openpu
|
||||
- License: [MIT](LICENSE)
|
||||
- Release history: [CHANGELOG.md](CHANGELOG.md)
|
||||
|
||||
## Status
|
||||
- [x] Analysis of the existing application: see [`docs/analysis/`](docs/analysis/) (in French)
|
||||
- [x] Analysis of the existing application: see [`docs/analysis/`](docs/analysis/)
|
||||
- [x] C++ core: VIN, Majestic API, resumable downloads, license, tar, settings, vehicles
|
||||
- [x] Linux USB support (UDisks2: listing, MBR + FAT32, mounting, ejecting) and writing the update
|
||||
- [x] `openpu-cli` command-line tool
|
||||
- [x] GTK4 UI (Linux): complete workflow, preferences, new-version check
|
||||
- [x] Versioning (`--version`, About dialog, `vX.Y.Z` tags, GitHub releases)
|
||||
- [x] gettext translations (English, French)
|
||||
- [ ] Haiku USB support (Storage Kit)
|
||||
- [ ] Haiku UI
|
||||
- [x] Haiku: core library, CLI and USB support (Storage Kit), validated in a Haiku R1/beta6 VM
|
||||
- [x] Haiku UI (Interface Kit): complete workflow, preferences, new-version check
|
||||
- [x] GitHub Actions continuous integration (Linux x86_64 + arm64)
|
||||
- [ ] Linux packages: `.deb`, Flatpak and AppImage; Haiku: `.hpkg`
|
||||
- [x] Linux packages: Debian package (`cpack -G DEB`) and AppImage (`tools/appimage.sh`)
|
||||
- [x] `Release` workflow: `.deb`, AppImage and `openpu-cli` tarball for x86_64 and arm64
|
||||
- [x] Haiku package (`tools/haiku-package.sh`) and HaikuPorts recipe template
|
||||
- [ ] Flatpak
|
||||
- [ ] x86_64 + arm64 binaries attached to every release (from 1.0.0 on)
|
||||
|
||||
## Architecture
|
||||
@@ -52,6 +57,36 @@ tools/e2e-usb.sh ../build-openpu/debug/src/cli/openpu-cli --license X.key update
|
||||
When running from the build tree, `OPENPU_LOCALEDIR=../build-openpu/debug/locale` lets the
|
||||
interface find its translations.
|
||||
|
||||
## Packages (Linux)
|
||||
```sh
|
||||
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DOPENPU_UI_GTK=ON
|
||||
cmake --build build && (cd build && cpack -G DEB) # build/openpu_<version>_<arch>.deb
|
||||
tools/appimage.sh # ./OpenPU-<version>-<arch>.AppImage
|
||||
```
|
||||
The Debian package gets its dependencies from `dpkg-shlibdeps` and recommends `udisks2`, which
|
||||
formats and mounts the USB stick. `tools/appimage.sh` downloads linuxdeploy and its GTK plugin
|
||||
into `~/.cache/openpu-appimage`.
|
||||
|
||||
The `Release` GitHub workflow builds the Debian package, the AppImage and a `openpu-cli` tarball
|
||||
for x86_64 and arm64. On a `vX.Y.Z` tag it attaches them to the release, and a manual run keeps
|
||||
them as workflow artifacts.
|
||||
|
||||
## Building (Haiku)
|
||||
```sh
|
||||
pkgman install cmake ninja curl_devel libarchive_devel nlohmann_json gettext gettext_libintl_devel
|
||||
cmake -S . -B build -G Ninja && cmake --build build && build/tests/openpu_tests
|
||||
OPENPU_LOCALEDIR=build/locale build/src/ui-haiku/OpenPU # graphical interface
|
||||
build/src/cli/openpu-cli usb-list
|
||||
```
|
||||
Package: `tools/haiku-package.sh` builds `openpu-<version>-1-x86_64.hpkg` in the current
|
||||
directory (application in `apps/`, `openpu-cli` in `bin/`, translations, Deskbar entry); install
|
||||
it with `pkgman install ./openpu-*.hpkg`. GitHub has no Haiku runners, so the package is built in
|
||||
the VM and attached to the release by hand. `packaging/haiku/openpu.recipe` is the template of the
|
||||
HaikuPorts recipe, to fill in with the released version and its checksum.
|
||||
|
||||
`tools/haiku-vm.sh` installs and runs a Haiku R1/beta6 VM under QEMU/KVM (from WSL or Linux), with
|
||||
a virtual USB stick; `sync` copies the working tree into it and `ssh` runs commands there.
|
||||
|
||||
## Versioning
|
||||
- The reference version is `project(openpu VERSION x.y.z)` in `CMakeLists.txt`. On every build,
|
||||
`git describe` produces the displayed description (for example `0.2.0+3.g1a2b3c4.dirty`).
|
||||
@@ -60,14 +95,19 @@ interface find its translations.
|
||||
commits, tags, pushes to every remote and creates the release.
|
||||
|
||||
## Translations
|
||||
Source strings are in English and translations use gettext (`po/<language>.po`). To add a
|
||||
language:
|
||||
Source strings are in English and translations use gettext (`po/<language>.po`), on Linux and on
|
||||
Haiku: both interfaces share the same catalogs. On Haiku the default language is the first one of
|
||||
the Locale preferences. To add a language:
|
||||
1. update the template with `cmake --build <build> --target pot`, or with
|
||||
`python3 tools/extract_strings.py po/openpu.pot src/ui-gtk/main_window.cpp` if gettext is not
|
||||
installed;
|
||||
`python3 tools/extract_strings.py po/openpu.pot src/ui-gtk/main_window.cpp src/ui-haiku/main_window.cpp`
|
||||
if gettext is not installed;
|
||||
2. copy `po/openpu.pot` to `po/<language>.po` and translate it;
|
||||
3. add the language to `po/LINGUAS` and to the list in the Preferences dialog.
|
||||
3. add the language to `po/LINGUAS` and to the language list of the Preferences window of both
|
||||
interfaces.
|
||||
|
||||
## Tools
|
||||
- `tools/make_icons.py`: generates the application icon (original artwork, MIT like the rest of
|
||||
the project) from a single description: `data/icons/openpu.svg`, a simplified variant for 16 and
|
||||
24 px, `openpu.hvif` for Haiku and PNG files from 16 to 512 px. Standard library only.
|
||||
- `tools/asar_extract.py`: minimal, read-only asar extractor used to study the reference
|
||||
application. Extracted sources stay **outside the repository**.
|
||||
@@ -0,0 +1,28 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Debian package (cpack -G DEB). Dependencies are computed by dpkg-shlibdeps from the binaries,
|
||||
# so the package matches the distribution it was built on.
|
||||
set(CPACK_PACKAGE_NAME openpu)
|
||||
set(CPACK_PACKAGE_VENDOR "OpenPU contributors")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Download Peugeot head unit updates and prepare the USB stick")
|
||||
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/yann64/openpu")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE)
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY openpu)
|
||||
set(CPACK_STRIP_FILES ON)
|
||||
|
||||
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) # openpu_<version>_<arch>.deb
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION utils)
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "OpenPU contributors <https://github.com/yann64/openpu>")
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION
|
||||
"Download Peugeot head unit updates and prepare the USB stick\n\
|
||||
OpenPU downloads the firmware and navigation map updates of Peugeot head units\n\
|
||||
(NAC, RCC, AIO, Crony) and prepares the installation USB stick: FAT32\n\
|
||||
formatting, license and update files. Graphical interface (GTK 4) and\n\
|
||||
command-line tool. Independent project, not affiliated with Stellantis or Peugeot.")
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
# UDisks2 formats and mounts the stick; without it only `openpu-cli write-dir` works.
|
||||
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "udisks2")
|
||||
|
||||
set(CPACK_SOURCE_GENERATOR TGZ)
|
||||
set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/" "/build/" "\\\\.swp$")
|
||||
|
||||
include(CPack)
|
||||
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
|
||||
<title>OpenPU</title>
|
||||
<defs>
|
||||
<linearGradient id="bg" gradientUnits="userSpaceOnUse" x1="32" y1="4" x2="32" y2="60">
|
||||
<stop offset="0" stop-color="#2563b8"/>
|
||||
<stop offset="1" stop-color="#163a6b"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path fill="url(#bg)" d="M12 4 L52 4 C54.2 4 56 5.8 56 8 L56 34 C56 49 45 57 32 61 C19 57 8 49 8 34 L8 8 C8 5.8 9.8 4 12 4Z"/>
|
||||
<path fill="#ffffff" d="M15 19 L23 19 C26.9 19 29 22.1 29 26 C29 29.9 26.9 33 23 33 L21 33 L21 41 L15 41Z"/>
|
||||
<path fill="url(#bg)" d="M21 24 L23 24 C24.1 24 25 24.9 25 26 C25 27.1 24.1 28 23 28 L21 28Z"/>
|
||||
<path fill="#ffffff" d="M33 19 L39 19 L39 33 C39 34.1 39.9 35 41 35 C42.1 35 43 34.1 43 33 L43 19 L49 19 L49 33 C49 37.4 45.4 41 41 41 C36.6 41 33 37.4 33 33Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 841 B |
@@ -0,0 +1,16 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
|
||||
<title>OpenPU</title>
|
||||
<defs>
|
||||
<linearGradient id="bg" gradientUnits="userSpaceOnUse" x1="32" y1="4" x2="32" y2="60">
|
||||
<stop offset="0" stop-color="#2563b8"/>
|
||||
<stop offset="1" stop-color="#163a6b"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path fill="url(#bg)" d="M12 4 L52 4 C54.2 4 56 5.8 56 8 L56 34 C56 49 45 57 32 61 C19 57 8 49 8 34 L8 8 C8 5.8 9.8 4 12 4Z"/>
|
||||
<path fill="#ffffff" d="M14 6.85 L50 6.85 C51.98 6.85 53.6 8.47 53.6 10.45 L53.6 33.85 C53.6 47.35 43.7 54.55 32 58.15 C20.3 54.55 10.4 47.35 10.4 33.85 L10.4 10.45 C10.4 8.47 12.02 6.85 14 6.85Z"/>
|
||||
<path fill="url(#bg)" d="M14.8 7.99 L49.2 7.99 C51.09 7.99 52.64 9.54 52.64 11.43 L52.64 33.79 C52.64 46.69 43.18 53.57 32 57.01 C20.82 53.57 11.36 46.69 11.36 33.79 L11.36 11.43 C11.36 9.54 12.91 7.99 14.8 7.99Z"/>
|
||||
<path fill="#ffffff" d="M15 15 L23 15 C26.9 15 29 18.1 29 22 C29 25.9 26.9 29 23 29 L21 29 L21 37 L15 37Z"/>
|
||||
<path fill="url(#bg)" d="M21 20 L23 20 C24.1 20 25 20.9 25 22 C25 23.1 24.1 24 23 24 L21 24Z"/>
|
||||
<path fill="#ffffff" d="M33 15 L39 15 L39 29 C39 30.1 39.9 31 41 31 C42.1 31 43 30.1 43 29 L43 15 L49 15 L49 29 C49 33.4 45.4 37 41 37 C36.6 37 33 33.4 33 29Z"/>
|
||||
<path fill="#8ec5ff" d="M30 41 L34 41 L34 47 L39 47 L32 54 L25 47 L30 47Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 407 B |
|
After Width: | Height: | Size: 613 B |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 982 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- SPDX-License-Identifier: MIT -->
|
||||
<component type="desktop-application">
|
||||
<id>io.github.openpu.OpenPU</id>
|
||||
<metadata_license>MIT</metadata_license>
|
||||
<project_license>MIT</project_license>
|
||||
<name>OpenPU</name>
|
||||
<summary>Download head unit updates and prepare the USB stick</summary>
|
||||
<summary xml:lang="fr">Télécharger les mises à jour de l'autoradio et préparer la clé USB</summary>
|
||||
<description>
|
||||
<p>
|
||||
OpenPU downloads the firmware and navigation map updates of Peugeot head units (NAC, RCC,
|
||||
AIO, Crony) and prepares the installation USB stick: FAT32 formatting, license and update
|
||||
files. Downloads resume where they stopped.
|
||||
</p>
|
||||
<p>
|
||||
Independent project, not affiliated with Stellantis or Peugeot.
|
||||
</p>
|
||||
</description>
|
||||
<launchable type="desktop-id">io.github.openpu.OpenPU.desktop</launchable>
|
||||
<url type="homepage">https://github.com/yann64/openpu</url>
|
||||
<url type="bugtracker">https://github.com/yann64/openpu/issues</url>
|
||||
<developer id="io.github.yann64">
|
||||
<name>yann64 and the OpenPU contributors</name>
|
||||
</developer>
|
||||
<content_rating type="oars-1.1"/>
|
||||
<categories>
|
||||
<category>Utility</category>
|
||||
</categories>
|
||||
<requires>
|
||||
<internet>always</internet>
|
||||
</requires>
|
||||
<releases>
|
||||
<release version="0.3.0" date="2026-11-29"/>
|
||||
<release version="0.2.0" date="2026-11-28"/>
|
||||
<release version="0.1.0" date="2026-11-28"/>
|
||||
</releases>
|
||||
</component>
|
||||
@@ -1,50 +1,49 @@
|
||||
# API Majestic (PSA / Stellantis) — utilisée par « Peugeot Update » 1.6.1
|
||||
# Majestic API (PSA / Stellantis) as used by "Peugeot Update" 1.6.1
|
||||
|
||||
Source : sources TypeScript embarquées dans `resources/app.asar` (`src/environments`,
|
||||
Sources: the TypeScript sources shipped in `resources/app.asar` (`src/environments`,
|
||||
`src/app/services/{vehicle,update}.service.ts`, `electron/{rangeDownload,downloadManagement}.ts`)
|
||||
et journal `%APPDATA%\Peugeot Update\log.log`.
|
||||
and the log file `%APPDATA%\Peugeot Update\log.log`.
|
||||
|
||||
Aucune authentification utilisateur : pas d'OAuth, pas de cookie, pas de jeton.
|
||||
Seul un `client_id` applicatif, fixe, est passé en query string.
|
||||
There is no user authentication: no OAuth, no cookie, no token. Only a fixed application
|
||||
`client_id` is passed in the query string.
|
||||
|
||||
| Constante | Valeur (marque Peugeot) |
|
||||
| Constant | Value (Peugeot build) |
|
||||
|---|---|
|
||||
| `apiAvailableUpdates` | `https://api.groupe-psa.com/applications/majesticf/v1/getAvailableUpdate` |
|
||||
| `apiDevices` | `https://api.groupe-psa.com/applications/majesticf/v1/devices/` |
|
||||
| `clientId` | `?client_id=20a4cf7c-f5fb-41d5-9175-a6e23b9880e5` |
|
||||
| `regExpVin` | `^V[FR]{1}3[A-Z0-9]{14}$` |
|
||||
|
||||
Les autres marques du groupe (Citroën, DS, Opel…) utilisent probablement le même backend
|
||||
avec un `client_id` différent : OpenPU rend ces valeurs configurables.
|
||||
The group's other brands (Citroën, DS, Opel…) probably use the same backend with a different
|
||||
`client_id`, so OpenPU makes these values configurable.
|
||||
|
||||
## 1. Liste des calculateurs : `GET devices/{VIN}`
|
||||
## 1. Head units of a vehicle: `GET devices/{VIN}`
|
||||
|
||||
```
|
||||
GET https://api.groupe-psa.com/applications/majesticf/v1/devices/{VIN}?client_id=…
|
||||
```
|
||||
|
||||
Réponse 200 :
|
||||
200 response:
|
||||
```json
|
||||
{ "vin": "VR3XXXXXXXXXXXXXX", "requestDate": "…", "devices": [ { "ecuType": "RCC_EU_…" } ] }
|
||||
```
|
||||
- **404** ⇒ VIN inconnu (traité comme « véhicule inexistant », pas comme une erreur réseau).
|
||||
- Autre erreur HTTP ⇒ erreur serveur ; statut 0 ⇒ erreur réseau.
|
||||
- **404** means the VIN is unknown (treated as "no such vehicle", not as a network error).
|
||||
- Any other HTTP error is a server error; status 0 is a network error.
|
||||
|
||||
### Classification `ecuType`
|
||||
`prefix = ecuType.split('_')[0]`, comparaison insensible à la casse :
|
||||
### `ecuType` classification
|
||||
`prefix = ecuType.split('_')[0]`, compared case-insensitively:
|
||||
|
||||
| Préfixe | Type | Lien guide (`wave`) |
|
||||
| Prefix | Type | Guide link (`wave`) |
|
||||
|---|---|---|
|
||||
| `RCC` | `rcc` | `path_guide_rcc` |
|
||||
| `AIO` | `aio` | `path_guide_aio` |
|
||||
| `NAC` | `nac` | dernier segment `WAVE1..4` → `path_guide_wave_1..4`, sinon `path_guide_wave_default` |
|
||||
| `CRONY…` (5 premiers caractères) | `crony_nav` / `crony_nonav` | `CRONY2_EU_VAR{1..4}_WAVE1` → `path_guide_crony_{1..4}` |
|
||||
| `NAC` | `nac` | last segment `WAVE1..4` → `path_guide_wave_1..4`, otherwise `path_guide_wave_default` |
|
||||
| `CRONY…` (first 5 characters) | `crony_nav` / `crony_nonav` | `CRONY2_EU_VAR{1..4}_WAVE1` → `path_guide_crony_{1..4}` |
|
||||
|
||||
Seuls les devices dont le préfixe est reconnu sont retenus. Il faut **exactement un**
|
||||
device valide pour obtenir un lien de guide. S'il y a au moins un device valide mais pas de lien,
|
||||
le véhicule « existe » avec un type vide.
|
||||
Only devices with a known prefix are kept. A guide link requires **exactly one** valid device. With
|
||||
at least one valid device but no link, the vehicle "exists" with an empty type.
|
||||
|
||||
## 2. Mises à jour disponibles : `POST getAvailableUpdate`
|
||||
## 2. Available updates: `POST getAvailableUpdate`
|
||||
|
||||
```
|
||||
POST https://api.groupe-psa.com/applications/majesticf/v1/getAvailableUpdate?client_id=…
|
||||
@@ -53,8 +52,8 @@ Content-Type: application/json
|
||||
{ "vin": "VF3…", "softwareTypes": [ { "softwareType": "rcc-firmware" }, { "softwareType": "map-eur" } ] }
|
||||
```
|
||||
|
||||
### Types de logiciel
|
||||
| Constante | `softwareType` |
|
||||
### Software types
|
||||
| Constant | `softwareType` |
|
||||
|---|---|
|
||||
| SOFT_FW_OVIP (NAC) | `ovip-int-firmware-version` |
|
||||
| SOFT_FW_RCC | `rcc-firmware` |
|
||||
@@ -64,21 +63,21 @@ Content-Type: application/json
|
||||
| SOFT_CARTO | `map-eur` |
|
||||
| SOFT_CARTO_CRONY | `crony2-map-western_europe` |
|
||||
|
||||
**Ajout d'un véhicule** (`checkVehicle`) : les 7 types sont envoyés, en parallèle de `devices/{VIN}`.
|
||||
Pour Crony, si la réponse contient une entrée `crony2-software-nonav` avec un `update[0].updateId`,
|
||||
le type est `crony_nonav`, sinon `crony_nav`.
|
||||
**Adding a vehicle** (`checkVehicle`): all 7 types are requested, in parallel with `devices/{VIN}`.
|
||||
For Crony, the type is `crony_nonav` when the answer has a `crony2-software-nonav` entry with an
|
||||
`update[0].updateId`, `crony_nav` otherwise.
|
||||
|
||||
**Recherche de mises à jour** (`getUpdates`) : 2 types selon le type de véhicule.
|
||||
**Looking for updates** (`getUpdates`): 2 types depending on the vehicle type.
|
||||
|
||||
| Type véhicule | Firmware | Cartographie |
|
||||
| Vehicle type | Firmware | Map |
|
||||
|---|---|---|
|
||||
| `nac` | `ovip-int-firmware-version` | `map-eur` |
|
||||
| `rcc` | `rcc-firmware` | `map-eur` |
|
||||
| `aio` (et défaut) | `aio-firmware` | `map-eur` |
|
||||
| `aio` (and default) | `aio-firmware` | `map-eur` |
|
||||
| `crony_nav` | `crony2-software-nav` | `crony2-map-western_europe` |
|
||||
| `crony_nonav` | `crony2-software-nonav` | — (`null` envoyé) |
|
||||
| `crony_nonav` | `crony2-software-nonav` | — (`null` sent) |
|
||||
|
||||
### Réponse
|
||||
### Response
|
||||
```json
|
||||
{
|
||||
"requestResult": "OK",
|
||||
@@ -91,8 +90,8 @@ le type est `crony_nonav`, sinon `crony_nav`.
|
||||
"currentSoftwareVersion": "…",
|
||||
"update": [
|
||||
{
|
||||
"updateId": "005…", // 18 chiffres, chaîne
|
||||
"updateSize": "8390000000", // chaîne, octets
|
||||
"updateId": "005…", // 18 digits, as a string
|
||||
"updateSize": "8390000000", // string, bytes
|
||||
"updateVersion": "…",
|
||||
"updateDate": "…",
|
||||
"updateURL": "https://majestic-web.mpsa.com/mjf00-web/rest/UpdateDownload?updateId=…&uin=…&type=fw",
|
||||
@@ -103,69 +102,70 @@ le type est `crony_nonav`, sinon `crony_nav`.
|
||||
]
|
||||
}
|
||||
```
|
||||
Une mise à jour n'est retenue que si `requestResult == "OK"`, `updateRequestResult == "OK"`,
|
||||
`update` est non vide et `updateURL` est une URL valide.
|
||||
An update is used only if `requestResult == "OK"`, `updateRequestResult == "OK"`, `update` is not
|
||||
empty and `updateURL` is a valid URL.
|
||||
|
||||
> Note : l'app d'origine trie `update[]` avec `a.updateDate - b.updateDate` sur des chaînes, ce qui
|
||||
> donne `NaN` : le tri n'a donc aucun effet et c'est `update[0]` qui est pris. OpenPU prend aussi
|
||||
> `update[0]`, sauf si plusieurs entrées ont des dates ISO comparables, auquel cas il prend la plus récente.
|
||||
> Note: the original application sorts `update[]` with `a.updateDate - b.updateDate` on strings,
|
||||
> which yields `NaN`: the sort has no effect and `update[0]` is used. OpenPU also uses `update[0]`,
|
||||
> unless several entries have comparable ISO dates, in which case it takes the most recent one.
|
||||
|
||||
`uin` est l'identifiant du calculateur (20 caractères hexadécimaux). Il est encodé dans les URLs
|
||||
renvoyées, et le client n'a jamais à le connaître.
|
||||
`uin` is the head unit identifier (20 hexadecimal characters). It is embedded in the returned URLs;
|
||||
the client never needs to know it.
|
||||
|
||||
## 3. Téléchargements (`majestic-web.mpsa.com`)
|
||||
## 3. Downloads (`majestic-web.mpsa.com`)
|
||||
|
||||
| URL | Rôle |
|
||||
| URL | Role |
|
||||
|---|---|
|
||||
| `…/mjf00-web/rest/UpdateDownload?updateId=&uin=&type=fw` | redirige (3xx) vers le CDN `https://ds4emloty3shq.cloudfront.net/<FOURNISSEUR>/<HU_REGION>/<softwareType>/<fichier>.tar` |
|
||||
| `…/mjf00-web/rest/LicenseDownload?mediaVersion=&uin=` | fichier licence, nom donné par `Content-Disposition: …filename=<nom>` (`license_<UIN>.key` ou `licenses_<updateId>_<yyyyMMddHHmmss>.tar`) |
|
||||
| `…/mjf00-web/rest/UpdateDownload?updateId=&uin=&type=fw` | redirects (3xx) to the CDN `https://ds4emloty3shq.cloudfront.net/<SUPPLIER>/<HU_REGION>/<softwareType>/<file>.tar` |
|
||||
| `…/mjf00-web/rest/LicenseDownload?mediaVersion=&uin=` | license file, named by `Content-Disposition: …filename=<name>` (`license_<UIN>.key` or `licenses_<updateId>_<yyyyMMddHHmmss>.tar`) |
|
||||
|
||||
### Nom de fichier
|
||||
- Firmware/carte : dernier segment du chemin de l'**URL finale** (après redirections), sans query.
|
||||
- Licence : HEAD, puis `Content-Disposition` découpé sur `filename=`. À défaut, dernier segment de l'URL.
|
||||
- Les noms sont résolus **séquentiellement**. Commentaire d'origine : deux requêtes simultanées
|
||||
vers Majestic échouent parfois toutes les deux.
|
||||
### File names
|
||||
- Firmware/map: last path segment of the **final URL** (after redirects), without the query.
|
||||
- License: HEAD, then `Content-Disposition` split on `filename=`; otherwise the last URL segment.
|
||||
- Names are resolved **sequentially**. Comment in the original code: two simultaneous requests to
|
||||
Majestic sometimes both fail.
|
||||
|
||||
### Téléchargement avec reprise (`rangeDownload.ts`)
|
||||
1. `HEAD updateURL` (`Connection: keep-alive`), timeout 5 s, redirections suivies.
|
||||
La réponse doit être un 200 avec un `content-length` non nul, qui donne la taille totale.
|
||||
2. Si `<dossier>/<fichier>` existe déjà, sa taille donne `have`. Si `have >= total`, le fichier est complet.
|
||||
3. `GET urlFinale` avec `Range: bytes=<have>-<total-1>`. On attend un **206** avec
|
||||
`content-length == total-have` ; les données sont ajoutées en fin de fichier.
|
||||
- Un 200 (pas de support Range) ou une longueur incorrecte ⇒ le fichier partiel est supprimé, on passe en
|
||||
mode sans Range et on réessaie.
|
||||
4. Watchdog : 10 s sans données ⇒ abandon de la connexion, puis réessai.
|
||||
5. 5 réessais au maximum (cache de session vidé entre deux). Une erreur disque est fatale tout de suite.
|
||||
6. Pause et reprise : arrêt de la requête, puis on recommence à l'étape 1 (le fichier partiel est conservé).
|
||||
### Resumable download (`rangeDownload.ts`)
|
||||
1. `HEAD updateURL` (`Connection: keep-alive`), 5 s timeout, redirects followed. The answer must be
|
||||
a 200 with a non-zero `content-length`, which gives the total size.
|
||||
2. If `<folder>/<file>` already exists, its size gives `have`. If `have >= total`, the file is complete.
|
||||
3. `GET finalUrl` with `Range: bytes=<have>-<total-1>`. A **206** with `content-length == total-have`
|
||||
is expected; data is appended to the file.
|
||||
- A 200 (no Range support) or a wrong length deletes the partial file, switches to non-Range mode
|
||||
and retries.
|
||||
4. Watchdog: 10 s without data drops the connection, then retries.
|
||||
5. At most 5 retries (session cache cleared in between). A disk error is fatal immediately.
|
||||
6. Pause and resume: the request is stopped, then step 1 starts again (the partial file is kept).
|
||||
|
||||
La licence est téléchargée **sans reprise** (`electron-dl`). Si le fichier existe déjà, il n'est pas retéléchargé.
|
||||
The license is downloaded **without resume** (`electron-dl`). An existing file is not downloaded again.
|
||||
|
||||
### Proxy
|
||||
`<install>/proxy.json` : `{http_proxy, https_proxy, no_proxy}`. OpenPU utilise les variables
|
||||
d'environnement standard (libcurl les gère nativement).
|
||||
`<install>/proxy.json`: `{http_proxy, https_proxy, no_proxy}`. OpenPU uses the standard environment
|
||||
variables (natively supported by libcurl).
|
||||
|
||||
## 4. Observations sur l'API réelle (capture du 2026-11-28)
|
||||
- **Passerelle** (`X-Global-Transaction-ID`, de type IBM DataPower) : les réponses n'ont **pas de
|
||||
`Content-Length`**, et la passerelle ferme la connexion TLS **sans `close_notify`**. OpenSSL 3
|
||||
signale alors `unexpected eof while reading` (curl : code 56), alors que le corps est complet. Chromium
|
||||
tolère ce cas, et OpenPU aussi, mais uniquement pour un corps délimité par la fermeture de la connexion.
|
||||
- Le JSON échappe `=` et `&` en `=` / `&` dans les URL. Il faut donc toujours décoder avant d'analyser.
|
||||
- `ecuType` réels : `NAC_EUR_WAVE2`, `NAC_EUR_WAVE4`, RCC (voir les fixtures).
|
||||
- `updateDate` est au format `yyyy-MM-dd HH:mm:ss.S`. `updateSize` est une chaîne.
|
||||
- **Cartographie NAC** : `updateURL` pointe directement vers le CDN TomTom
|
||||
(`https://download-cde.tomtom.com/OEM/PSA/MAP/PSA_map-eur_<ver>-NAC_EUR_WAVE2.tar`), et `licenseURL` est vide.
|
||||
- `installerURL` est présent au niveau racine (une URL `UpdateDownload` sur `majestic.mpsa.com`). Son rôle est inconnu
|
||||
et l'app d'origine ne l'utilise pas.
|
||||
- Un VIN inexistant renvoie **404** avec un corps HTML.
|
||||
- **Licence générée de façon asynchrone** : le premier `LicenseDownload` d'une mise à jour a renvoyé un 200
|
||||
avec `Content-Disposition: filename=licenses_<updateId>_<yyyyMMddHHmmss>.tar` et un **corps vide**.
|
||||
Un appel suivant renvoie le vrai `license_<UIN>.key` (environ 10 Ko). L'app officielle garde le fichier vide,
|
||||
d'où les ENOENT et le « redémarrer l'app » de son journal. OpenPU supprime la réponse vide et réessaie
|
||||
en allongeant progressivement le délai.
|
||||
- CDN firmware RCC (CloudFront) : `HEAD` → 200 + `Content-Length`, et `Range` → 206. La reprise a été vérifiée
|
||||
(interruption à 1,59 Go puis reprise, environ 80 Mo/s).
|
||||
- Aucun en-tête particulier n'est requis : le User-Agent est libre, et HTTP/1.1 suffit (pas de négociation h2).
|
||||
## 4. Observations on the real API (capture of 2026-11-28)
|
||||
- **Gateway** (`X-Global-Transaction-ID`, IBM DataPower-like): responses have **no
|
||||
`Content-Length`**, and the gateway closes the TLS connection **without `close_notify`**. OpenSSL 3
|
||||
then reports `unexpected eof while reading` (curl error 56) although the body is complete. Chromium
|
||||
tolerates it; so does OpenPU, but only for bodies delimited by the connection close.
|
||||
- The JSON escapes `=` and `&` as `\u003d` / `\u0026` in URLs: always decode before parsing.
|
||||
- Real `ecuType` values: `NAC_EUR_WAVE2`, `NAC_EUR_WAVE4`, RCC (see the test fixtures).
|
||||
- `updateDate` uses the `yyyy-MM-dd HH:mm:ss.S` format. `updateSize` is a string.
|
||||
- **NAC maps**: `updateURL` points directly to the TomTom CDN
|
||||
(`https://download-cde.tomtom.com/OEM/PSA/MAP/PSA_map-eur_<ver>-NAC_EUR_WAVE2.tar`), and
|
||||
`licenseURL` is empty.
|
||||
- `installerURL` is present at the root (an `UpdateDownload` URL on `majestic.mpsa.com`). Its role is
|
||||
unknown and the original application does not use it.
|
||||
- An unknown VIN returns **404** with an HTML body.
|
||||
- **The license is generated asynchronously**: the first `LicenseDownload` of an update returned a
|
||||
200 with `Content-Disposition: filename=licenses_<updateId>_<yyyyMMddHHmmss>.tar` and an **empty
|
||||
body**. A later call returns the real `license_<UIN>.key` (about 10 KB). The official application
|
||||
keeps the empty file, hence the ENOENT errors and "restart the app" in its log. OpenPU deletes the
|
||||
empty answer and retries with an increasing delay.
|
||||
- RCC firmware CDN (CloudFront): `HEAD` → 200 + `Content-Length`, and `Range` → 206. Resuming was
|
||||
verified (interrupted at 1.59 GB then resumed, about 80 MB/s).
|
||||
- No special header is required: any User-Agent works, and HTTP/1.1 is enough (no h2 negotiation).
|
||||
|
||||
## 5. Mise à jour de l'application elle-même
|
||||
electron-updater, fournisseur générique `https://d1tik0o5ahgjm.cloudfront.net/peugeot/latest.yml`.
|
||||
Hors périmètre pour OpenPU.
|
||||
## 5. Updating the application itself
|
||||
electron-updater, generic provider `https://d1tik0o5ahgjm.cloudfront.net/peugeot/latest.yml`.
|
||||
Out of scope for OpenPU.
|
||||
@@ -1,43 +1,50 @@
|
||||
# Préparation de la clé USB
|
||||
# Preparing the USB stick
|
||||
|
||||
## Formatage
|
||||
- Système de fichiers : **FAT32**, table de partitions MBR (macOS : `diskutil eraseDisk FAT32 <LABEL> MBR`).
|
||||
- Label : le label actuel de la clé, assaini avec `replace(/[^a-zA-Z0-9_]+/g,'')`, tronqué à 11 caractères
|
||||
et mis en majuscules. Valeur par défaut : `NEW`.
|
||||
- Windows :
|
||||
- ≤ 32 GiB : `format X: /q /fs:FAT32 /v:LABEL` ;
|
||||
- au-delà, ou en cas d'échec : `chkdsk X: & timeout 20 & echo y | fat32format X: & label X: LABEL`,
|
||||
avec élévation de privilèges.
|
||||
- Linux (code présent dans l'app mais jamais livré) : `umount <mnt> && mkfs.vfat -n LABEL /dev/disk/by-uuid/<uuid>`.
|
||||
Seul le volume est reformaté, pas la table de partitions.
|
||||
## Formatting
|
||||
- File system: **FAT32**, MBR partition table (macOS: `diskutil eraseDisk FAT32 <LABEL> MBR`).
|
||||
- Label: the stick's current label, sanitised with `replace(/[^a-zA-Z0-9_]+/g,'')`, truncated to 11
|
||||
characters and upper-cased. Default: `NEW`.
|
||||
- Windows:
|
||||
- up to 32 GiB: `format X: /q /fs:FAT32 /v:LABEL`;
|
||||
- above, or on failure: `chkdsk X: & timeout 20 & echo y | fat32format X: & label X: LABEL`, with
|
||||
elevated privileges.
|
||||
- Linux (code present in the app but never shipped): `umount <mnt> && mkfs.vfat -n LABEL
|
||||
/dev/disk/by-uuid/<uuid>`. Only the volume is reformatted, not the partition table.
|
||||
|
||||
Équivalents OpenPU :
|
||||
- Linux : UDisks2 `org.freedesktop.UDisks2.Block.Format("vfat", {label, erase?})` sur le
|
||||
périphérique bloc entier (création d'une table MBR et d'une partition FAT32), via polkit, sans root.
|
||||
- Haiku : `BDiskDevice` → `BPartition::Initialize("fat", label, "fat 32")` (add-on DriveSetup FAT).
|
||||
OpenPU equivalents:
|
||||
- Linux: UDisks2 `org.freedesktop.UDisks2.Block.Format("dos")` on the whole block device, then
|
||||
`PartitionTable.CreatePartitionAndFormat` (type `0x0c` at 1 MiB, `vfat` with the label), through
|
||||
polkit, without root.
|
||||
- Haiku: Storage Kit disk device API (`BDiskDevice` / `BPartition`, as DriveSetup), MBR ("intel")
|
||||
with one "FAT 32-bit, LBA-mapped" partition at 1 MiB, formatted with the "fat" disk system.
|
||||
On Haiku R1/beta6 each step must be its own transaction (erase foreign content, delete old
|
||||
partitions, create the partition, format): combined transactions fail or hang, and
|
||||
`Uninitialize()` on an existing MBR hangs the disk device manager.
|
||||
|
||||
## Taille minimale
|
||||
## Minimum size
|
||||
```
|
||||
besoin = (taille fw + taille licence + taille carto) × 1.1
|
||||
usbMin = 2 Go ; tant que usbMin × 10^9 < besoin : usbMin ×= 2
|
||||
liste = disques USB montés dont la taille > besoin
|
||||
needed = (firmware size + license size + map size) × 1.1
|
||||
usbMin = 2 GB; while usbMin × 10^9 < needed: usbMin ×= 2
|
||||
choices = mounted USB drives larger than needed
|
||||
```
|
||||
|
||||
## Arborescence produite
|
||||
## Resulting tree
|
||||
```
|
||||
<USB>/
|
||||
├── license/
|
||||
│ └── <nom licence> # license_<UIN>.key ou licenses_<id>_<ts>.tar, copié tel quel
|
||||
├── rcc_update/… # contenu du tar firmware RCC (le nom dépend du calculateur)
|
||||
└── … # contenu du tar cartographie, extrait à la racine
|
||||
│ └── <license name> # license_<UIN>.key or licenses_<id>_<ts>.tar, copied as is
|
||||
├── rcc_update/… # content of the RCC firmware tar (the name depends on the head unit)
|
||||
└── … # content of the map tar, extracted at the root
|
||||
```
|
||||
### Archive firmware RCC réelle (6_0432_23-2I44-1, 8 391 587 840 octets)
|
||||
- Format **ustar** standard (magic `ustar\000`), 16 entrées, uniquement des fichiers réguliers et des dossiers.
|
||||
- Premier membre : `UpdateInfo.xml` (racine), puis `rcc_update/…`.
|
||||
- Plus gros fichiers : `rcc_update/stc.A2.bsh.tar.bin` (2,70 Go), `stc.A1…` (2,68 Go) et `rfs.A2.wml.fp.tar.bin` (1,0 Go).
|
||||
Tout tient sous la limite FAT32 de 4 Gio par fichier. Pour les cartes NAC (10,5 Go), c'est à vérifier.
|
||||
|
||||
- Tout fichier dont le *basename* est `UpdateInfo.xml` est ignoré lors de l'extraction.
|
||||
- Le tar peut être sans « magic number » (`allowUnknownFormat`), donc il faut un lecteur tar tolérant
|
||||
(libarchive : `archive_read_support_format_tar` + `archive_read_support_format_raw` désactivé).
|
||||
- Une extraction « à blanc » (dry-run) préalable vérifie l'intégrité du tar.
|
||||
### Real RCC firmware archive (6_0432_23-2I44-1, 8,391,587,840 bytes)
|
||||
- Standard **ustar** format (magic `ustar\000`), 16 entries, only regular files and directories.
|
||||
- First member: `UpdateInfo.xml` (root), then `rcc_update/…`.
|
||||
- Largest files: `rcc_update/stc.A2.bsh.tar.bin` (2.70 GB), `stc.A1…` (2.68 GB) and
|
||||
`rfs.A2.wml.fp.tar.bin` (1.0 GB). Everything fits under the 4 GiB FAT32 per-file limit. To be
|
||||
checked for NAC maps (10.5 GB).
|
||||
|
||||
- Any file whose *basename* is `UpdateInfo.xml` is skipped during extraction.
|
||||
- The tar may lack the "magic number" (`allowUnknownFormat` in the original app), so a tolerant tar
|
||||
reader is needed (libarchive's tar reader accepts V7 archives without magic).
|
||||
- A preliminary "dry-run" extraction checks the integrity of the tar.
|
||||
@@ -1,56 +1,56 @@
|
||||
# Déroulé fonctionnel de « Peugeot Update »
|
||||
# Functional workflow of "Peugeot Update"
|
||||
|
||||
## Écrans (Angular)
|
||||
1. **Bienvenue** (`welcome`), qu'on peut masquer (`hideWelcome`).
|
||||
2. **Véhicules** (`vehicles`, `vehicle-editor`) : liste, ajout (VIN + nom), suppression,
|
||||
lien vers le guide PDF (`wave` → clé i18n → URL PDF localisée).
|
||||
3. **Mises à jour** (`available-updates`) : firmware et/ou cartographie, cases à cocher.
|
||||
4. **Dossier de téléchargement** (`path-selector`) : refusé s'il est sur une clé USB,
|
||||
ou si l'espace libre est inférieur à (taille restante × 1.1).
|
||||
5. **Téléchargement** (`download-file`) : barre de progression, pause/reprise/annulation, temps estimé.
|
||||
6. **Clé USB** (`usb-selector`) : seuls les disques USB montés de taille > besoin sont listés ;
|
||||
confirmation du formatage.
|
||||
7. **Copie** (`copy-progress`) puis **Fin**, avec les instructions d'installation dans le véhicule.
|
||||
## Screens (Angular)
|
||||
1. **Welcome** (`welcome`), can be hidden (`hideWelcome`).
|
||||
2. **Vehicles** (`vehicles`, `vehicle-editor`): list, add (VIN + name), delete, link to the PDF guide
|
||||
(`wave` → i18n key → localised PDF URL).
|
||||
3. **Updates** (`available-updates`): firmware and/or map, check boxes.
|
||||
4. **Download folder** (`path-selector`): refused when it is on a USB stick, or when the free space
|
||||
is below (remaining size × 1.1).
|
||||
5. **Download** (`download-file`): progress bar, pause/resume/cancel, estimated time.
|
||||
6. **USB stick** (`usb-selector`): only mounted USB drives larger than needed are listed;
|
||||
formatting must be confirmed.
|
||||
7. **Copy** (`copy-progress`), then **Finish**, with installation instructions for the vehicle.
|
||||
|
||||
## Machine à états (download-manager)
|
||||
## State machine (download-manager)
|
||||
|
||||
```
|
||||
SelectUpdates
|
||||
└─ résolution séquentielle des noms : fw → licence (si fw) → carto
|
||||
→ lastDownload = {state: download, vin, fw/cartoUpdateSelected, versions, noms}
|
||||
└─ names resolved sequentially: fw → license (if fw) → map
|
||||
→ lastDownload = {state: download, vin, fw/cartoUpdateSelected, versions, names}
|
||||
ChooseFolder
|
||||
└─ vérifications : dossier pas sur USB, espace libre > besoin×1.1
|
||||
└─ checks: folder not on USB, free space > needed × 1.1
|
||||
Download
|
||||
├─ si fw : licence (simple) → firmware (Range)
|
||||
└─ puis carto (Range)
|
||||
├─ if fw: license (simple) → firmware (Range)
|
||||
└─ then map (Range)
|
||||
→ lastDownload.state = usb
|
||||
PrepareUsb
|
||||
├─ taille = Σ(tailles fw + licence + carto) × 1.1 ; taille USB min = 2 Go × 2^n ≥ besoin (base 10^9)
|
||||
├─ confirmation → formatage FAT32 (label = label actuel de la clé assaini, défaut NEW)
|
||||
├─ si fw : copie licence → <usb>/license/<nomLicence>
|
||||
├─ extraction du tar fw → <usb>/ (en ignorant tout fichier nommé UpdateInfo.xml)
|
||||
├─ extraction du tar carto → <usb>/
|
||||
├─ suppression des fichiers téléchargés ; lastDownload remis à zéro
|
||||
└─ éjection (Windows)
|
||||
├─ size = Σ(fw + license + map sizes) × 1.1; minimum stick = 2 GB × 2^n ≥ needed (base 10^9)
|
||||
├─ confirmation → FAT32 formatting (label = the stick's current label, sanitised, default NEW)
|
||||
├─ if fw: copy license → <usb>/license/<licenseName>
|
||||
├─ extract the fw tar → <usb>/ (skipping any file named UpdateInfo.xml)
|
||||
├─ extract the map tar → <usb>/
|
||||
├─ delete the downloaded files; lastDownload reset
|
||||
└─ eject (Windows)
|
||||
Finish
|
||||
```
|
||||
|
||||
En cas de tar invalide (`Invalid tar header` / `unsupported type`), le tar est supprimé et
|
||||
l'utilisateur revient à la liste des véhicules (il faut retélécharger).
|
||||
On an invalid tar (`Invalid tar header` / `unsupported type`), the tar is deleted and the user goes
|
||||
back to the vehicle list (the file has to be downloaded again).
|
||||
|
||||
## Persistance (`%APPDATA%\Peugeot Update`)
|
||||
- `config.json` : `language`, `hideWelcome`, `downloadPath`,
|
||||
## Persistence (`%APPDATA%\Peugeot Update`)
|
||||
- `config.json`: `language`, `hideWelcome`, `downloadPath`,
|
||||
`lastDownload{state(0=none,…), vin, fwUpdateSelected, cartoUpdateSelected, fwLastVersion,
|
||||
cartoLastVersion, fwFileName, cartoFileName, licenseFileName}`
|
||||
- `vehicles.json` : `{ "<VIN>": {name, type, wave, undeletedFiles?{fw,carto,license}} }`
|
||||
- `vehicles.json`: `{ "<VIN>": {name, type, wave, undeletedFiles?{fw,carto,license}} }`
|
||||
- `downloadPath.txt`, `log.log` (electron-log)
|
||||
|
||||
Au démarrage, si `lastDownload.state != none`, l'app propose de reprendre le téléchargement
|
||||
ou de supprimer les fichiers.
|
||||
At startup, when `lastDownload.state != none`, the application offers to resume the download or
|
||||
to delete the files.
|
||||
|
||||
## Particularités et défauts observés (à ne pas reproduire)
|
||||
- `wmic` est utilisé pour lire le label de la clé, mais il a été retiré de Windows 11.
|
||||
- `xcopy` échoue vers la racine du lecteur, avec repli sur `robocopy`.
|
||||
- Une licence au nom déjà vu, puis supprimée, est réutilisée : ENOENT jusqu'au redémarrage de l'app.
|
||||
- Le dossier temporaire `toUsbContent` n'est pas toujours supprimé (ENOTEMPTY).
|
||||
- Le tri des mises à jour par date est sans effet (voir API.md).
|
||||
## Quirks and defects observed (not to reproduce)
|
||||
- `wmic` is used to read the stick label, but it was removed from Windows 11.
|
||||
- `xcopy` fails when the target is a drive root; it falls back to `robocopy`.
|
||||
- A license name seen before and then deleted is reused: ENOENT until the application restarts.
|
||||
- The temporary `toUsbContent` folder is not always deleted (ENOTEMPTY).
|
||||
- Sorting updates by date has no effect (see API.md).
|
||||
@@ -0,0 +1,97 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Flatpak manifest. The GNOME runtime has GTK 4, curl and libarchive but not the C++ bindings,
|
||||
# so the gtkmm stack is built here (versions matching the runtime's GLib / GTK / Pango).
|
||||
#
|
||||
# flatpak-builder --user --install --force-clean build-flatpak packaging/flatpak/io.github.openpu.OpenPU.yml
|
||||
id: io.github.openpu.OpenPU
|
||||
runtime: org.gnome.Platform
|
||||
runtime-version: '51'
|
||||
sdk: org.gnome.Sdk
|
||||
command: openpu
|
||||
finish-args:
|
||||
- --share=network # Majestic API and downloads
|
||||
- --share=ipc
|
||||
- --socket=wayland
|
||||
- --socket=fallback-x11
|
||||
- --device=dri
|
||||
# Formatting, mounting and ejecting the USB stick go through UDisks2 (polkit asks the user).
|
||||
- --system-talk-name=org.freedesktop.UDisks2
|
||||
# Default download folder, and the mount points UDisks2 uses for the stick.
|
||||
- --filesystem=xdg-download
|
||||
- --filesystem=/media
|
||||
- --filesystem=/run/media
|
||||
cleanup:
|
||||
- /include
|
||||
- /lib/pkgconfig
|
||||
- /lib/cmake
|
||||
# configuration headers of the bindings (not the libraries themselves)
|
||||
- /lib/sigc++-3.0
|
||||
- /lib/cairomm-1.16
|
||||
- /lib/glibmm-2.68
|
||||
- /lib/giomm-2.68
|
||||
- /lib/pangomm-2.48
|
||||
- /lib/gtkmm-4.0
|
||||
- /share/pkgconfig
|
||||
- /share/doc
|
||||
- /share/devhelp
|
||||
- '*.la'
|
||||
- '*.a'
|
||||
modules:
|
||||
- name: nlohmann-json
|
||||
buildsystem: cmake-ninja
|
||||
config-opts:
|
||||
- -DJSON_BuildTests=OFF
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz
|
||||
sha256: 42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa
|
||||
|
||||
- name: libsigc++
|
||||
buildsystem: meson
|
||||
config-opts: [-Dbuild-documentation=false, -Dbuild-examples=false, -Dbuild-tests=false, -Dvalidation=false]
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://download.gnome.org/sources/libsigc++/3.6/libsigc++-3.6.0.tar.xz
|
||||
sha256: c3d23b37dfd6e39f2e09f091b77b1541fbfa17c4f0b6bf5c89baef7229080e17
|
||||
|
||||
- name: cairomm
|
||||
buildsystem: meson
|
||||
config-opts: [-Dbuild-documentation=false, -Dbuild-examples=false, -Dbuild-tests=false]
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://www.cairographics.org/releases/cairomm-1.18.0.tar.xz
|
||||
sha256: b81255394e3ea8e8aa887276d22afa8985fc8daef60692eb2407d23049f03cfb
|
||||
|
||||
- name: glibmm
|
||||
buildsystem: meson
|
||||
config-opts: [-Dbuild-documentation=false, -Dbuild-examples=false]
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://download.gnome.org/sources/glibmm/2.90/glibmm-2.90.0.tar.xz
|
||||
sha256: e2efa45643f16b9fea2d6299f2f403d672eaeacddf0ff7f8094e1af9b0f5980b
|
||||
|
||||
- name: pangomm
|
||||
buildsystem: meson
|
||||
config-opts: [-Dbuild-documentation=false]
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://download.gnome.org/sources/pangomm/2.58/pangomm-2.58.0.tar.xz
|
||||
sha256: 217514c1a65035c2fce6e69e33b0d92bafa2594cc474e995a4473441b10f3a33
|
||||
|
||||
- name: gtkmm
|
||||
buildsystem: meson
|
||||
config-opts: [-Dbuild-documentation=false, -Dbuild-demos=false, -Dbuild-tests=false]
|
||||
sources:
|
||||
- type: archive
|
||||
url: https://download.gnome.org/sources/gtkmm/4.24/gtkmm-4.24.0.tar.xz
|
||||
sha256: 7fd9cea356e7d3b74bf7d2a51d7e0e6763f3f9f1cddc5e77c8b0b5b7fa9d5e5a
|
||||
|
||||
- name: openpu
|
||||
buildsystem: cmake-ninja
|
||||
config-opts:
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DOPENPU_UI_GTK=ON
|
||||
- -DOPENPU_BUILD_TESTS=OFF
|
||||
sources:
|
||||
- type: dir
|
||||
path: ../..
|
||||
@@ -0,0 +1,65 @@
|
||||
SUMMARY="Download Peugeot head unit updates and prepare the USB stick"
|
||||
DESCRIPTION="OpenPU downloads the firmware and navigation map updates of Peugeot head \
|
||||
units (NAC, RCC, AIO, Crony) and prepares the installation USB stick: FAT32 formatting, \
|
||||
license and update files. Downloads resume where they stopped.
|
||||
|
||||
It provides a native graphical application and a command-line tool (openpu-cli). \
|
||||
Independent project, not affiliated with Stellantis or Peugeot."
|
||||
HOMEPAGE="https://github.com/yann64/openpu"
|
||||
COPYRIGHT="2026 yann64 and the OpenPU contributors"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
# Template for HaikuPorts (app-misc/openpu/openpu-<version>.recipe): set the file name to the
|
||||
# released version and CHECKSUM_SHA256 to the sha256sum of the tag archive below.
|
||||
SOURCE_URI="https://github.com/yann64/openpu/archive/refs/tags/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="0000000000000000000000000000000000000000000000000000000000000000"
|
||||
SOURCE_DIR="openpu-$portVersion"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
|
||||
PROVIDES="
|
||||
openpu$secondaryArchSuffix = $portVersion
|
||||
app:OpenPU = $portVersion
|
||||
cmd:openpu_cli = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libarchive$secondaryArchSuffix
|
||||
lib:libcurl$secondaryArchSuffix
|
||||
lib:libintl$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libarchive$secondaryArchSuffix
|
||||
devel:libcurl$secondaryArchSuffix
|
||||
devel:libintl$secondaryArchSuffix
|
||||
devel:nlohmann_json
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:cmake
|
||||
cmd:g++$secondaryArchSuffix
|
||||
cmd:mimeset
|
||||
cmd:msgfmt
|
||||
cmd:ninja
|
||||
cmd:rc
|
||||
cmd:xres
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX="$prefix" -DOPENPU_BUILD_TESTS=ON
|
||||
cmake --build build $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
# apps/OpenPU, bin/openpu-cli, data/locale and the Deskbar link, relative to $prefix.
|
||||
cmake --install build --strip
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
build/tests/openpu_tests
|
||||
}
|
||||
@@ -1,5 +1,11 @@
|
||||
# Translations (gettext). Source strings are English; add a language by adding <lang>.po and
|
||||
# listing it in LINGUAS.
|
||||
include(GNUInstallDirs)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
|
||||
set(OPENPU_INSTALL_LOCALEDIR data/locale) # Haiku package layout
|
||||
else()
|
||||
set(OPENPU_INSTALL_LOCALEDIR ${CMAKE_INSTALL_LOCALEDIR})
|
||||
endif()
|
||||
find_package(Gettext)
|
||||
if(NOT GETTEXT_FOUND)
|
||||
message(WARNING "gettext (msgfmt) not found: translations are not built")
|
||||
@@ -13,7 +19,7 @@ foreach(lang IN LISTS OPENPU_LINGUAS)
|
||||
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${mo} ${CMAKE_CURRENT_SOURCE_DIR}/${lang}.po
|
||||
DEPENDS ${lang}.po)
|
||||
list(APPEND OPENPU_MO_FILES ${mo})
|
||||
install(FILES ${mo} DESTINATION ${CMAKE_INSTALL_LOCALEDIR}/${lang}/LC_MESSAGES)
|
||||
install(FILES ${mo} DESTINATION ${OPENPU_INSTALL_LOCALEDIR}/${lang}/LC_MESSAGES)
|
||||
endforeach()
|
||||
add_custom_target(translations ALL DEPENDS ${OPENPU_MO_FILES})
|
||||
|
||||
@@ -24,5 +30,6 @@ if(XGETTEXT)
|
||||
COMMAND ${XGETTEXT} --keyword=_ --keyword=N_ --from-code=UTF-8 --package-name=openpu
|
||||
--add-comments=TRANSLATORS -o ${CMAKE_CURRENT_SOURCE_DIR}/openpu.pot
|
||||
${PROJECT_SOURCE_DIR}/src/ui-gtk/main_window.cpp
|
||||
${PROJECT_SOURCE_DIR}/src/ui-haiku/main_window.cpp
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
endif()
|
||||
@@ -2,319 +2,469 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openpu\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-11-29 05:53+0100\n"
|
||||
"PO-Revision-Date: 2026-11-28 20:00+0100\n"
|
||||
"Last-Translator: OpenPU contributors\n"
|
||||
"Language-Team: French\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:54 src/ui-haiku/main_window.cpp:185
|
||||
msgid "Crony (navigation)"
|
||||
msgstr "Crony (avec navigation)"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:55 src/ui-haiku/main_window.cpp:186
|
||||
msgid "Crony (no navigation)"
|
||||
msgstr "Crony (sans navigation)"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:58 src/ui-haiku/main_window.cpp:189
|
||||
msgid "unknown head unit"
|
||||
msgstr "autoradio inconnu"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:63 src/ui-haiku/main_window.cpp:194
|
||||
msgid "version %1, %2"
|
||||
msgstr "version %1, %2"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:70 src/ui-haiku/main_window.cpp:200
|
||||
msgid "The update server cannot be reached. Check your Internet connection."
|
||||
msgstr "Le serveur de mises à jour est injoignable. Vérifiez votre connexion Internet."
|
||||
msgstr ""
|
||||
"Le serveur de mises à jour est injoignable. Vérifiez votre connexion "
|
||||
"Internet."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:73 src/ui-haiku/main_window.cpp:202
|
||||
msgid "The update server returned an error. Try again later."
|
||||
msgstr "Le serveur de mises à jour a renvoyé une erreur. Réessayez plus tard."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:75 src/ui-haiku/main_window.cpp:203
|
||||
msgid "This VIN is not valid."
|
||||
msgstr "Ce VIN n'est pas valide."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:104 src/ui-haiku/main_window.cpp:407
|
||||
msgid "Your saved data cannot be read"
|
||||
msgstr "Vos données enregistrées sont illisibles"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:109 src/ui-haiku/main_window.cpp:720
|
||||
#: src/ui-haiku/main_window.cpp:807 src/ui-haiku/main_window.cpp:1071
|
||||
msgid "Back"
|
||||
msgstr "Retour"
|
||||
|
||||
msgid "About OpenPU"
|
||||
msgstr "À propos d'OpenPU"
|
||||
|
||||
msgid ""
|
||||
"Download Peugeot head unit updates (system and navigation map) and prepare the USB stick, on "
|
||||
"Linux and Haiku.\n"
|
||||
"\n"
|
||||
"Independent project, not affiliated with Stellantis or Peugeot."
|
||||
msgstr ""
|
||||
"Téléchargez les mises à jour de l'autoradio Peugeot (système et cartographie) et préparez la "
|
||||
"clé USB, sous Linux et Haiku.\n"
|
||||
"\n"
|
||||
"Projet indépendant, sans lien avec Stellantis ni Peugeot."
|
||||
|
||||
msgid "Source code"
|
||||
msgstr "Code source"
|
||||
|
||||
msgid "Cannot save the vehicle list"
|
||||
msgstr "Impossible d'enregistrer la liste des véhicules"
|
||||
|
||||
msgid "My vehicles"
|
||||
msgstr "Mes véhicules"
|
||||
|
||||
msgid "Add your vehicle with its VIN (17 characters, on the registration document, field E)."
|
||||
msgstr "Ajoutez votre véhicule avec son VIN (17 caractères, sur le certificat d'immatriculation, champ E)."
|
||||
|
||||
msgid "Add a vehicle"
|
||||
msgstr "Ajouter un véhicule"
|
||||
|
||||
msgid "Remove"
|
||||
msgstr "Supprimer"
|
||||
|
||||
msgid "Check for updates"
|
||||
msgstr "Rechercher les mises à jour"
|
||||
|
||||
msgid "download not finished"
|
||||
msgstr "téléchargement inachevé"
|
||||
|
||||
msgid "Remove %1?"
|
||||
msgstr "Supprimer %1 ?"
|
||||
|
||||
msgid "Downloaded files that were not written to a USB stick yet are deleted too."
|
||||
msgstr "Les fichiers téléchargés qui n'ont pas encore été copiés sur une clé USB seront aussi supprimés."
|
||||
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
msgid ""
|
||||
"The VIN (vehicle identification number) is written in field E of the registration document and "
|
||||
"at the bottom of the windscreen."
|
||||
msgstr ""
|
||||
"Le VIN (numéro d'identification du véhicule) figure au champ E du certificat d'immatriculation "
|
||||
"et en bas du pare-brise."
|
||||
|
||||
msgid "VIN"
|
||||
msgstr "VIN"
|
||||
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
msgid "e.g. 208 or Family car"
|
||||
msgstr "par ex. 208 ou Voiture familiale"
|
||||
|
||||
msgid "Add"
|
||||
msgstr "Ajouter"
|
||||
|
||||
msgid "A VIN has 17 characters and starts with VF3 or VR3."
|
||||
msgstr "Un VIN comporte 17 caractères et commence par VF3 ou VR3."
|
||||
|
||||
msgid "Checking the vehicle…"
|
||||
msgstr "Vérification du véhicule…"
|
||||
|
||||
msgid "This vehicle is unknown to the update service."
|
||||
msgstr "Ce véhicule est inconnu du service de mises à jour."
|
||||
|
||||
msgid "This vehicle has no head unit that can be updated with a USB stick."
|
||||
msgstr "Ce véhicule n'a pas d'autoradio pouvant être mis à jour par clé USB."
|
||||
|
||||
msgid "Download folder:"
|
||||
msgstr "Dossier de téléchargement :"
|
||||
|
||||
msgid "Change…"
|
||||
msgstr "Modifier…"
|
||||
|
||||
msgid "Installation guide"
|
||||
msgstr "Guide d'installation"
|
||||
|
||||
msgid "Download"
|
||||
msgstr "Télécharger"
|
||||
|
||||
msgid "Looking for updates…"
|
||||
msgstr "Recherche des mises à jour…"
|
||||
|
||||
msgid "No update is available: your head unit is up to date."
|
||||
msgstr "Aucune mise à jour disponible : votre autoradio est à jour."
|
||||
|
||||
msgid "Select the updates to download:"
|
||||
msgstr "Sélectionnez les mises à jour à télécharger :"
|
||||
|
||||
msgid "System (firmware)"
|
||||
msgstr "Système (firmware)"
|
||||
|
||||
msgid "Navigation map"
|
||||
msgstr "Cartographie"
|
||||
|
||||
msgid "Download folder"
|
||||
msgstr "Dossier de téléchargement"
|
||||
|
||||
msgid "Cannot save the settings"
|
||||
msgstr "Impossible d'enregistrer les réglages"
|
||||
|
||||
msgid "Not enough free space"
|
||||
msgstr "Espace libre insuffisant"
|
||||
|
||||
msgid ""
|
||||
"%1 are needed in %2 but only %3 are free. If a previous download of these files is already in "
|
||||
"this folder, it will be resumed and may fit."
|
||||
msgstr ""
|
||||
"%1 sont nécessaires dans %2 mais seuls %3 sont libres. Si un téléchargement précédent de ces "
|
||||
"fichiers se trouve déjà dans ce dossier, il sera repris et pourra tenir."
|
||||
|
||||
msgid "Download anyway"
|
||||
msgstr "Télécharger quand même"
|
||||
|
||||
msgid "Downloading"
|
||||
msgstr "Téléchargement"
|
||||
|
||||
msgid "You can close the application: the download will resume where it stopped next time."
|
||||
msgstr "Vous pouvez fermer l'application : le téléchargement reprendra là où il s'est arrêté."
|
||||
|
||||
msgid "Stop"
|
||||
msgstr "Arrêter"
|
||||
|
||||
msgid "License"
|
||||
msgstr "Licence"
|
||||
|
||||
msgid "waiting"
|
||||
msgstr "en attente"
|
||||
|
||||
msgid "Connecting…"
|
||||
msgstr "Connexion…"
|
||||
|
||||
msgid "Cannot write the file: %1"
|
||||
msgstr "Impossible d'écrire le fichier : %1"
|
||||
|
||||
msgid "The download failed: %1"
|
||||
msgstr "Le téléchargement a échoué : %1"
|
||||
|
||||
msgid "Download interrupted"
|
||||
msgstr "Téléchargement interrompu"
|
||||
|
||||
msgid "The files already downloaded are kept; start again to resume."
|
||||
msgstr "Les fichiers déjà téléchargés sont conservés ; relancez pour reprendre."
|
||||
|
||||
msgid "done"
|
||||
msgstr "terminé"
|
||||
|
||||
msgid "Time left: %1"
|
||||
msgstr "Temps restant : %1"
|
||||
|
||||
msgid "(connection lost, attempt %1)"
|
||||
msgstr "(connexion perdue, tentative %1)"
|
||||
|
||||
msgid "Prepare the USB stick"
|
||||
msgstr "Préparer la clé USB"
|
||||
|
||||
msgid "This USB stick is too small."
|
||||
msgstr "Cette clé USB est trop petite."
|
||||
|
||||
msgid "Refresh"
|
||||
msgstr "Actualiser"
|
||||
|
||||
msgid "Erase and write"
|
||||
msgstr "Effacer et écrire"
|
||||
|
||||
msgid "Computing the required size…"
|
||||
msgstr "Calcul de la taille nécessaire…"
|
||||
|
||||
msgid "A downloaded file is damaged"
|
||||
msgstr "Un fichier téléchargé est endommagé"
|
||||
|
||||
msgid "Download the update again."
|
||||
msgstr "Téléchargez à nouveau la mise à jour."
|
||||
|
||||
msgid "Plug in a USB stick of at least %1. It will be completely erased and formatted (FAT32)."
|
||||
msgstr "Branchez une clé USB d'au moins %1. Elle sera entièrement effacée et formatée (FAT32)."
|
||||
|
||||
msgid "USB drives cannot be listed: "
|
||||
msgstr "Impossible de lister les clés USB : "
|
||||
|
||||
msgid "too small"
|
||||
msgstr "trop petite"
|
||||
|
||||
msgid "No USB stick found. Plug one in, then refresh."
|
||||
msgstr "Aucune clé USB trouvée. Branchez-en une, puis actualisez."
|
||||
|
||||
msgid "Erase %1?"
|
||||
msgstr "Effacer %1 ?"
|
||||
|
||||
msgid "Everything on this USB stick will be lost."
|
||||
msgstr "Tout le contenu de cette clé USB sera perdu."
|
||||
|
||||
msgid "Writing the USB stick"
|
||||
msgstr "Écriture de la clé USB"
|
||||
|
||||
msgid "Do not unplug the USB stick."
|
||||
msgstr "Ne débranchez pas la clé USB."
|
||||
|
||||
msgid "Checking the downloaded files…"
|
||||
msgstr "Vérification des fichiers téléchargés…"
|
||||
|
||||
msgid "Permission to format the USB stick was refused."
|
||||
msgstr "L'autorisation de formater la clé USB a été refusée."
|
||||
|
||||
msgid "The USB stick could not be prepared"
|
||||
msgstr "La clé USB n'a pas pu être préparée"
|
||||
|
||||
msgid "Formatting the USB stick…"
|
||||
msgstr "Formatage de la clé USB…"
|
||||
|
||||
msgid "Copying the license…"
|
||||
msgstr "Copie de la licence…"
|
||||
|
||||
msgid "Copying the update…"
|
||||
msgstr "Copie de la mise à jour…"
|
||||
|
||||
msgid "Ejecting the USB stick…"
|
||||
msgstr "Éjection de la clé USB…"
|
||||
|
||||
msgid "The USB stick is ready"
|
||||
msgstr "La clé USB est prête"
|
||||
|
||||
msgid ""
|
||||
"You can unplug the USB stick. With the engine running, plug it into the vehicle and follow the "
|
||||
"instructions on the screen. The installation can take a long time: do not stop the engine."
|
||||
msgstr ""
|
||||
"Vous pouvez débrancher la clé USB. Moteur tournant, branchez-la dans le véhicule et suivez les "
|
||||
"instructions à l'écran. L'installation peut être longue : ne coupez pas le moteur."
|
||||
|
||||
msgid "Finish"
|
||||
msgstr "Terminer"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:113 src/ui-gtk/main_window.cpp:219
|
||||
#: src/ui-haiku/main_window.cpp:279 src/ui-haiku/main_window.cpp:384
|
||||
msgid "Preferences"
|
||||
msgstr "Préférences"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:114 src/ui-haiku/main_window.cpp:385
|
||||
msgid "Check for a new version of OpenPU"
|
||||
msgstr "Rechercher une nouvelle version d'OpenPU"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:115 src/ui-haiku/main_window.cpp:382
|
||||
msgid "About OpenPU"
|
||||
msgstr "À propos d'OpenPU"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:118
|
||||
msgid "Menu"
|
||||
msgstr "Menu"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:181 src/ui-haiku/main_window.cpp:509
|
||||
msgid "OpenPU is up to date"
|
||||
msgstr "OpenPU est à jour"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:182 src/ui-haiku/main_window.cpp:509
|
||||
msgid "Version %1 is the latest version."
|
||||
msgstr "La version %1 est la plus récente."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:185 src/ui-haiku/main_window.cpp:513
|
||||
msgid "Cannot check for a new version"
|
||||
msgstr "Impossible de rechercher une nouvelle version"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:195 src/ui-haiku/main_window.cpp:526
|
||||
msgid "OpenPU %1 is available"
|
||||
msgstr "OpenPU %1 est disponible"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:197 src/ui-haiku/main_window.cpp:523
|
||||
msgid "You are using version %1. Do you want to download the new version?"
|
||||
msgstr "Vous utilisez la version %1. Voulez-vous télécharger la nouvelle version ?"
|
||||
msgstr ""
|
||||
"Vous utilisez la version %1. Voulez-vous télécharger la nouvelle version ?"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:201 src/ui-haiku/main_window.cpp:526
|
||||
msgid "Later"
|
||||
msgstr "Plus tard"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:201 src/ui-gtk/main_window.cpp:625
|
||||
#: src/ui-haiku/main_window.cpp:527 src/ui-haiku/main_window.cpp:790
|
||||
msgid "Download"
|
||||
msgstr "Télécharger"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:231 src/ui-gtk/main_window.cpp:705
|
||||
#: src/ui-haiku/main_window.cpp:308 src/ui-haiku/main_window.cpp:898
|
||||
msgid "Download folder"
|
||||
msgstr "Dossier de téléchargement"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:238 src/ui-gtk/main_window.cpp:608
|
||||
#: src/ui-haiku/main_window.cpp:310 src/ui-haiku/main_window.cpp:803
|
||||
msgid "Change…"
|
||||
msgstr "Modifier…"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:247 src/ui-haiku/main_window.cpp:297
|
||||
msgid "Language"
|
||||
msgstr "Langue"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:252 src/ui-haiku/main_window.cpp:293
|
||||
msgid "System language"
|
||||
msgstr "Langue du système"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:258 src/ui-haiku/main_window.cpp:298
|
||||
msgid "The new language is used the next time OpenPU starts."
|
||||
msgstr "La nouvelle langue sera utilisée au prochain démarrage d'OpenPU."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:271 src/ui-gtk/main_window.cpp:286
|
||||
#: src/ui-gtk/main_window.cpp:718 src/ui-haiku/main_window.cpp:565
|
||||
msgid "Cannot save the settings"
|
||||
msgstr "Impossible d'enregistrer les réglages"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:279 src/ui-haiku/main_window.cpp:301
|
||||
msgid "Check for a new version of OpenPU at startup"
|
||||
msgstr "Rechercher une nouvelle version d'OpenPU au démarrage"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:338 src/ui-haiku/main_window.cpp:548
|
||||
msgid ""
|
||||
"Download Peugeot head unit updates (system and navigation map) and prepare "
|
||||
"the USB stick, on Linux and Haiku.\n"
|
||||
"\n"
|
||||
"Independent project, not affiliated with Stellantis or Peugeot."
|
||||
msgstr ""
|
||||
"Téléchargez les mises à jour de l'autoradio Peugeot (système et "
|
||||
"cartographie) et préparez la clé USB, sous Linux et Haiku.\n"
|
||||
"\n"
|
||||
"Projet indépendant, sans lien avec Stellantis ni Peugeot."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:344 src/ui-haiku/main_window.cpp:556
|
||||
msgid "Source code"
|
||||
msgstr "Code source"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:356 src/ui-haiku/main_window.cpp:574
|
||||
msgid "Cannot save the vehicle list"
|
||||
msgstr "Impossible d'enregistrer la liste des véhicules"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:370 src/ui-haiku/main_window.cpp:635
|
||||
msgid "My vehicles"
|
||||
msgstr "Mes véhicules"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:372 src/ui-haiku/main_window.cpp:623
|
||||
msgid ""
|
||||
"Add your vehicle with its VIN (17 characters, on the registration document, "
|
||||
"field E)."
|
||||
msgstr ""
|
||||
"Ajoutez votre véhicule avec son VIN (17 caractères, sur le certificat "
|
||||
"d'immatriculation, champ E)."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:392 src/ui-gtk/main_window.cpp:486
|
||||
#: src/ui-haiku/main_window.cpp:640 src/ui-haiku/main_window.cpp:710
|
||||
msgid "Add a vehicle"
|
||||
msgstr "Ajouter un véhicule"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:393 src/ui-gtk/main_window.cpp:457
|
||||
#: src/ui-haiku/main_window.cpp:629 src/ui-haiku/main_window.cpp:683
|
||||
msgid "Remove"
|
||||
msgstr "Supprimer"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:394 src/ui-haiku/main_window.cpp:630
|
||||
msgid "Check for updates"
|
||||
msgstr "Rechercher les mises à jour"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:425 src/ui-haiku/main_window.cpp:655
|
||||
msgid "download not finished"
|
||||
msgstr "téléchargement inachevé"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:455 src/ui-haiku/main_window.cpp:682
|
||||
msgid "Remove %1?"
|
||||
msgstr "Supprimer %1 ?"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:456 src/ui-haiku/main_window.cpp:683
|
||||
msgid ""
|
||||
"Downloaded files that were not written to a USB stick yet are deleted too."
|
||||
msgstr ""
|
||||
"Les fichiers téléchargés qui n'ont pas encore été copiés sur une clé USB "
|
||||
"seront aussi supprimés."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:457 src/ui-gtk/main_window.cpp:741
|
||||
#: src/ui-gtk/main_window.cpp:982 src/ui-haiku/main_window.cpp:683
|
||||
#: src/ui-haiku/main_window.cpp:938 src/ui-haiku/main_window.cpp:1156
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:488 src/ui-haiku/main_window.cpp:711
|
||||
msgid ""
|
||||
"The VIN (vehicle identification number) is written in field E of the "
|
||||
"registration document and at the bottom of the windscreen."
|
||||
msgstr ""
|
||||
"Le VIN (numéro d'identification du véhicule) figure au champ E du certificat "
|
||||
"d'immatriculation et en bas du pare-brise."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:496 src/ui-haiku/main_window.cpp:699
|
||||
msgid "VIN"
|
||||
msgstr "VIN"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:498 src/ui-haiku/main_window.cpp:702
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:503
|
||||
msgid "e.g. 208 or Family car"
|
||||
msgstr "par ex. 208 ou Voiture familiale"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:517 src/ui-haiku/main_window.cpp:704
|
||||
msgid "Add"
|
||||
msgstr "Ajouter"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:535 src/ui-haiku/main_window.cpp:732
|
||||
msgid "A VIN has 17 characters and starts with VF3 or VR3."
|
||||
msgstr "Un VIN comporte 17 caractères et commence par VF3 ou VR3."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:541 src/ui-haiku/main_window.cpp:737
|
||||
msgid "Checking the vehicle…"
|
||||
msgstr "Vérification du véhicule…"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:558 src/ui-haiku/main_window.cpp:753
|
||||
msgid "This vehicle is unknown to the update service."
|
||||
msgstr "Ce véhicule est inconnu du service de mises à jour."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:562 src/ui-haiku/main_window.cpp:757
|
||||
msgid "This vehicle has no head unit that can be updated with a USB stick."
|
||||
msgstr "Ce véhicule n'a pas d'autoradio pouvant être mis à jour par clé USB."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:604 src/ui-haiku/main_window.cpp:801
|
||||
msgid "Download folder:"
|
||||
msgstr "Dossier de téléchargement :"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:617 src/ui-gtk/main_window.cpp:1118
|
||||
#: src/ui-haiku/main_window.cpp:789 src/ui-haiku/main_window.cpp:1287
|
||||
msgid "Installation guide"
|
||||
msgstr "Guide d'installation"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:651 src/ui-haiku/main_window.cpp:835
|
||||
msgid "Looking for updates…"
|
||||
msgstr "Recherche des mises à jour…"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:685 src/ui-haiku/main_window.cpp:867
|
||||
msgid "No update is available: your head unit is up to date."
|
||||
msgstr "Aucune mise à jour disponible : votre autoradio est à jour."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:688 src/ui-haiku/main_window.cpp:870
|
||||
msgid "Select the updates to download:"
|
||||
msgstr "Sélectionnez les mises à jour à télécharger :"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:690 src/ui-gtk/main_window.cpp:803
|
||||
#: src/ui-haiku/main_window.cpp:872 src/ui-haiku/main_window.cpp:979
|
||||
msgid "System (firmware)"
|
||||
msgstr "Système (firmware)"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:695 src/ui-gtk/main_window.cpp:807
|
||||
#: src/ui-haiku/main_window.cpp:877 src/ui-haiku/main_window.cpp:982
|
||||
msgid "Navigation map"
|
||||
msgstr "Cartographie"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:736 src/ui-haiku/main_window.cpp:938
|
||||
msgid "Not enough free space"
|
||||
msgstr "Espace libre insuffisant"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:738 src/ui-haiku/main_window.cpp:935
|
||||
msgid ""
|
||||
"%1 are needed in %2 but only %3 are free. If a previous download of these "
|
||||
"files is already in this folder, it will be resumed and may fit."
|
||||
msgstr ""
|
||||
"%1 sont nécessaires dans %2 mais seuls %3 sont libres. Si un téléchargement "
|
||||
"précédent de ces fichiers se trouve déjà dans ce dossier, il sera repris et "
|
||||
"pourra tenir."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:741 src/ui-haiku/main_window.cpp:938
|
||||
msgid "Download anyway"
|
||||
msgstr "Télécharger quand même"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:763 src/ui-haiku/main_window.cpp:958
|
||||
msgid "Downloading"
|
||||
msgstr "Téléchargement"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:765 src/ui-haiku/main_window.cpp:954
|
||||
msgid ""
|
||||
"You can close the application: the download will resume where it stopped "
|
||||
"next time."
|
||||
msgstr ""
|
||||
"Vous pouvez fermer l'application : le téléchargement reprendra là où il "
|
||||
"s'est arrêté."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:786 src/ui-gtk/main_window.cpp:1014
|
||||
#: src/ui-haiku/main_window.cpp:952 src/ui-haiku/main_window.cpp:1168
|
||||
msgid "Stop"
|
||||
msgstr "Arrêter"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:799 src/ui-gtk/main_window.cpp:849
|
||||
#: src/ui-haiku/main_window.cpp:554 src/ui-haiku/main_window.cpp:976
|
||||
#: src/ui-haiku/main_window.cpp:1019
|
||||
msgid "License"
|
||||
msgstr "Licence"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:799 src/ui-haiku/main_window.cpp:976
|
||||
msgid "waiting"
|
||||
msgstr "en attente"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:812 src/ui-haiku/main_window.cpp:983
|
||||
msgid "Connecting…"
|
||||
msgstr "Connexion…"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:829 src/ui-haiku/main_window.cpp:999
|
||||
msgid "Cannot write the file: %1"
|
||||
msgstr "Impossible d'écrire le fichier : %1"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:830 src/ui-haiku/main_window.cpp:1000
|
||||
msgid "The download failed: %1"
|
||||
msgstr "Le téléchargement a échoué : %1"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:839 src/ui-haiku/main_window.cpp:1009
|
||||
msgid "Download interrupted"
|
||||
msgstr "Téléchargement interrompu"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:840 src/ui-haiku/main_window.cpp:1010
|
||||
msgid "The files already downloaded are kept; start again to resume."
|
||||
msgstr ""
|
||||
"Les fichiers déjà téléchargés sont conservés ; relancez pour reprendre."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:849 src/ui-haiku/main_window.cpp:1019
|
||||
msgid "done"
|
||||
msgstr "terminé"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:859 src/ui-haiku/main_window.cpp:1027
|
||||
msgid "Time left: %1"
|
||||
msgstr "Temps restant : %1"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:861 src/ui-haiku/main_window.cpp:1029
|
||||
msgid "(connection lost, attempt %1)"
|
||||
msgstr "(connexion perdue, tentative %1)"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:886 src/ui-haiku/main_window.cpp:1062
|
||||
msgid "Prepare the USB stick"
|
||||
msgstr "Préparer la clé USB"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:897 src/ui-gtk/main_window.cpp:970
|
||||
#: src/ui-haiku/main_window.cpp:1147
|
||||
msgid "This USB stick is too small."
|
||||
msgstr "Cette clé USB est trop petite."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:901 src/ui-haiku/main_window.cpp:1066
|
||||
msgid "Refresh"
|
||||
msgstr "Actualiser"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:910 src/ui-gtk/main_window.cpp:982
|
||||
#: src/ui-haiku/main_window.cpp:1057 src/ui-haiku/main_window.cpp:1156
|
||||
msgid "Erase and write"
|
||||
msgstr "Effacer et écrire"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:920 src/ui-haiku/main_window.cpp:1081
|
||||
msgid "Computing the required size…"
|
||||
msgstr "Calcul de la taille nécessaire…"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:934 src/ui-gtk/main_window.cpp:1055
|
||||
#: src/ui-haiku/main_window.cpp:1095 src/ui-haiku/main_window.cpp:1215
|
||||
msgid "A downloaded file is damaged"
|
||||
msgstr "Un fichier téléchargé est endommagé"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:934 src/ui-gtk/main_window.cpp:1055
|
||||
#: src/ui-haiku/main_window.cpp:1095 src/ui-haiku/main_window.cpp:1215
|
||||
msgid "Download the update again."
|
||||
msgstr "Téléchargez à nouveau la mise à jour."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:941 src/ui-haiku/main_window.cpp:1102
|
||||
msgid ""
|
||||
"Plug in a USB stick of at least %1. It will be completely erased and "
|
||||
"formatted (FAT32)."
|
||||
msgstr ""
|
||||
"Branchez une clé USB d'au moins %1. Elle sera entièrement effacée et "
|
||||
"formatée (FAT32)."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:956 src/ui-haiku/main_window.cpp:1118
|
||||
msgid "USB drives cannot be listed: "
|
||||
msgstr "Impossible de lister les clés USB : "
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:961 src/ui-haiku/main_window.cpp:1126
|
||||
msgid "too small"
|
||||
msgstr "trop petite"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:964 src/ui-haiku/main_window.cpp:1054
|
||||
#: src/ui-haiku/main_window.cpp:1134
|
||||
msgid "No USB stick found. Plug one in, then refresh."
|
||||
msgstr "Aucune clé USB trouvée. Branchez-en une, puis actualisez."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:980 src/ui-haiku/main_window.cpp:1155
|
||||
msgid "Erase %1?"
|
||||
msgstr "Effacer %1 ?"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:981 src/ui-haiku/main_window.cpp:1155
|
||||
msgid "Everything on this USB stick will be lost."
|
||||
msgstr "Tout le contenu de cette clé USB sera perdu."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1000 src/ui-haiku/main_window.cpp:1173
|
||||
msgid "Writing the USB stick"
|
||||
msgstr "Écriture de la clé USB"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1001 src/ui-haiku/main_window.cpp:1174
|
||||
msgid "Do not unplug the USB stick."
|
||||
msgstr "Ne débranchez pas la clé USB."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1026 src/ui-gtk/main_window.cpp:1072
|
||||
#: src/ui-haiku/main_window.cpp:1188 src/ui-haiku/main_window.cpp:1234
|
||||
msgid "Checking the downloaded files…"
|
||||
msgstr "Vérification des fichiers téléchargés…"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1046 src/ui-haiku/main_window.cpp:1206
|
||||
msgid "Permission to format the USB stick was refused."
|
||||
msgstr "L'autorisation de formater la clé USB a été refusée."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1061 src/ui-haiku/main_window.cpp:1221
|
||||
msgid "The USB stick could not be prepared"
|
||||
msgstr "La clé USB n'a pas pu être préparée"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1074 src/ui-haiku/main_window.cpp:1236
|
||||
msgid "Formatting the USB stick…"
|
||||
msgstr "Formatage de la clé USB…"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1077 src/ui-haiku/main_window.cpp:1240
|
||||
msgid "Copying the license…"
|
||||
msgstr "Copie de la licence…"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1078 src/ui-haiku/main_window.cpp:1243
|
||||
msgid "Copying the update…"
|
||||
msgstr "Copie de la mise à jour…"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1080 src/ui-haiku/main_window.cpp:1245
|
||||
msgid "Ejecting the USB stick…"
|
||||
msgstr "Éjection de la clé USB…"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1111 src/ui-haiku/main_window.cpp:1281
|
||||
msgid "The USB stick is ready"
|
||||
msgstr "La clé USB est prête"
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1113 src/ui-haiku/main_window.cpp:1282
|
||||
msgid ""
|
||||
"You can unplug the USB stick. With the engine running, plug it into the "
|
||||
"vehicle and follow the instructions on the screen. The installation can take "
|
||||
"a long time: do not stop the engine."
|
||||
msgstr ""
|
||||
"Vous pouvez débrancher la clé USB. Moteur tournant, branchez-la dans le "
|
||||
"véhicule et suivez les instructions à l'écran. L'installation peut être "
|
||||
"longue : ne coupez pas le moteur."
|
||||
|
||||
#: src/ui-gtk/main_window.cpp:1126 src/ui-haiku/main_window.cpp:1277
|
||||
msgid "Finish"
|
||||
msgstr "Terminer"
|
||||
|
||||
#: src/ui-haiku/main_window.cpp:387
|
||||
msgid "Quit"
|
||||
msgstr "Quitter"
|
||||
|
||||
#: src/ui-haiku/main_window.cpp:897
|
||||
msgid "Select"
|
||||
msgstr "Sélectionner"
|
||||
@@ -1,401 +1,450 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the openpu package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openpu\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-11-29 05:53+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:54
|
||||
#: src/ui-gtk/main_window.cpp:54 src/ui-haiku/main_window.cpp:185
|
||||
msgid "Crony (navigation)"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:55
|
||||
#: src/ui-gtk/main_window.cpp:55 src/ui-haiku/main_window.cpp:186
|
||||
msgid "Crony (no navigation)"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:58
|
||||
#: src/ui-gtk/main_window.cpp:58 src/ui-haiku/main_window.cpp:189
|
||||
msgid "unknown head unit"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:63
|
||||
#, qt-format
|
||||
#: src/ui-gtk/main_window.cpp:63 src/ui-haiku/main_window.cpp:194
|
||||
msgid "version %1, %2"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:70
|
||||
#: src/ui-gtk/main_window.cpp:70 src/ui-haiku/main_window.cpp:200
|
||||
msgid "The update server cannot be reached. Check your Internet connection."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:73
|
||||
#: src/ui-gtk/main_window.cpp:73 src/ui-haiku/main_window.cpp:202
|
||||
msgid "The update server returned an error. Try again later."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:75
|
||||
#: src/ui-gtk/main_window.cpp:75 src/ui-haiku/main_window.cpp:203
|
||||
msgid "This VIN is not valid."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:104
|
||||
#: src/ui-gtk/main_window.cpp:104 src/ui-haiku/main_window.cpp:407
|
||||
msgid "Your saved data cannot be read"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:109
|
||||
#: src/ui-gtk/main_window.cpp:109 src/ui-haiku/main_window.cpp:720
|
||||
#: src/ui-haiku/main_window.cpp:807 src/ui-haiku/main_window.cpp:1071
|
||||
msgid "Back"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:113 src\ui-gtk\main_window.cpp:219
|
||||
#: src/ui-gtk/main_window.cpp:113 src/ui-gtk/main_window.cpp:219
|
||||
#: src/ui-haiku/main_window.cpp:279 src/ui-haiku/main_window.cpp:384
|
||||
msgid "Preferences"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:114
|
||||
#: src/ui-gtk/main_window.cpp:114 src/ui-haiku/main_window.cpp:385
|
||||
msgid "Check for a new version of OpenPU"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:115
|
||||
#: src/ui-gtk/main_window.cpp:115 src/ui-haiku/main_window.cpp:382
|
||||
msgid "About OpenPU"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:118
|
||||
#: src/ui-gtk/main_window.cpp:118
|
||||
msgid "Menu"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:181
|
||||
#: src/ui-gtk/main_window.cpp:181 src/ui-haiku/main_window.cpp:509
|
||||
msgid "OpenPU is up to date"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:182
|
||||
#, qt-format
|
||||
#: src/ui-gtk/main_window.cpp:182 src/ui-haiku/main_window.cpp:509
|
||||
msgid "Version %1 is the latest version."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:185
|
||||
#: src/ui-gtk/main_window.cpp:185 src/ui-haiku/main_window.cpp:513
|
||||
msgid "Cannot check for a new version"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:195
|
||||
#, qt-format
|
||||
#: src/ui-gtk/main_window.cpp:195 src/ui-haiku/main_window.cpp:526
|
||||
msgid "OpenPU %1 is available"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:197
|
||||
#, qt-format
|
||||
#: src/ui-gtk/main_window.cpp:197 src/ui-haiku/main_window.cpp:523
|
||||
msgid "You are using version %1. Do you want to download the new version?"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:201
|
||||
#: src/ui-gtk/main_window.cpp:201 src/ui-haiku/main_window.cpp:526
|
||||
msgid "Later"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:201 src\ui-gtk\main_window.cpp:625
|
||||
#: src/ui-gtk/main_window.cpp:201 src/ui-gtk/main_window.cpp:625
|
||||
#: src/ui-haiku/main_window.cpp:527 src/ui-haiku/main_window.cpp:790
|
||||
msgid "Download"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:231 src\ui-gtk\main_window.cpp:705
|
||||
#: src/ui-gtk/main_window.cpp:231 src/ui-gtk/main_window.cpp:705
|
||||
#: src/ui-haiku/main_window.cpp:308 src/ui-haiku/main_window.cpp:898
|
||||
msgid "Download folder"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:238 src\ui-gtk\main_window.cpp:608
|
||||
#: src/ui-gtk/main_window.cpp:238 src/ui-gtk/main_window.cpp:608
|
||||
#: src/ui-haiku/main_window.cpp:310 src/ui-haiku/main_window.cpp:803
|
||||
msgid "Change…"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:247
|
||||
#: src/ui-gtk/main_window.cpp:247 src/ui-haiku/main_window.cpp:297
|
||||
msgid "Language"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:252
|
||||
#: src/ui-gtk/main_window.cpp:252 src/ui-haiku/main_window.cpp:293
|
||||
msgid "System language"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:258
|
||||
#: src/ui-gtk/main_window.cpp:258 src/ui-haiku/main_window.cpp:298
|
||||
msgid "The new language is used the next time OpenPU starts."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:271 src\ui-gtk\main_window.cpp:286 src\ui-gtk\main_window.cpp:718
|
||||
#: src/ui-gtk/main_window.cpp:271 src/ui-gtk/main_window.cpp:286
|
||||
#: src/ui-gtk/main_window.cpp:718 src/ui-haiku/main_window.cpp:565
|
||||
msgid "Cannot save the settings"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:279
|
||||
#: src/ui-gtk/main_window.cpp:279 src/ui-haiku/main_window.cpp:301
|
||||
msgid "Check for a new version of OpenPU at startup"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:338
|
||||
msgid "Download Peugeot head unit updates (system and navigation map) and prepare the USB stick, on Linux and Haiku.\n\nIndependent project, not affiliated with Stellantis or Peugeot."
|
||||
#: src/ui-gtk/main_window.cpp:338 src/ui-haiku/main_window.cpp:548
|
||||
msgid ""
|
||||
"Download Peugeot head unit updates (system and navigation map) and prepare "
|
||||
"the USB stick, on Linux and Haiku.\n"
|
||||
"\n"
|
||||
"Independent project, not affiliated with Stellantis or Peugeot."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:344
|
||||
#: src/ui-gtk/main_window.cpp:344 src/ui-haiku/main_window.cpp:556
|
||||
msgid "Source code"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:356
|
||||
#: src/ui-gtk/main_window.cpp:356 src/ui-haiku/main_window.cpp:574
|
||||
msgid "Cannot save the vehicle list"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:370
|
||||
#: src/ui-gtk/main_window.cpp:370 src/ui-haiku/main_window.cpp:635
|
||||
msgid "My vehicles"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:372
|
||||
msgid "Add your vehicle with its VIN (17 characters, on the registration document, field E)."
|
||||
#: src/ui-gtk/main_window.cpp:372 src/ui-haiku/main_window.cpp:623
|
||||
msgid ""
|
||||
"Add your vehicle with its VIN (17 characters, on the registration document, "
|
||||
"field E)."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:392 src\ui-gtk\main_window.cpp:486
|
||||
#: src/ui-gtk/main_window.cpp:392 src/ui-gtk/main_window.cpp:486
|
||||
#: src/ui-haiku/main_window.cpp:640 src/ui-haiku/main_window.cpp:710
|
||||
msgid "Add a vehicle"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:393 src\ui-gtk\main_window.cpp:457
|
||||
#: src/ui-gtk/main_window.cpp:393 src/ui-gtk/main_window.cpp:457
|
||||
#: src/ui-haiku/main_window.cpp:629 src/ui-haiku/main_window.cpp:683
|
||||
msgid "Remove"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:394
|
||||
#: src/ui-gtk/main_window.cpp:394 src/ui-haiku/main_window.cpp:630
|
||||
msgid "Check for updates"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:425
|
||||
#: src/ui-gtk/main_window.cpp:425 src/ui-haiku/main_window.cpp:655
|
||||
msgid "download not finished"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:455
|
||||
#, qt-format
|
||||
#: src/ui-gtk/main_window.cpp:455 src/ui-haiku/main_window.cpp:682
|
||||
msgid "Remove %1?"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:456
|
||||
msgid "Downloaded files that were not written to a USB stick yet are deleted too."
|
||||
#: src/ui-gtk/main_window.cpp:456 src/ui-haiku/main_window.cpp:683
|
||||
msgid ""
|
||||
"Downloaded files that were not written to a USB stick yet are deleted too."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:457 src\ui-gtk\main_window.cpp:741 src\ui-gtk\main_window.cpp:982
|
||||
#: src/ui-gtk/main_window.cpp:457 src/ui-gtk/main_window.cpp:741
|
||||
#: src/ui-gtk/main_window.cpp:982 src/ui-haiku/main_window.cpp:683
|
||||
#: src/ui-haiku/main_window.cpp:938 src/ui-haiku/main_window.cpp:1156
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:488
|
||||
msgid "The VIN (vehicle identification number) is written in field E of the registration document and at the bottom of the windscreen."
|
||||
#: src/ui-gtk/main_window.cpp:488 src/ui-haiku/main_window.cpp:711
|
||||
msgid ""
|
||||
"The VIN (vehicle identification number) is written in field E of the "
|
||||
"registration document and at the bottom of the windscreen."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:496
|
||||
#: src/ui-gtk/main_window.cpp:496 src/ui-haiku/main_window.cpp:699
|
||||
msgid "VIN"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:498
|
||||
#: src/ui-gtk/main_window.cpp:498 src/ui-haiku/main_window.cpp:702
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:503
|
||||
#: src/ui-gtk/main_window.cpp:503
|
||||
msgid "e.g. 208 or Family car"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:517
|
||||
#: src/ui-gtk/main_window.cpp:517 src/ui-haiku/main_window.cpp:704
|
||||
msgid "Add"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:535
|
||||
#: src/ui-gtk/main_window.cpp:535 src/ui-haiku/main_window.cpp:732
|
||||
msgid "A VIN has 17 characters and starts with VF3 or VR3."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:541
|
||||
#: src/ui-gtk/main_window.cpp:541 src/ui-haiku/main_window.cpp:737
|
||||
msgid "Checking the vehicle…"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:558
|
||||
#: src/ui-gtk/main_window.cpp:558 src/ui-haiku/main_window.cpp:753
|
||||
msgid "This vehicle is unknown to the update service."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:562
|
||||
#: src/ui-gtk/main_window.cpp:562 src/ui-haiku/main_window.cpp:757
|
||||
msgid "This vehicle has no head unit that can be updated with a USB stick."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:604
|
||||
#: src/ui-gtk/main_window.cpp:604 src/ui-haiku/main_window.cpp:801
|
||||
msgid "Download folder:"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:617 src\ui-gtk\main_window.cpp:1118
|
||||
#: src/ui-gtk/main_window.cpp:617 src/ui-gtk/main_window.cpp:1118
|
||||
#: src/ui-haiku/main_window.cpp:789 src/ui-haiku/main_window.cpp:1287
|
||||
msgid "Installation guide"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:651
|
||||
#: src/ui-gtk/main_window.cpp:651 src/ui-haiku/main_window.cpp:835
|
||||
msgid "Looking for updates…"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:685
|
||||
#: src/ui-gtk/main_window.cpp:685 src/ui-haiku/main_window.cpp:867
|
||||
msgid "No update is available: your head unit is up to date."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:688
|
||||
#: src/ui-gtk/main_window.cpp:688 src/ui-haiku/main_window.cpp:870
|
||||
msgid "Select the updates to download:"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:690 src\ui-gtk\main_window.cpp:803
|
||||
#: src/ui-gtk/main_window.cpp:690 src/ui-gtk/main_window.cpp:803
|
||||
#: src/ui-haiku/main_window.cpp:872 src/ui-haiku/main_window.cpp:979
|
||||
msgid "System (firmware)"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:695 src\ui-gtk\main_window.cpp:807
|
||||
#: src/ui-gtk/main_window.cpp:695 src/ui-gtk/main_window.cpp:807
|
||||
#: src/ui-haiku/main_window.cpp:877 src/ui-haiku/main_window.cpp:982
|
||||
msgid "Navigation map"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:736
|
||||
#: src/ui-gtk/main_window.cpp:736 src/ui-haiku/main_window.cpp:938
|
||||
msgid "Not enough free space"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:738
|
||||
#, qt-format
|
||||
msgid "%1 are needed in %2 but only %3 are free. If a previous download of these files is already in this folder, it will be resumed and may fit."
|
||||
#: src/ui-gtk/main_window.cpp:738 src/ui-haiku/main_window.cpp:935
|
||||
msgid ""
|
||||
"%1 are needed in %2 but only %3 are free. If a previous download of these "
|
||||
"files is already in this folder, it will be resumed and may fit."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:741
|
||||
#: src/ui-gtk/main_window.cpp:741 src/ui-haiku/main_window.cpp:938
|
||||
msgid "Download anyway"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:763
|
||||
#: src/ui-gtk/main_window.cpp:763 src/ui-haiku/main_window.cpp:958
|
||||
msgid "Downloading"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:765
|
||||
msgid "You can close the application: the download will resume where it stopped next time."
|
||||
#: src/ui-gtk/main_window.cpp:765 src/ui-haiku/main_window.cpp:954
|
||||
msgid ""
|
||||
"You can close the application: the download will resume where it stopped "
|
||||
"next time."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:786 src\ui-gtk\main_window.cpp:1014
|
||||
#: src/ui-gtk/main_window.cpp:786 src/ui-gtk/main_window.cpp:1014
|
||||
#: src/ui-haiku/main_window.cpp:952 src/ui-haiku/main_window.cpp:1168
|
||||
msgid "Stop"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:799 src\ui-gtk\main_window.cpp:849
|
||||
#: src/ui-gtk/main_window.cpp:799 src/ui-gtk/main_window.cpp:849
|
||||
#: src/ui-haiku/main_window.cpp:554 src/ui-haiku/main_window.cpp:976
|
||||
#: src/ui-haiku/main_window.cpp:1019
|
||||
msgid "License"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:799
|
||||
#: src/ui-gtk/main_window.cpp:799 src/ui-haiku/main_window.cpp:976
|
||||
msgid "waiting"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:812
|
||||
#: src/ui-gtk/main_window.cpp:812 src/ui-haiku/main_window.cpp:983
|
||||
msgid "Connecting…"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:829
|
||||
#, qt-format
|
||||
#: src/ui-gtk/main_window.cpp:829 src/ui-haiku/main_window.cpp:999
|
||||
msgid "Cannot write the file: %1"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:830
|
||||
#, qt-format
|
||||
#: src/ui-gtk/main_window.cpp:830 src/ui-haiku/main_window.cpp:1000
|
||||
msgid "The download failed: %1"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:839
|
||||
#: src/ui-gtk/main_window.cpp:839 src/ui-haiku/main_window.cpp:1009
|
||||
msgid "Download interrupted"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:840
|
||||
#: src/ui-gtk/main_window.cpp:840 src/ui-haiku/main_window.cpp:1010
|
||||
msgid "The files already downloaded are kept; start again to resume."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:849
|
||||
#: src/ui-gtk/main_window.cpp:849 src/ui-haiku/main_window.cpp:1019
|
||||
msgid "done"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:859
|
||||
#, qt-format
|
||||
#: src/ui-gtk/main_window.cpp:859 src/ui-haiku/main_window.cpp:1027
|
||||
msgid "Time left: %1"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:861
|
||||
#, qt-format
|
||||
#: src/ui-gtk/main_window.cpp:861 src/ui-haiku/main_window.cpp:1029
|
||||
msgid "(connection lost, attempt %1)"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:886
|
||||
#: src/ui-gtk/main_window.cpp:886 src/ui-haiku/main_window.cpp:1062
|
||||
msgid "Prepare the USB stick"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:897 src\ui-gtk\main_window.cpp:970
|
||||
#: src/ui-gtk/main_window.cpp:897 src/ui-gtk/main_window.cpp:970
|
||||
#: src/ui-haiku/main_window.cpp:1147
|
||||
msgid "This USB stick is too small."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:901
|
||||
#: src/ui-gtk/main_window.cpp:901 src/ui-haiku/main_window.cpp:1066
|
||||
msgid "Refresh"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:910 src\ui-gtk\main_window.cpp:982
|
||||
#: src/ui-gtk/main_window.cpp:910 src/ui-gtk/main_window.cpp:982
|
||||
#: src/ui-haiku/main_window.cpp:1057 src/ui-haiku/main_window.cpp:1156
|
||||
msgid "Erase and write"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:920
|
||||
#: src/ui-gtk/main_window.cpp:920 src/ui-haiku/main_window.cpp:1081
|
||||
msgid "Computing the required size…"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:934 src\ui-gtk\main_window.cpp:1055
|
||||
#: src/ui-gtk/main_window.cpp:934 src/ui-gtk/main_window.cpp:1055
|
||||
#: src/ui-haiku/main_window.cpp:1095 src/ui-haiku/main_window.cpp:1215
|
||||
msgid "A downloaded file is damaged"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:934 src\ui-gtk\main_window.cpp:1055
|
||||
#: src/ui-gtk/main_window.cpp:934 src/ui-gtk/main_window.cpp:1055
|
||||
#: src/ui-haiku/main_window.cpp:1095 src/ui-haiku/main_window.cpp:1215
|
||||
msgid "Download the update again."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:941
|
||||
#, qt-format
|
||||
msgid "Plug in a USB stick of at least %1. It will be completely erased and formatted (FAT32)."
|
||||
#: src/ui-gtk/main_window.cpp:941 src/ui-haiku/main_window.cpp:1102
|
||||
msgid ""
|
||||
"Plug in a USB stick of at least %1. It will be completely erased and "
|
||||
"formatted (FAT32)."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:956
|
||||
#: src/ui-gtk/main_window.cpp:956 src/ui-haiku/main_window.cpp:1118
|
||||
msgid "USB drives cannot be listed: "
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:961
|
||||
#: src/ui-gtk/main_window.cpp:961 src/ui-haiku/main_window.cpp:1126
|
||||
msgid "too small"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:964
|
||||
#: src/ui-gtk/main_window.cpp:964 src/ui-haiku/main_window.cpp:1054
|
||||
#: src/ui-haiku/main_window.cpp:1134
|
||||
msgid "No USB stick found. Plug one in, then refresh."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:980
|
||||
#, qt-format
|
||||
#: src/ui-gtk/main_window.cpp:980 src/ui-haiku/main_window.cpp:1155
|
||||
msgid "Erase %1?"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:981
|
||||
#: src/ui-gtk/main_window.cpp:981 src/ui-haiku/main_window.cpp:1155
|
||||
msgid "Everything on this USB stick will be lost."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1000
|
||||
#: src/ui-gtk/main_window.cpp:1000 src/ui-haiku/main_window.cpp:1173
|
||||
msgid "Writing the USB stick"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1001
|
||||
#: src/ui-gtk/main_window.cpp:1001 src/ui-haiku/main_window.cpp:1174
|
||||
msgid "Do not unplug the USB stick."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1026 src\ui-gtk\main_window.cpp:1072
|
||||
#: src/ui-gtk/main_window.cpp:1026 src/ui-gtk/main_window.cpp:1072
|
||||
#: src/ui-haiku/main_window.cpp:1188 src/ui-haiku/main_window.cpp:1234
|
||||
msgid "Checking the downloaded files…"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1046
|
||||
#: src/ui-gtk/main_window.cpp:1046 src/ui-haiku/main_window.cpp:1206
|
||||
msgid "Permission to format the USB stick was refused."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1061
|
||||
#: src/ui-gtk/main_window.cpp:1061 src/ui-haiku/main_window.cpp:1221
|
||||
msgid "The USB stick could not be prepared"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1074
|
||||
#: src/ui-gtk/main_window.cpp:1074 src/ui-haiku/main_window.cpp:1236
|
||||
msgid "Formatting the USB stick…"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1077
|
||||
#: src/ui-gtk/main_window.cpp:1077 src/ui-haiku/main_window.cpp:1240
|
||||
msgid "Copying the license…"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1078
|
||||
#: src/ui-gtk/main_window.cpp:1078 src/ui-haiku/main_window.cpp:1243
|
||||
msgid "Copying the update…"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1080
|
||||
#: src/ui-gtk/main_window.cpp:1080 src/ui-haiku/main_window.cpp:1245
|
||||
msgid "Ejecting the USB stick…"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1111
|
||||
#: src/ui-gtk/main_window.cpp:1111 src/ui-haiku/main_window.cpp:1281
|
||||
msgid "The USB stick is ready"
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1113
|
||||
msgid "You can unplug the USB stick. With the engine running, plug it into the vehicle and follow the instructions on the screen. The installation can take a long time: do not stop the engine."
|
||||
#: src/ui-gtk/main_window.cpp:1113 src/ui-haiku/main_window.cpp:1282
|
||||
msgid ""
|
||||
"You can unplug the USB stick. With the engine running, plug it into the "
|
||||
"vehicle and follow the instructions on the screen. The installation can take "
|
||||
"a long time: do not stop the engine."
|
||||
msgstr ""
|
||||
|
||||
#: src\ui-gtk\main_window.cpp:1126
|
||||
#: src/ui-gtk/main_window.cpp:1126 src/ui-haiku/main_window.cpp:1277
|
||||
msgid "Finish"
|
||||
msgstr ""
|
||||
|
||||
#: src/ui-haiku/main_window.cpp:387
|
||||
msgid "Quit"
|
||||
msgstr ""
|
||||
|
||||
#: src/ui-haiku/main_window.cpp:897
|
||||
msgid "Select"
|
||||
msgstr ""
|
||||
@@ -1,3 +1,4 @@
|
||||
add_executable(openpu-cli main.cpp)
|
||||
target_link_libraries(openpu-cli PRIVATE openpu_core openpu_warnings)
|
||||
install(TARGETS openpu-cli RUNTIME DESTINATION bin)
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS openpu-cli RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
@@ -24,6 +24,10 @@ target_link_libraries(openpu_core
|
||||
# USB backend
|
||||
if(HAIKU)
|
||||
target_sources(openpu_core PRIVATE usb_haiku.cpp)
|
||||
# The disk device API (BDiskDevice, BPartition) lives in the private Storage Kit headers.
|
||||
find_path(HAIKU_PRIVATE_STORAGE DiskDevice.h PATHS /boot/system/develop/headers/private/storage REQUIRED)
|
||||
target_include_directories(openpu_core SYSTEM PRIVATE ${HAIKU_PRIVATE_STORAGE}
|
||||
/boot/system/develop/headers/private/shared)
|
||||
target_link_libraries(openpu_core PUBLIC be)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
@@ -186,13 +186,21 @@ std::uint64_t tarPayloadSize(const fs::path& path)
|
||||
return total;
|
||||
}
|
||||
|
||||
void extractTar(const fs::path& path, const fs::path& destination, const ArchiveProgressCallback& onProgress,
|
||||
void extractTar(const fs::path& path, const fs::path& requestedDestination, const ArchiveProgressCallback& onProgress,
|
||||
const CancelToken* cancel)
|
||||
{
|
||||
std::error_code ec;
|
||||
fs::create_directories(destination, ec);
|
||||
fs::create_directories(requestedDestination, ec);
|
||||
if (ec)
|
||||
throw ArchiveError(ArchiveError::Kind::Io, "cannot create " + destination.string() + ": " + ec.message());
|
||||
throw ArchiveError(ArchiveError::Kind::Io,
|
||||
"cannot create " + requestedDestination.string() + ": " + ec.message());
|
||||
// ARCHIVE_EXTRACT_SECURE_SYMLINKS rejects a symlink anywhere in the target path, including the
|
||||
// destination itself (e.g. /tmp is a symlink on Haiku). Resolve the destination first so that
|
||||
// only links *inside* it are refused.
|
||||
const fs::path destination = fs::canonical(requestedDestination, ec);
|
||||
if (ec)
|
||||
throw ArchiveError(ArchiveError::Kind::Io,
|
||||
"cannot resolve " + requestedDestination.string() + ": " + ec.message());
|
||||
|
||||
ReadPtr a = openTar(path);
|
||||
WritePtr w(archive_write_disk_new());
|
||||
|
||||
@@ -0,0 +1,266 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// Haiku USB backend: enumeration, FAT32 formatting, mounting and ejecting through the Storage Kit
|
||||
// disk device API (BDiskDeviceRoster / BDiskDevice / BPartition), the same API DriveSetup uses.
|
||||
// Haiku is single-user, so no authorisation step is involved.
|
||||
|
||||
#include "openpu/usb.hpp"
|
||||
|
||||
#include <DiskDevice.h>
|
||||
#include <DiskDeviceRoster.h>
|
||||
#include <DiskDeviceTypes.h>
|
||||
#include <Partition.h>
|
||||
#include <Path.h>
|
||||
#include <String.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
namespace openpu {
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr off_t kPartitionOffset = off_t{1024} * 1024; // 1 MiB, like the Linux backend
|
||||
// Partition type as named by the "intel" partitioning add-on (MBR type 0x0c, as on Linux).
|
||||
// Not kPartitionTypeFAT32: that one is the *file system* name ("FAT32 File System").
|
||||
constexpr const char* kMbrTypeFat32Lba = "FAT 32-bit, LBA-mapped";
|
||||
// The intel add-on rejects a NULL parameter string when the job runs; DriveSetup always sends this.
|
||||
constexpr const char* kMbrChildParameters = "active false\n";
|
||||
|
||||
std::string statusText(status_t s)
|
||||
{
|
||||
return std::strerror(s); // NOLINT(concurrency-mt-unsafe): Haiku's strerror is thread-safe
|
||||
}
|
||||
|
||||
[[noreturn]] void fail(const std::string& what, status_t status)
|
||||
{
|
||||
throw UsbError(UsbError::Kind::Failed, what + ": " + statusText(status));
|
||||
}
|
||||
|
||||
/// Step tracing on stderr when OPENPU_DEBUG is set (diagnosing disk device jobs).
|
||||
void trace(const std::string& step)
|
||||
{
|
||||
static const bool enabled = std::getenv("OPENPU_DEBUG") != nullptr; // NOLINT(concurrency-mt-unsafe)
|
||||
if (enabled)
|
||||
(void)std::fprintf(stderr, "[usb_haiku] %s\n", step.c_str());
|
||||
}
|
||||
|
||||
bool startsWith(const char* s, const char* prefix)
|
||||
{
|
||||
return s != nullptr && std::strncmp(s, prefix, std::strlen(prefix)) == 0;
|
||||
}
|
||||
|
||||
/// Calls `fn` for the device itself and every partition below it.
|
||||
template <typename F>
|
||||
void forEachPartition(BPartition* p, F&& fn)
|
||||
{
|
||||
fn(p);
|
||||
for (int32 i = 0; i < p->CountChildren(); ++i)
|
||||
forEachPartition(p->ChildAt(i), fn);
|
||||
}
|
||||
|
||||
bool hostsBootVolume(BDiskDevice& device)
|
||||
{
|
||||
bool boot = false;
|
||||
forEachPartition(&device, [&](BPartition* p) {
|
||||
BPath mp;
|
||||
if (p->IsMounted() && p->GetMountPoint(&mp) == B_OK && std::strcmp(mp.Path(), "/boot") == 0)
|
||||
boot = true;
|
||||
});
|
||||
return boot;
|
||||
}
|
||||
|
||||
partition_id parseId(const std::string& id)
|
||||
{
|
||||
try {
|
||||
return static_cast<partition_id>(std::stoi(id));
|
||||
} catch (const std::exception&) {
|
||||
throw UsbError(UsbError::Kind::Failed, "invalid drive id " + id);
|
||||
}
|
||||
}
|
||||
|
||||
/// Disk systems are looked up by short name on some Haiku versions and by "pretty" name on others.
|
||||
status_t initialize(BPartition* p, const char* shortName, const char* prettyName, const char* name,
|
||||
const char* parameters)
|
||||
{
|
||||
status_t s = p->Initialize(shortName, name, parameters);
|
||||
if (s != B_OK)
|
||||
s = p->Initialize(prettyName, name, parameters);
|
||||
return s;
|
||||
}
|
||||
|
||||
class HaikuUsbBackend final : public UsbBackend {
|
||||
public:
|
||||
std::vector<UsbDrive> list() override
|
||||
{
|
||||
std::vector<UsbDrive> out;
|
||||
BDiskDeviceRoster roster;
|
||||
BDiskDevice device;
|
||||
roster.RewindDevices();
|
||||
while (roster.GetNextDevice(&device) == B_OK) {
|
||||
BPath path;
|
||||
if (device.GetPath(&path) != B_OK || !startsWith(path.Path(), "/dev/disk/usb/"))
|
||||
continue;
|
||||
if (!device.HasMedia() || device.IsReadOnlyMedia() || device.Size() <= 0 || hostsBootVolume(device))
|
||||
continue;
|
||||
UsbDrive d;
|
||||
d.id = std::to_string(device.ID());
|
||||
d.device = path.Path();
|
||||
d.size = static_cast<std::uint64_t>(device.Size());
|
||||
if (device.Name() != nullptr)
|
||||
d.model = device.Name();
|
||||
forEachPartition(&device, [&](BPartition* p) {
|
||||
if (d.label.empty() && p->ContentType() != nullptr)
|
||||
d.label = p->ContentName().String();
|
||||
BPath mp;
|
||||
if (p->IsMounted() && p->GetMountPoint(&mp) == B_OK)
|
||||
d.mountPoints.emplace_back(mp.Path());
|
||||
});
|
||||
out.push_back(std::move(d));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
fs::path formatFat32(const UsbDrive& drive, const std::string& label) override
|
||||
{
|
||||
const partition_id id = parseId(drive.id);
|
||||
BDiskDeviceRoster roster;
|
||||
BDiskDevice device;
|
||||
status_t s = roster.GetDeviceWithID(id, &device);
|
||||
if (s != B_OK)
|
||||
fail("USB drive " + drive.device + " not found", s);
|
||||
BPath path;
|
||||
if (device.GetPath(&path) != B_OK || !startsWith(path.Path(), "/dev/disk/usb/") || hostsBootVolume(device))
|
||||
throw UsbError(UsbError::Kind::Failed, drive.device + " is not a removable USB drive");
|
||||
|
||||
trace("unmount");
|
||||
unmountAll(device);
|
||||
|
||||
const bool hasMbr = device.ContentType() != nullptr && std::strcmp(device.ContentType(), kPartitionTypeIntel) == 0;
|
||||
trace(std::string("content type: ") + (device.ContentType() != nullptr ? device.ContentType() : "(none)"));
|
||||
if (device.ContentType() != nullptr && !hasMbr) {
|
||||
// Other content (GPT, a file system without partition table...): erase it in its own
|
||||
// transaction. Uninitialize + Initialize in one transaction hangs the disk device
|
||||
// manager on Haiku R1/beta6.
|
||||
if ((s = device.PrepareModifications()) != B_OK)
|
||||
fail("cannot modify " + drive.device, s);
|
||||
if ((s = device.Uninitialize()) != B_OK || (s = device.CommitModifications()) != B_OK) {
|
||||
device.CancelModifications();
|
||||
fail("cannot erase " + drive.device, s);
|
||||
}
|
||||
if ((s = roster.GetDeviceWithID(id, &device)) != B_OK)
|
||||
fail("USB drive " + drive.device + " not found", s);
|
||||
}
|
||||
|
||||
if (hasMbr && device.CountChildren() > 0) {
|
||||
// Keep the existing MBR and drop its partitions (Uninitialize would hang, see above).
|
||||
// Own transaction too: freed space is not reusable within the same transaction.
|
||||
if ((s = device.PrepareModifications()) != B_OK)
|
||||
fail("cannot modify " + drive.device, s);
|
||||
for (int32 i = device.CountChildren() - 1; i >= 0 && s == B_OK; --i) {
|
||||
trace("delete partition " + std::to_string(i));
|
||||
s = device.DeleteChild(i);
|
||||
}
|
||||
if (s != B_OK || (s = device.CommitModifications()) != B_OK) {
|
||||
device.CancelModifications();
|
||||
fail("cannot delete the existing partitions", s);
|
||||
}
|
||||
if ((s = roster.GetDeviceWithID(id, &device)) != B_OK)
|
||||
fail("USB drive " + drive.device + " not found", s);
|
||||
}
|
||||
|
||||
trace("prepare modifications");
|
||||
if ((s = device.PrepareModifications()) != B_OK)
|
||||
fail("cannot modify " + drive.device, s);
|
||||
try {
|
||||
if (!hasMbr) {
|
||||
trace("initialize intel");
|
||||
if ((s = initialize(&device, "intel", kPartitionTypeIntel, nullptr, nullptr)) != B_OK)
|
||||
fail("cannot create the MBR partition table", s);
|
||||
}
|
||||
|
||||
off_t start = kPartitionOffset;
|
||||
off_t size = device.Size() - start;
|
||||
BString name;
|
||||
if ((s = device.ValidateCreateChild(&start, &size, kMbrTypeFat32Lba, &name, kMbrChildParameters)) != B_OK)
|
||||
fail("cannot create the FAT32 partition", s);
|
||||
trace("create child at " + std::to_string(start) + " size " + std::to_string(size));
|
||||
if ((s = device.CreateChild(start, size, kMbrTypeFat32Lba, nullptr, kMbrChildParameters)) != B_OK)
|
||||
fail("cannot create the FAT32 partition", s);
|
||||
trace("commit partition table");
|
||||
if ((s = device.CommitModifications()) != B_OK)
|
||||
fail("cannot write the partition table to " + drive.device, s);
|
||||
} catch (...) {
|
||||
device.CancelModifications();
|
||||
throw;
|
||||
}
|
||||
|
||||
// Format in a separate transaction: initializing a partition created in the same
|
||||
// transaction fails when the job runs ("Invalid Argument").
|
||||
if ((s = roster.GetDeviceWithID(id, &device)) != B_OK || device.CountChildren() == 0)
|
||||
fail("the new partition is not visible", s != B_OK ? s : B_ENTRY_NOT_FOUND);
|
||||
if ((s = device.PrepareModifications()) != B_OK)
|
||||
fail("cannot modify " + drive.device, s);
|
||||
try {
|
||||
trace("initialize fat");
|
||||
// No parameters: the FAT driver picks FAT32 for volumes this size (checked by the e2e test).
|
||||
if ((s = initialize(device.ChildAt(0), "fat", "FAT32 File System", label.c_str(), nullptr)) != B_OK)
|
||||
fail("cannot format the FAT32 partition", s);
|
||||
trace("commit format");
|
||||
if ((s = device.CommitModifications()) != B_OK)
|
||||
fail("cannot format " + drive.device, s);
|
||||
} catch (...) {
|
||||
device.CancelModifications();
|
||||
throw;
|
||||
}
|
||||
|
||||
// Mount the new file system (re-read the device: the committed state is a new snapshot).
|
||||
if ((s = roster.GetDeviceWithID(id, &device)) != B_OK || device.CountChildren() == 0)
|
||||
fail("the new partition is not visible", s != B_OK ? s : B_ENTRY_NOT_FOUND);
|
||||
BPartition* part = device.ChildAt(0);
|
||||
if (!part->IsMounted() && (s = part->Mount()) != B_OK)
|
||||
fail("cannot mount the new file system", s);
|
||||
BPath mountPoint;
|
||||
if ((s = part->GetMountPoint(&mountPoint)) != B_OK)
|
||||
fail("cannot locate the mount point", s);
|
||||
return mountPoint.Path();
|
||||
}
|
||||
|
||||
void eject(const UsbDrive& drive) override
|
||||
{
|
||||
BDiskDeviceRoster roster;
|
||||
BDiskDevice device;
|
||||
if (roster.GetDeviceWithID(parseId(drive.id), &device) != B_OK)
|
||||
return; // already gone
|
||||
unmountAll(device); // flushes the FAT
|
||||
// Not every USB mass-storage device supports the eject command; unmounting is enough then.
|
||||
(void)device.Eject(true);
|
||||
}
|
||||
|
||||
private:
|
||||
static void unmountAll(BDiskDevice& device)
|
||||
{
|
||||
status_t failure = B_OK;
|
||||
forEachPartition(&device, [&](BPartition* p) {
|
||||
if (p->IsMounted()) {
|
||||
const status_t s = p->Unmount();
|
||||
if (s != B_OK)
|
||||
failure = s;
|
||||
}
|
||||
});
|
||||
if (failure != B_OK)
|
||||
throw UsbError(UsbError::Kind::Busy, "cannot unmount the USB drive: " + statusText(failure));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
std::unique_ptr<UsbBackend> makeUsbBackend()
|
||||
{
|
||||
return std::make_unique<HaikuUsbBackend>();
|
||||
}
|
||||
|
||||
} // namespace openpu
|
||||
@@ -9,9 +9,26 @@ add_executable(openpu
|
||||
target_link_libraries(openpu PRIVATE openpu_core PkgConfig::GTKMM openpu_warnings)
|
||||
target_compile_definitions(openpu PRIVATE
|
||||
GETTEXT_PACKAGE="openpu"
|
||||
OPENPU_LOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}")
|
||||
OPENPU_LOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
|
||||
OPENPU_BUILD_ICONDIR="${CMAKE_BINARY_DIR}/icons")
|
||||
# gtkmm headers trigger -Wshadow/-Wconversion noise we cannot fix.
|
||||
target_compile_options(openpu PRIVATE -Wno-shadow -Wno-conversion)
|
||||
|
||||
install(TARGETS openpu RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(FILES io.github.openpu.OpenPU.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/data/io.github.openpu.OpenPU.metainfo.xml
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
|
||||
|
||||
# Application icon (data/icons, generated by tools/make_icons.py), installed in the hicolor theme
|
||||
# and mirrored in the build tree so that an uninstalled binary finds it too.
|
||||
set(OPENPU_ICON io.github.openpu.OpenPU)
|
||||
set(OPENPU_ICONS ${PROJECT_SOURCE_DIR}/data/icons)
|
||||
configure_file(${OPENPU_ICONS}/openpu.svg ${CMAKE_BINARY_DIR}/icons/hicolor/scalable/apps/${OPENPU_ICON}.svg COPYONLY)
|
||||
install(FILES ${OPENPU_ICONS}/openpu.svg
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps RENAME ${OPENPU_ICON}.svg)
|
||||
foreach(size 16 24 32 48 64 128 256 512)
|
||||
configure_file(${OPENPU_ICONS}/png/openpu-${size}.png
|
||||
${CMAKE_BINARY_DIR}/icons/hicolor/${size}x${size}/apps/${OPENPU_ICON}.png COPYONLY)
|
||||
install(FILES ${OPENPU_ICONS}/png/openpu-${size}.png
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${size}x${size}/apps RENAME ${OPENPU_ICON}.png)
|
||||
endforeach()
|
||||
@@ -5,9 +5,32 @@
|
||||
|
||||
#include <clocale>
|
||||
#include <cstdlib>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <system_error>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <gtkmm/application.h>
|
||||
|
||||
namespace {
|
||||
|
||||
/// Translations directory: OPENPU_LOCALEDIR (build tree), else <prefix>/share/locale next to the
|
||||
/// executable when it exists (relocatable installs such as the AppImage), else the configured one.
|
||||
std::string localeDir()
|
||||
{
|
||||
if (const char* dir = std::getenv("OPENPU_LOCALEDIR")) // NOLINT(concurrency-mt-unsafe): no thread yet
|
||||
return dir;
|
||||
std::error_code ec;
|
||||
const auto exe = std::filesystem::read_symlink("/proc/self/exe", ec);
|
||||
if (!ec) {
|
||||
const auto dir = exe.parent_path().parent_path() / "share" / "locale";
|
||||
if (std::filesystem::is_directory(dir, ec))
|
||||
return dir.string();
|
||||
}
|
||||
return OPENPU_LOCALEDIR;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
// A language chosen in the settings overrides the session language (gettext reads LANGUAGE).
|
||||
@@ -19,9 +42,7 @@ int main(int argc, char* argv[])
|
||||
// dismissed: the window reports unreadable settings itself
|
||||
}
|
||||
(void)std::setlocale(LC_ALL, ""); // NOLINT(concurrency-mt-unsafe): no thread yet
|
||||
// OPENPU_LOCALEDIR lets a build-tree binary find its translations.
|
||||
const char* localeDir = std::getenv("OPENPU_LOCALEDIR"); // NOLINT(concurrency-mt-unsafe)
|
||||
bindtextdomain(GETTEXT_PACKAGE, localeDir != nullptr ? localeDir : OPENPU_LOCALEDIR);
|
||||
bindtextdomain(GETTEXT_PACKAGE, localeDir().c_str());
|
||||
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
|
||||
textdomain(GETTEXT_PACKAGE);
|
||||
|
||||
|
||||
@@ -94,6 +94,11 @@ MainWindow::MainWindow()
|
||||
{
|
||||
set_title("OpenPU");
|
||||
set_default_size(640, 520);
|
||||
// Installed icon from the hicolor theme; the build tree has a copy for uninstalled runs.
|
||||
auto theme = Gtk::IconTheme::get_for_display(get_display());
|
||||
if (!theme->has_icon("io.github.openpu.OpenPU"))
|
||||
theme->add_search_path(OPENPU_BUILD_ICONDIR);
|
||||
set_icon_name("io.github.openpu.OpenPU");
|
||||
|
||||
try {
|
||||
store_.load();
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
include(GNUInstallDirs)
|
||||
|
||||
add_executable(OpenPU
|
||||
main.cpp
|
||||
main_window.cpp
|
||||
)
|
||||
find_library(INTL_LIBRARY intl)
|
||||
target_link_libraries(OpenPU PRIVATE openpu_core openpu_warnings be tracker shared
|
||||
$<$<BOOL:${INTL_LIBRARY}>:${INTL_LIBRARY}>)
|
||||
target_compile_definitions(OpenPU PRIVATE
|
||||
GETTEXT_PACKAGE="openpu"
|
||||
OPENPU_LOCALEDIR="${CMAKE_INSTALL_PREFIX}/data/locale")
|
||||
# BeAPI headers trigger -Wshadow/-Wconversion noise we cannot fix.
|
||||
target_compile_options(OpenPU PRIVATE -Wno-shadow -Wno-conversion)
|
||||
|
||||
# Application resources: signature, version, flags (Haiku rc + xres).
|
||||
# The vector icon (data/icons/openpu.hvif, generated by tools/make_icons.py) is embedded as hex.
|
||||
set(OPENPU_HVIF ${PROJECT_SOURCE_DIR}/data/icons/openpu.hvif)
|
||||
file(READ ${OPENPU_HVIF} OPENPU_HVIF_HEX HEX)
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${OPENPU_HVIF})
|
||||
configure_file(OpenPU.rdef.in ${CMAKE_CURRENT_BINARY_DIR}/OpenPU.rdef @ONLY)
|
||||
find_program(HAIKU_RC rc)
|
||||
find_program(HAIKU_XRES xres)
|
||||
find_program(HAIKU_MIMESET mimeset)
|
||||
if(HAIKU_RC AND HAIKU_XRES)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/OpenPU.rsrc
|
||||
COMMAND ${HAIKU_RC} -o ${CMAKE_CURRENT_BINARY_DIR}/OpenPU.rsrc ${CMAKE_CURRENT_BINARY_DIR}/OpenPU.rdef
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/OpenPU.rdef)
|
||||
add_custom_target(OpenPU_rsrc DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/OpenPU.rsrc)
|
||||
add_dependencies(OpenPU OpenPU_rsrc)
|
||||
# Relink (and so re-attach the resources) when only the resources change.
|
||||
set_target_properties(OpenPU PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/OpenPU.rsrc)
|
||||
add_custom_command(TARGET OpenPU POST_BUILD
|
||||
COMMAND ${HAIKU_XRES} -o $<TARGET_FILE:OpenPU> ${CMAKE_CURRENT_BINARY_DIR}/OpenPU.rsrc
|
||||
COMMAND ${HAIKU_MIMESET} -f $<TARGET_FILE:OpenPU>)
|
||||
endif()
|
||||
|
||||
# Haiku package layout: the application in apps/, a link in the Deskbar's Applications menu.
|
||||
install(TARGETS OpenPU RUNTIME DESTINATION apps)
|
||||
if(HAIKU_RC AND HAIKU_XRES)
|
||||
# `cmake --install --strip` rewrites the ELF file and drops the appended resources (icon,
|
||||
# signature, version): attach them again to the installed copy.
|
||||
install(CODE "
|
||||
set(app \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/apps/OpenPU\")
|
||||
execute_process(COMMAND ${HAIKU_XRES} -o \"\${app}\" ${CMAKE_CURRENT_BINARY_DIR}/OpenPU.rsrc
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
execute_process(COMMAND ${HAIKU_MIMESET} -f \"\${app}\")
|
||||
")
|
||||
endif()
|
||||
install(CODE "
|
||||
set(menu \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/data/deskbar/menu/Applications\")
|
||||
file(MAKE_DIRECTORY \"\${menu}\")
|
||||
file(CREATE_LINK ../../../../apps/OpenPU \"\${menu}/OpenPU\" SYMBOLIC)
|
||||
")
|
||||
@@ -0,0 +1,17 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
resource app_signature "application/x-vnd.openpu-OpenPU";
|
||||
|
||||
resource app_flags B_SINGLE_LAUNCH;
|
||||
|
||||
resource vector_icon $"@OPENPU_HVIF_HEX@";
|
||||
|
||||
resource app_version {
|
||||
major = @PROJECT_VERSION_MAJOR@,
|
||||
middle = @PROJECT_VERSION_MINOR@,
|
||||
minor = @PROJECT_VERSION_PATCH@,
|
||||
variety = B_APPV_FINAL,
|
||||
internal = 0,
|
||||
short_info = "OpenPU @PROJECT_VERSION@",
|
||||
long_info = "OpenPU @PROJECT_VERSION@ - Peugeot head unit updates on a USB stick. MIT license."
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
|
||||
// gettext, with the same message catalogs as the GTK interface (po/).
|
||||
#include <libintl.h>
|
||||
|
||||
#include <initializer_list>
|
||||
#include <string>
|
||||
|
||||
#define _(text) gettext(text)
|
||||
|
||||
namespace openpu::haiku {
|
||||
|
||||
/// Replaces %1..%9 in `format` (same placeholders as Glib::ustring::compose, so the translations
|
||||
/// are shared with the GTK interface).
|
||||
inline std::string compose(const std::string& format, std::initializer_list<std::string> args)
|
||||
{
|
||||
std::string out;
|
||||
out.reserve(format.size());
|
||||
for (std::size_t i = 0; i < format.size(); ++i) {
|
||||
const char c = format[i];
|
||||
if (c == '%' && i + 1 < format.size() && format[i + 1] >= '1' && format[i + 1] <= '9') {
|
||||
const auto index = static_cast<std::size_t>(format[i + 1] - '1');
|
||||
if (index < args.size())
|
||||
out += *(args.begin() + index);
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
out.push_back(c);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
} // namespace openpu::haiku
|
||||
@@ -0,0 +1,88 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
#include "main_window.hpp"
|
||||
|
||||
#include "openpu/storage.hpp"
|
||||
|
||||
#include <Application.h>
|
||||
#include <LocaleRoster.h>
|
||||
#include <Message.h>
|
||||
#include <Path.h>
|
||||
#include <PathFinder.h>
|
||||
|
||||
#include "i18n.hpp"
|
||||
|
||||
#include <cctype>
|
||||
#include <clocale>
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr const char* kSignature = "application/x-vnd.openpu-OpenPU";
|
||||
|
||||
/// First preferred language of the Locale preferences ("fr", "en_US"...), empty if unknown.
|
||||
std::string preferredLanguage()
|
||||
{
|
||||
BMessage languages;
|
||||
if (BLocaleRoster::Default()->GetPreferredLanguages(&languages) != B_OK)
|
||||
return {};
|
||||
const char* language = nullptr;
|
||||
if (languages.FindString("language", 0, &language) != B_OK || language == nullptr)
|
||||
return {};
|
||||
return language;
|
||||
}
|
||||
|
||||
/// Translations directory: OPENPU_LOCALEDIR (build tree), else data/locale of the installation
|
||||
/// location holding the application (system or user packages), else the configured one.
|
||||
std::string localeDir()
|
||||
{
|
||||
if (const char* dir = std::getenv("OPENPU_LOCALEDIR")) // NOLINT(concurrency-mt-unsafe): no thread yet
|
||||
return dir;
|
||||
BPath path;
|
||||
if (BPathFinder().FindPath(B_FIND_PATH_DATA_DIRECTORY, "locale", B_FIND_PATH_EXISTING_ONLY, path) == B_OK)
|
||||
return path.Path();
|
||||
return OPENPU_LOCALEDIR;
|
||||
}
|
||||
|
||||
class App : public BApplication {
|
||||
public:
|
||||
explicit App(std::string language) : BApplication(kSignature), language_(std::move(language)) {}
|
||||
|
||||
void ReadyToRun() override { (new openpu::haiku::MainWindow(language_))->Show(); }
|
||||
|
||||
private:
|
||||
std::string language_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
int main()
|
||||
{
|
||||
// A language chosen in the settings overrides the one of the Locale preferences.
|
||||
std::string language;
|
||||
try {
|
||||
language = openpu::Settings::load(openpu::paths::configDir() / "config.json").language;
|
||||
} catch (const openpu::StorageError&) {
|
||||
// dismissed: the window reports unreadable settings itself
|
||||
}
|
||||
if (language.empty())
|
||||
language = preferredLanguage();
|
||||
if (language.empty())
|
||||
language = "en";
|
||||
|
||||
// gettext follows LANGUAGE, but only when the message locale is not "C".
|
||||
(void)setenv("LANGUAGE", language.c_str(), 1); // NOLINT(concurrency-mt-unsafe): no thread yet
|
||||
(void)setenv("LC_MESSAGES", "en_US.UTF-8", 0); // NOLINT(concurrency-mt-unsafe)
|
||||
(void)std::setlocale(LC_ALL, ""); // NOLINT(concurrency-mt-unsafe)
|
||||
bindtextdomain(GETTEXT_PACKAGE, localeDir().c_str());
|
||||
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
|
||||
textdomain(GETTEXT_PACKAGE);
|
||||
|
||||
std::string twoLetters;
|
||||
for (char c : language.substr(0, 2))
|
||||
twoLetters.push_back(static_cast<char>(std::tolower(static_cast<unsigned char>(c))));
|
||||
|
||||
App app(twoLetters);
|
||||
app.Run();
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
|
||||
#include "ui_queue.hpp"
|
||||
|
||||
#include "openpu/api_client.hpp"
|
||||
#include "openpu/app_update.hpp"
|
||||
#include "openpu/job.hpp"
|
||||
#include "openpu/storage.hpp"
|
||||
#include "openpu/usb.hpp"
|
||||
|
||||
#include <Messenger.h>
|
||||
#include <Window.h>
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
class BButton;
|
||||
class BCardView;
|
||||
class BCheckBox;
|
||||
class BFilePanel;
|
||||
class BListView;
|
||||
class BMenuField;
|
||||
class BPopUpMenu;
|
||||
class BStatusBar;
|
||||
class BStringView;
|
||||
class BTextControl;
|
||||
class BTextView;
|
||||
class BView;
|
||||
|
||||
namespace openpu::haiku {
|
||||
|
||||
/// Messages shared with the preferences window.
|
||||
enum : uint32 {
|
||||
kMsgChooseFolder = 'chfd', ///< main window: open the folder panel
|
||||
kMsgSetLanguage = 'slng', ///< main window: "language" (string, empty = system)
|
||||
kMsgSetAutoCheck = 'sach', ///< main window: "value" (bool)
|
||||
kMsgFolderChanged = 'fdch',///< preferences window: "path" (string)
|
||||
};
|
||||
|
||||
class MainWindow : public BWindow {
|
||||
public:
|
||||
/// `language`: two-letter language of the interface (for the guide links).
|
||||
explicit MainWindow(std::string language);
|
||||
~MainWindow() override;
|
||||
MainWindow(const MainWindow&) = delete;
|
||||
MainWindow& operator=(const MainWindow&) = delete;
|
||||
|
||||
void MessageReceived(BMessage* message) override;
|
||||
bool QuitRequested() override;
|
||||
|
||||
private:
|
||||
enum Page : int32 { Vehicles, Add, Updates, Download, Usb, Write, Done };
|
||||
|
||||
// pages
|
||||
BView* buildVehiclesPage();
|
||||
BView* buildAddPage();
|
||||
BView* buildUpdatesPage();
|
||||
BView* buildDownloadPage();
|
||||
BView* buildUsbPage();
|
||||
BView* buildWritePage();
|
||||
BView* buildDonePage();
|
||||
void show(Page page);
|
||||
|
||||
// vehicles
|
||||
void refreshVehicles();
|
||||
std::optional<Vehicle> selectedVehicle() const;
|
||||
void onVehicleSelected();
|
||||
void onAddVehicle();
|
||||
void onRemoveVehicle();
|
||||
void onCheckUpdates();
|
||||
|
||||
// updates / download
|
||||
void showUpdates(const AvailableUpdates& updates);
|
||||
void updateDownloadButton();
|
||||
void onChooseFolder();
|
||||
void onFolderChosen(BMessage* message);
|
||||
void onStartDownload();
|
||||
void startDownload(const DownloadPlan& plan);
|
||||
void onDownloadProgress(const JobProgress& p);
|
||||
void onDownloaded(const DownloadedFiles& files);
|
||||
|
||||
// usb
|
||||
void enterUsbPage();
|
||||
void refreshDrives();
|
||||
void onDriveSelected();
|
||||
void onPrepareUsb();
|
||||
void startWrite(const UsbDrive& drive);
|
||||
void onWriteProgress(const UsbProgress& p);
|
||||
void onWritten();
|
||||
|
||||
// helpers
|
||||
template <typename F>
|
||||
void runAsync(F&& work);
|
||||
void joinWorker();
|
||||
void showError(const std::string& title, const std::string& detail);
|
||||
void showAbout();
|
||||
void showPreferences();
|
||||
void openGuide();
|
||||
void checkAppUpdate(bool manual);
|
||||
void offerAppUpdate(const AppRelease& release);
|
||||
void saveVehicles();
|
||||
void saveSettings();
|
||||
void updateDownloadDirLabel();
|
||||
|
||||
UiQueue ui_;
|
||||
std::string language_;
|
||||
std::unique_ptr<Transport> transport_;
|
||||
std::unique_ptr<ApiClient> api_;
|
||||
std::unique_ptr<UsbBackend> usb_;
|
||||
VehicleStore store_;
|
||||
Settings settings_;
|
||||
std::filesystem::path settingsFile_;
|
||||
std::thread worker_;
|
||||
std::thread updateThread_; // OpenPU new-version check, independent of the main flow
|
||||
bool updateCheckRunning_ = false;
|
||||
CancelToken cancel_;
|
||||
BMessenger preferences_;
|
||||
BFilePanel* folderPanel_ = nullptr;
|
||||
|
||||
// flow state
|
||||
std::optional<Vehicle> current_;
|
||||
AvailableUpdates updates_;
|
||||
DownloadedFiles files_;
|
||||
std::vector<UsbDrive> drives_;
|
||||
std::int32_t selectedDrive_ = -1;
|
||||
std::uint64_t payload_ = 0;
|
||||
|
||||
// widgets
|
||||
BCardView* cards_ = nullptr;
|
||||
|
||||
BListView* vehicleList_ = nullptr;
|
||||
BTextView* vehiclesEmpty_ = nullptr;
|
||||
BButton *removeButton_ = nullptr, *checkButton_ = nullptr;
|
||||
|
||||
BTextControl *vinEntry_ = nullptr, *nameEntry_ = nullptr;
|
||||
BStringView* addStatus_ = nullptr;
|
||||
BButton* addConfirm_ = nullptr;
|
||||
|
||||
BStringView* updatesTitle_ = nullptr;
|
||||
BTextView* updatesStatus_ = nullptr;
|
||||
BCheckBox *firmwareCheck_ = nullptr, *mapCheck_ = nullptr;
|
||||
BStringView* downloadDirLabel_ = nullptr;
|
||||
BButton *downloadButton_ = nullptr, *guideButton_ = nullptr;
|
||||
|
||||
BStringView* licenseLabel_ = nullptr;
|
||||
BStatusBar *firmwareBar_ = nullptr, *mapBar_ = nullptr;
|
||||
BStringView* etaLabel_ = nullptr;
|
||||
BButton* cancelDownload_ = nullptr;
|
||||
|
||||
BTextView* usbInfo_ = nullptr;
|
||||
BPopUpMenu* driveMenu_ = nullptr;
|
||||
BMenuField* driveField_ = nullptr;
|
||||
BStringView* usbStatus_ = nullptr;
|
||||
BButton* prepareButton_ = nullptr;
|
||||
|
||||
BStatusBar* writeBar_ = nullptr;
|
||||
BStringView* writeDetail_ = nullptr;
|
||||
BButton* cancelWrite_ = nullptr;
|
||||
|
||||
BButton* doneButton_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace openpu::haiku
|
||||
@@ -0,0 +1,55 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
|
||||
#include <Messenger.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <deque>
|
||||
#include <functional>
|
||||
#include <mutex>
|
||||
|
||||
namespace openpu::haiku {
|
||||
|
||||
/// Runs closures posted from worker threads on a window's thread.
|
||||
/// post() never blocks: a single kMessage is in flight at a time and drain() runs everything queued.
|
||||
class UiQueue {
|
||||
public:
|
||||
static constexpr uint32 kMessage = 'uiqd';
|
||||
|
||||
void setTarget(const BMessenger& target) { target_ = target; }
|
||||
|
||||
void post(std::function<void()> fn)
|
||||
{
|
||||
{
|
||||
std::scoped_lock lock(mutex_);
|
||||
queue_.push_back(std::move(fn));
|
||||
}
|
||||
if (!pending_.exchange(true)) {
|
||||
BMessage message(kMessage);
|
||||
// Zero timeout: a worker must never wait for the window (it may be joining the worker).
|
||||
if (target_.SendMessage(&message, static_cast<BHandler*>(nullptr), 0) != B_OK)
|
||||
pending_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// Called by the target window when it receives kMessage.
|
||||
void drain()
|
||||
{
|
||||
pending_ = false;
|
||||
std::deque<std::function<void()>> local;
|
||||
{
|
||||
std::scoped_lock lock(mutex_);
|
||||
local.swap(queue_);
|
||||
}
|
||||
for (auto& fn : local)
|
||||
fn();
|
||||
}
|
||||
|
||||
private:
|
||||
BMessenger target_;
|
||||
std::atomic<bool> pending_{false};
|
||||
std::mutex mutex_;
|
||||
std::deque<std::function<void()>> queue_;
|
||||
};
|
||||
|
||||
} // namespace openpu::haiku
|
||||
@@ -16,6 +16,9 @@ find_package(LibArchive REQUIRED)
|
||||
target_link_libraries(openpu_tests PRIVATE openpu_core openpu_warnings LibArchive::LibArchive)
|
||||
if(TARGET doctest::doctest)
|
||||
target_link_libraries(openpu_tests PRIVATE doctest::doctest)
|
||||
else()
|
||||
# Bundled single header (third_party/doctest, MIT) when the system has no doctest package.
|
||||
target_include_directories(openpu_tests SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/third_party)
|
||||
endif()
|
||||
target_compile_definitions(openpu_tests PRIVATE OPENPU_FIXTURES_DIR="${CMAKE_CURRENT_SOURCE_DIR}/fixtures")
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016-2023 Viktor Kirilov
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,2 @@
|
||||
doctest 2.4.12 single header (https://github.com/doctest/doctest), MIT license.
|
||||
Used by the unit tests only when no system doctest package is found (e.g. Haiku).
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Builds OpenPU-<version>-<arch>.AppImage (GTK interface + openpu-cli) with linuxdeploy and its GTK
|
||||
# plugin, in the current directory. Runs on x86_64 and aarch64; no FUSE needed.
|
||||
#
|
||||
# usage: tools/appimage.sh [build-dir]
|
||||
# The linuxdeploy tools are downloaded once into $OPENPU_APPIMAGE_TOOLS (default ~/.cache/openpu-appimage).
|
||||
set -eu
|
||||
|
||||
SRC=$(cd "$(dirname "$0")/.." && pwd)
|
||||
BUILD=${1:-$SRC/../build-openpu/appimage}
|
||||
OUT=$(pwd)
|
||||
ARCH=$(uname -m)
|
||||
TOOLS=${OPENPU_APPIMAGE_TOOLS:-$HOME/.cache/openpu-appimage}
|
||||
LINUXDEPLOY=$TOOLS/linuxdeploy-$ARCH.AppImage
|
||||
GTK_PLUGIN=$TOOLS/linuxdeploy-plugin-gtk.sh
|
||||
|
||||
mkdir -p "$TOOLS"
|
||||
fetch() { # url file
|
||||
[ -s "$2" ] || { curl -fsSL -o "$2.part" "$1" && mv "$2.part" "$2"; }
|
||||
chmod +x "$2"
|
||||
}
|
||||
fetch "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$ARCH.AppImage" "$LINUXDEPLOY"
|
||||
fetch "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" "$GTK_PLUGIN"
|
||||
|
||||
cmake -S "$SRC" -B "$BUILD" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DOPENPU_UI_GTK=ON -DOPENPU_BUILD_TESTS=OFF
|
||||
cmake --build "$BUILD"
|
||||
APPDIR=$BUILD/AppDir
|
||||
rm -rf "$APPDIR"
|
||||
DESTDIR=$APPDIR cmake --install "$BUILD" --strip
|
||||
|
||||
VERSION=$("$APPDIR/usr/bin/openpu-cli" --version | awk '{print $2}')
|
||||
ID=io.github.openpu.OpenPU
|
||||
cd "$OUT"
|
||||
# linuxdeploy finds its plugins next to itself or in PATH.
|
||||
PATH=$TOOLS:$PATH APPIMAGE_EXTRACT_AND_RUN=1 DEPLOY_GTK_VERSION=4 LINUXDEPLOY_OUTPUT_VERSION=$VERSION \
|
||||
"$LINUXDEPLOY" --appdir "$APPDIR" --plugin gtk --output appimage \
|
||||
--executable "$APPDIR/usr/bin/openpu" --executable "$APPDIR/usr/bin/openpu-cli" \
|
||||
--desktop-file "$APPDIR/usr/share/applications/$ID.desktop" \
|
||||
--icon-file "$APPDIR/usr/share/icons/hicolor/256x256/apps/$ID.png"
|
||||
ls -l "$OUT"/OpenPU-*.AppImage
|
||||
@@ -28,7 +28,8 @@ fi
|
||||
if command -v clang-tidy >/dev/null; then
|
||||
step "clang-tidy"
|
||||
# Only our sources; compile_commands.json comes from the debug build.
|
||||
find "$SRC/src" -name '*.cpp' -not -path '*/ui-*' -print0 |
|
||||
# Only files of this build: usb_haiku.cpp / usb_none.cpp are not compiled on Linux.
|
||||
find "$SRC/src" -name '*.cpp' -not -path '*/ui-*' -not -name 'usb_haiku.cpp' -not -name 'usb_none.cpp' -print0 |
|
||||
xargs -0 clang-tidy -p "$OUT/debug" --quiet --warnings-as-errors='*'
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Builds openpu-<version>-1-x86_64.hpkg on Haiku from the working tree: release build, staged
|
||||
# install (apps/OpenPU, bin/openpu-cli, data/locale, Deskbar link), .PackageInfo, `package create`.
|
||||
# The HaikuPorts recipe (packaging/haiku) is the way to publish; this script is for testing and
|
||||
# for attaching a package to a GitHub release.
|
||||
#
|
||||
# usage: tools/haiku-package.sh [build-dir] (output in the current directory)
|
||||
set -eu
|
||||
|
||||
SRC=$(cd "$(dirname "$0")/.." && pwd)
|
||||
BUILD=${1:-$SRC/../build-openpu/hpkg}
|
||||
OUT=$(pwd)
|
||||
ARCH=$(getarch)
|
||||
STAGE=$BUILD/stage
|
||||
|
||||
cmake -S "$SRC" -B "$BUILD" -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/boot/system \
|
||||
-DOPENPU_BUILD_TESTS=OFF
|
||||
cmake --build "$BUILD"
|
||||
rm -rf "$STAGE"
|
||||
# Files are staged relative to the installation location (the package's root).
|
||||
cmake --install "$BUILD" --strip --prefix "$STAGE"
|
||||
|
||||
# Package versions cannot contain '+' or '.' after the micro number: a development build
|
||||
# 0.2.0+3.gabc1234.dirty becomes 0.2.0_git3_gabc1234_dirty; a tagged build stays 0.2.0.
|
||||
DESCRIPTION=$("$STAGE/bin/openpu-cli" --version | awk '{print $2}')
|
||||
VERSION=$(echo "$DESCRIPTION" | sed -e 's/+/_git/' -e 's/\./_/3g')
|
||||
|
||||
cat > "$STAGE/.PackageInfo" <<EOF
|
||||
name openpu
|
||||
version $VERSION-1
|
||||
architecture $ARCH
|
||||
summary "Download Peugeot head unit updates and prepare the USB stick"
|
||||
description "OpenPU downloads the firmware and navigation map updates of Peugeot \\
|
||||
head units (NAC, RCC, AIO, Crony) and prepares the installation USB stick: FAT32 formatting, \\
|
||||
license and update files. Downloads resume where they stopped. Graphical application and \\
|
||||
command-line tool (openpu-cli). Independent project, not affiliated with Stellantis or Peugeot."
|
||||
packager "OpenPU contributors <https://github.com/yann64/openpu>"
|
||||
vendor "OpenPU contributors"
|
||||
licenses { "MIT" }
|
||||
copyrights { "2026 yann64 and the OpenPU contributors" }
|
||||
urls { "https://github.com/yann64/openpu" }
|
||||
provides {
|
||||
openpu = $VERSION
|
||||
app:OpenPU = $VERSION
|
||||
cmd:openpu_cli = $VERSION
|
||||
}
|
||||
requires {
|
||||
haiku >= r1~beta6
|
||||
lib:libarchive >= 13
|
||||
lib:libcurl >= 4
|
||||
lib:libgcc_s >= 1
|
||||
lib:libintl >= 8
|
||||
lib:libstdc++
|
||||
}
|
||||
EOF
|
||||
|
||||
PACKAGE=$OUT/openpu-$VERSION-1-$ARCH.hpkg
|
||||
rm -f "$PACKAGE"
|
||||
package create -C "$STAGE" "$PACKAGE"
|
||||
package list "$PACKAGE"
|
||||
@@ -0,0 +1,88 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Haiku R1/beta6 x86_64 development VM under QEMU (Linux / WSL2, KVM when available).
|
||||
#
|
||||
# tools/haiku-vm.sh fetch download + verify the official anyboot image
|
||||
# tools/haiku-vm.sh install boot the image with an empty 20 GB disk (run the Installer, see docs)
|
||||
# tools/haiku-vm.sh start boot the installed system (headless, VNC on 127.0.0.1:5901)
|
||||
# tools/haiku-vm.sh stop ACPI power-off (hard kill after 60 s)
|
||||
# tools/haiku-vm.sh ssh [cmd] ssh into the VM (port 2222, user "user")
|
||||
# tools/haiku-vm.sh status
|
||||
#
|
||||
# A 16 GB sparse raw image is attached as a USB mass-storage device ("the stick"), so the
|
||||
# Haiku USB backend can be tested end to end; inspect it from Linux with mtools.
|
||||
# The VM is driven with tools/qmp.py (screenshots, clicks, typing) through $VM_DIR/qmp.sock.
|
||||
set -eu
|
||||
|
||||
VM_DIR=${OPENPU_VM_DIR:-$HOME/openpu-vm}
|
||||
RELEASE=r1beta6
|
||||
ISO=$VM_DIR/haiku-$RELEASE-x86_64-anyboot.iso
|
||||
ISO_SHA256=bb7743474fd175aea511be1799764ba054465285bbdf54c4722ca61d1fb4f5c9
|
||||
ISO_URL=https://mirrors.rit.edu/haiku/$RELEASE/haiku-$RELEASE-x86_64-anyboot.iso
|
||||
DISK=$VM_DIR/haiku.qcow2
|
||||
STICK=$VM_DIR/haiku-usb.img
|
||||
QMP=$VM_DIR/qmp.sock
|
||||
PIDFILE=$VM_DIR/qemu.pid
|
||||
SSH_PORT=${OPENPU_VM_SSH_PORT:-2222}
|
||||
|
||||
mkdir -p "$VM_DIR"
|
||||
|
||||
running() { [ -f "$PIDFILE" ] && kill -0 "$(cat "$PIDFILE")" 2>/dev/null; }
|
||||
|
||||
qemu() {
|
||||
accel="-accel tcg"
|
||||
[ -w /dev/kvm ] && accel="-accel kvm -cpu host"
|
||||
[ -f "$STICK" ] || truncate -s 16G "$STICK"
|
||||
# shellcheck disable=SC2086
|
||||
qemu-system-x86_64 $accel -machine q35 -smp 4 -m 4096 \
|
||||
-drive file="$DISK",format=qcow2,if=none,id=hd0 -device ide-hd,drive=hd0,bus=ide.0 \
|
||||
-nic user,model=e1000,hostfwd=tcp:127.0.0.1:"$SSH_PORT"-:22 \
|
||||
-device qemu-xhci,id=xhci -device usb-tablet,bus=xhci.0 \
|
||||
-drive file="$STICK",format=raw,if=none,id=stick \
|
||||
-device usb-storage,bus=xhci.0,drive=stick,removable=on \
|
||||
-display none -vnc 127.0.0.1:1 \
|
||||
-qmp unix:"$QMP",server=on,wait=off \
|
||||
-daemonize -pidfile "$PIDFILE" "$@"
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
fetch)
|
||||
[ -f "$ISO" ] || curl -fL -o "$ISO.part" "$ISO_URL" && { [ -f "$ISO" ] || mv "$ISO.part" "$ISO"; }
|
||||
echo "$ISO_SHA256 $ISO" | sha256sum -c -
|
||||
;;
|
||||
install)
|
||||
running && { echo "VM already running" >&2; exit 1; }
|
||||
[ -f "$DISK" ] || qemu-img create -f qcow2 "$DISK" 20G
|
||||
qemu -drive file="$ISO",media=cdrom,if=none,id=cd -device ide-cd,drive=cd,bus=ide.1 -boot d
|
||||
echo "installer booted (VNC 127.0.0.1:5901, QMP $QMP)"
|
||||
;;
|
||||
start)
|
||||
running && { echo "VM already running"; exit 0; }
|
||||
qemu -boot c
|
||||
echo "VM started (VNC 127.0.0.1:5901, ssh -p $SSH_PORT user@127.0.0.1)"
|
||||
;;
|
||||
stop)
|
||||
running || { echo "VM not running"; exit 0; }
|
||||
python3 "$(dirname "$0")/qmp.py" --socket "$QMP" powerdown || true
|
||||
for _ in $(seq 60); do running || { echo "stopped"; exit 0; }; sleep 1; done
|
||||
kill "$(cat "$PIDFILE")"; echo "killed"
|
||||
;;
|
||||
ssh)
|
||||
shift
|
||||
exec ssh -p "$SSH_PORT" -i "$VM_DIR/id_ed25519" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR \
|
||||
user@127.0.0.1 "$@"
|
||||
;;
|
||||
sync)
|
||||
# Copy the working tree (without .git) to ~/openpu in the VM.
|
||||
SRC=$(cd "$(dirname "$0")/.." && pwd)
|
||||
tar -C "$SRC" --exclude=.git -cf - . | "$0" ssh "mkdir -p openpu && tar -xf - -C openpu"
|
||||
echo "synced $SRC -> VM:~/openpu"
|
||||
;;
|
||||
status)
|
||||
running && echo "running (pid $(cat "$PIDFILE"))" || echo "stopped"
|
||||
;;
|
||||
*)
|
||||
sed -n '3,12p' "$0" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,369 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
"""Generates the OpenPU application icon (original artwork) in every format the project needs.
|
||||
|
||||
One description of the shapes (64x64 grid, the native grid of HVIF) produces:
|
||||
data/icons/openpu.svg master SVG
|
||||
data/icons/openpu-small.svg simplified variant for 16 and 24 px
|
||||
data/icons/openpu.hvif Haiku Vector Icon Format (embedded in the Haiku executable)
|
||||
data/icons/png/openpu-N.png PNG renderings, N in SIZES
|
||||
|
||||
Standard library only: the PNGs come from a small antialiased rasterizer below, so no SVG tool
|
||||
is required. Run from the repository root: python3 -I tools/make_icons.py
|
||||
"""
|
||||
import math
|
||||
import os
|
||||
import struct
|
||||
import sys
|
||||
import zlib
|
||||
|
||||
SIZES = (16, 24, 32, 48, 64, 128, 256, 512)
|
||||
SMALL_SIZES = (16, 24)
|
||||
|
||||
GRADIENT_TOP = (0x25, 0x63, 0xB8)
|
||||
GRADIENT_BOTTOM = (0x16, 0x3A, 0x6B)
|
||||
WHITE = (0xFF, 0xFF, 0xFF)
|
||||
ARROW = (0x8E, 0xC5, 0xFF)
|
||||
GRADIENT_Y = (4.0, 60.0) # vertical extent of the gradient, in icon units
|
||||
|
||||
# --- geometry ------------------------------------------------------------------------------------
|
||||
# A path is a closed list of points (x, y, in_handle, out_handle); a None handle means a straight
|
||||
# segment on that side. The segment from p[i] to p[i+1] uses p[i].out and p[i+1].in.
|
||||
|
||||
|
||||
def pt(x, y, hin=None, hout=None):
|
||||
return (x, y, hin, hout)
|
||||
|
||||
|
||||
def shield():
|
||||
return [
|
||||
pt(12, 4, hin=(9.8, 4)),
|
||||
pt(52, 4, hout=(54.2, 4)),
|
||||
pt(56, 8, hin=(56, 5.8)),
|
||||
pt(56, 34, hout=(56, 49)),
|
||||
pt(32, 61, hin=(45, 57), hout=(19, 57)),
|
||||
pt(8, 34, hin=(8, 49)),
|
||||
pt(8, 8, hout=(8, 5.8)),
|
||||
]
|
||||
|
||||
|
||||
def transform(path, fn):
|
||||
def f(h):
|
||||
return None if h is None else fn(*h)
|
||||
|
||||
return [(*fn(x, y), f(hin), f(hout)) for x, y, hin, hout in path]
|
||||
|
||||
|
||||
def scaled(path, s, cx=32.0, cy=32.5):
|
||||
return transform(path, lambda x, y: (cx + s * (x - cx), cy + s * (y - cy)))
|
||||
|
||||
|
||||
def moved(path, dx, dy):
|
||||
return transform(path, lambda x, y: (x + dx, y + dy))
|
||||
|
||||
|
||||
def letter_p():
|
||||
return [
|
||||
pt(16, 15),
|
||||
pt(24, 15, hout=(27.9, 15)),
|
||||
pt(30, 22, hin=(30, 18.1), hout=(30, 25.9)),
|
||||
pt(24, 29, hin=(27.9, 29)),
|
||||
pt(22, 29),
|
||||
pt(22, 37),
|
||||
pt(16, 37),
|
||||
]
|
||||
|
||||
|
||||
def letter_p_counter():
|
||||
return [
|
||||
pt(22, 20),
|
||||
pt(24, 20, hout=(25.1, 20)),
|
||||
pt(26, 22, hin=(26, 20.9), hout=(26, 23.1)),
|
||||
pt(24, 24, hin=(25.1, 24)),
|
||||
pt(22, 24),
|
||||
]
|
||||
|
||||
|
||||
def letter_u():
|
||||
return [
|
||||
pt(34, 15),
|
||||
pt(40, 15),
|
||||
pt(40, 29, hout=(40, 30.1)),
|
||||
pt(42, 31, hin=(40.9, 31), hout=(43.1, 31)),
|
||||
pt(44, 29, hin=(44, 30.1)),
|
||||
pt(44, 15),
|
||||
pt(50, 15),
|
||||
pt(50, 29, hout=(50, 33.4)),
|
||||
pt(42, 37, hin=(46.4, 37), hout=(37.6, 37)),
|
||||
pt(34, 29, hin=(34, 33.4)),
|
||||
]
|
||||
|
||||
|
||||
def arrow():
|
||||
return [pt(30, 41), pt(34, 41), pt(34, 47), pt(39, 47), pt(32, 54), pt(25, 47), pt(30, 47)]
|
||||
|
||||
|
||||
def layers(small):
|
||||
"""(style, path) pairs, painted in order. Holes are painted over with the background style,
|
||||
so every path is a simple filled outline (same result in SVG, HVIF and the rasterizer)."""
|
||||
dy = 4 if small else 0 # without the arrow, the letters move down to the optical centre
|
||||
letters = [
|
||||
("white", moved(letter_p(), -1, dy)),
|
||||
("gradient", moved(letter_p_counter(), -1, dy)),
|
||||
("white", moved(letter_u(), -1, dy)),
|
||||
]
|
||||
out = [("gradient", shield())]
|
||||
if not small:
|
||||
out += [("white", scaled(shield(), 0.90)), ("gradient", scaled(shield(), 0.86))]
|
||||
out += letters
|
||||
if not small:
|
||||
out.append(("arrow", arrow()))
|
||||
return out
|
||||
|
||||
|
||||
# --- SVG -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
def fmt(v):
|
||||
return ("%.2f" % v).rstrip("0").rstrip(".")
|
||||
|
||||
|
||||
def svg_path(path):
|
||||
x0, y0 = path[0][:2]
|
||||
d = ["M%s %s" % (fmt(x0), fmt(y0))]
|
||||
for i in range(len(path)):
|
||||
a, b = path[i], path[(i + 1) % len(path)]
|
||||
if a[3] is None and b[2] is None:
|
||||
if i + 1 < len(path):
|
||||
d.append("L%s %s" % (fmt(b[0]), fmt(b[1])))
|
||||
continue
|
||||
c1 = a[3] or a[:2]
|
||||
c2 = b[2] or b[:2]
|
||||
d.append("C%s %s %s %s %s %s" % (fmt(c1[0]), fmt(c1[1]), fmt(c2[0]), fmt(c2[1]), fmt(b[0]), fmt(b[1])))
|
||||
return " ".join(d) + "Z"
|
||||
|
||||
|
||||
def hexcolor(c):
|
||||
return "#%02x%02x%02x" % c
|
||||
|
||||
|
||||
def write_svg(file, small):
|
||||
fills = {"gradient": "url(#bg)", "white": hexcolor(WHITE), "arrow": hexcolor(ARROW)}
|
||||
lines = [
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">',
|
||||
" <title>OpenPU</title>",
|
||||
" <defs>",
|
||||
' <linearGradient id="bg" gradientUnits="userSpaceOnUse" x1="32" y1="%s" x2="32" y2="%s">'
|
||||
% (fmt(GRADIENT_Y[0]), fmt(GRADIENT_Y[1])),
|
||||
' <stop offset="0" stop-color="%s"/>' % hexcolor(GRADIENT_TOP),
|
||||
' <stop offset="1" stop-color="%s"/>' % hexcolor(GRADIENT_BOTTOM),
|
||||
" </linearGradient>",
|
||||
" </defs>",
|
||||
]
|
||||
for style, path in layers(small):
|
||||
lines.append(' <path fill="%s" d="%s"/>' % (fills[style], svg_path(path)))
|
||||
lines.append("</svg>")
|
||||
with open(file, "w", encoding="utf-8", newline="\n") as f:
|
||||
f.write("\n".join(lines) + "\n")
|
||||
|
||||
|
||||
# --- HVIF ----------------------------------------------------------------------------------------
|
||||
# Format of Haiku's FlatIconImporter: "ncif", then styles, paths and shapes, each list prefixed
|
||||
# with a uint8 count. Coordinates: one byte (value + 32) for integers in -32..95, otherwise two
|
||||
# bytes, 0x8000 | round((value + 128) * 102). Matrices use 24-bit floats.
|
||||
|
||||
STYLE_SOLID_NO_ALPHA = 3
|
||||
STYLE_GRADIENT = 2
|
||||
GRADIENT_LINEAR = 0
|
||||
GRADIENT_FLAG_TRANSFORM = 1 << 1
|
||||
GRADIENT_FLAG_NO_ALPHA = 1 << 2
|
||||
PATH_FLAG_CLOSED = 1 << 1
|
||||
PATH_FLAG_NO_CURVES = 1 << 3
|
||||
SHAPE_TYPE_PATH_SOURCE = 10
|
||||
|
||||
|
||||
def hvif_coord(v):
|
||||
if abs(v - round(v)) < 1e-9 and -32 <= round(v) <= 95:
|
||||
return bytes([int(round(v)) + 32])
|
||||
n = int(round((v + 128.0) * 102.0))
|
||||
if not 0 <= n < 0x8000:
|
||||
raise ValueError("coordinate out of range: %r" % v)
|
||||
return bytes([0x80 | (n >> 8), n & 0xFF])
|
||||
|
||||
|
||||
def float24(v):
|
||||
if v == 0:
|
||||
return b"\0\0\0"
|
||||
bits = struct.unpack("<I", struct.pack("<f", v))[0]
|
||||
sign = bits >> 31
|
||||
exponent = ((bits >> 23) & 0xFF) - 127 + 32
|
||||
if not 0 <= exponent < 64:
|
||||
raise ValueError("float out of range: %r" % v)
|
||||
value = (sign << 23) | (exponent << 17) | ((bits & 0x7FFFFF) >> 6)
|
||||
return bytes([(value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF])
|
||||
|
||||
|
||||
def hvif_path(path):
|
||||
curved = any(p[2] is not None or p[3] is not None for p in path)
|
||||
out = bytearray([PATH_FLAG_CLOSED | (0 if curved else PATH_FLAG_NO_CURVES), len(path)])
|
||||
for x, y, hin, hout in path:
|
||||
hin = hin or (x, y)
|
||||
hout = hout or (x, y)
|
||||
values = (x, y, *hin, *hout) if curved else (x, y)
|
||||
for v in values:
|
||||
out += hvif_coord(v)
|
||||
return bytes(out)
|
||||
|
||||
|
||||
def write_hvif(file, small):
|
||||
# Linear gradients run from -64 to 64 on their own x axis: map it to the vertical extent.
|
||||
half = (GRADIENT_Y[1] - GRADIENT_Y[0]) / 128.0
|
||||
mid = (GRADIENT_Y[0] + GRADIENT_Y[1]) / 2.0
|
||||
matrix = (0.0, half, -half, 0.0, 32.0, mid) # agg::trans_affine: sx, shy, shx, sy, tx, ty
|
||||
gradient = bytearray([STYLE_GRADIENT, GRADIENT_LINEAR, GRADIENT_FLAG_TRANSFORM | GRADIENT_FLAG_NO_ALPHA, 2])
|
||||
for m in matrix:
|
||||
gradient += float24(m)
|
||||
gradient += bytes([0, *GRADIENT_TOP, 255, *GRADIENT_BOTTOM])
|
||||
styles = {
|
||||
"gradient": bytes(gradient),
|
||||
"white": bytes([STYLE_SOLID_NO_ALPHA, *WHITE]),
|
||||
"arrow": bytes([STYLE_SOLID_NO_ALPHA, *ARROW]),
|
||||
}
|
||||
used = []
|
||||
for style, _ in layers(small):
|
||||
if style not in used:
|
||||
used.append(style)
|
||||
data = bytearray(b"ncif")
|
||||
data.append(len(used))
|
||||
for s in used:
|
||||
data += styles[s]
|
||||
ls = layers(small)
|
||||
data.append(len(ls))
|
||||
for _, path in ls:
|
||||
data += hvif_path(path)
|
||||
data.append(len(ls))
|
||||
for i, (style, _) in enumerate(ls):
|
||||
data += bytes([SHAPE_TYPE_PATH_SOURCE, used.index(style), 1, i, 0])
|
||||
with open(file, "wb") as f:
|
||||
f.write(data)
|
||||
return len(data)
|
||||
|
||||
|
||||
# --- rasterizer and PNG ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
def flatten(path, steps=24):
|
||||
poly = []
|
||||
for i in range(len(path)):
|
||||
a, b = path[i], path[(i + 1) % len(path)]
|
||||
poly.append(a[:2])
|
||||
if a[3] is None and b[2] is None:
|
||||
continue
|
||||
c1, c2 = a[3] or a[:2], b[2] or b[:2]
|
||||
for k in range(1, steps):
|
||||
t = k / steps
|
||||
u = 1 - t
|
||||
poly.append((
|
||||
u ** 3 * a[0] + 3 * u * u * t * c1[0] + 3 * u * t * t * c2[0] + t ** 3 * b[0],
|
||||
u ** 3 * a[1] + 3 * u * u * t * c1[1] + 3 * u * t * t * c2[1] + t ** 3 * b[1],
|
||||
))
|
||||
return poly
|
||||
|
||||
|
||||
def coverage(poly, size, sub=16):
|
||||
"""Antialiased non-zero coverage (0..1) of a polygon given in 64-unit coordinates."""
|
||||
scale = size / 64.0
|
||||
pts = [(x * scale, y * scale) for x, y in poly]
|
||||
edges = []
|
||||
for i in range(len(pts)):
|
||||
(x0, y0), (x1, y1) = pts[i], pts[(i + 1) % len(pts)]
|
||||
if y0 != y1:
|
||||
edges.append((x0, y0, x1, y1, 1 if y1 > y0 else -1))
|
||||
cov = [0.0] * (size * size)
|
||||
w = 1.0 / sub
|
||||
for row in range(size):
|
||||
base = row * size
|
||||
for s in range(sub):
|
||||
y = row + (s + 0.5) / sub
|
||||
crossings = []
|
||||
for x0, y0, x1, y1, d in edges:
|
||||
if (y0 <= y < y1) or (y1 <= y < y0):
|
||||
crossings.append((x0 + (y - y0) * (x1 - x0) / (y1 - y0), d))
|
||||
crossings.sort()
|
||||
winding = 0
|
||||
for i in range(len(crossings) - 1):
|
||||
winding += crossings[i][1]
|
||||
if winding == 0:
|
||||
continue
|
||||
xa, xb = max(crossings[i][0], 0.0), min(crossings[i + 1][0], float(size))
|
||||
if xb <= xa:
|
||||
continue
|
||||
ia, ib = int(xa), int(xb)
|
||||
if ia == ib:
|
||||
cov[base + ia] += (xb - xa) * w
|
||||
continue
|
||||
cov[base + ia] += (ia + 1 - xa) * w
|
||||
for px in range(ia + 1, min(ib, size)):
|
||||
cov[base + px] += w
|
||||
if ib < size:
|
||||
cov[base + ib] += (xb - ib) * w
|
||||
return cov
|
||||
|
||||
|
||||
def render(size, small):
|
||||
rgba = [[0.0, 0.0, 0.0, 0.0] for _ in range(size * size)] # premultiplied
|
||||
for style, path in layers(small):
|
||||
cov = coverage(flatten(path), size)
|
||||
for i, c in enumerate(cov):
|
||||
if c <= 0:
|
||||
continue
|
||||
a = min(c, 1.0)
|
||||
if style == "gradient":
|
||||
y = ((i // size) + 0.5) * 64.0 / size
|
||||
t = min(max((y - GRADIENT_Y[0]) / (GRADIENT_Y[1] - GRADIENT_Y[0]), 0.0), 1.0)
|
||||
color = [GRADIENT_TOP[k] + (GRADIENT_BOTTOM[k] - GRADIENT_TOP[k]) * t for k in range(3)]
|
||||
else:
|
||||
color = WHITE if style == "white" else ARROW
|
||||
p = rgba[i]
|
||||
for k in range(3):
|
||||
p[k] = color[k] / 255.0 * a + p[k] * (1 - a)
|
||||
p[3] = a + p[3] * (1 - a)
|
||||
return rgba
|
||||
|
||||
|
||||
def write_png(file, size, rgba):
|
||||
raw = bytearray()
|
||||
for row in range(size):
|
||||
raw.append(0)
|
||||
for p in rgba[row * size:(row + 1) * size]:
|
||||
a = p[3]
|
||||
if a <= 0:
|
||||
raw += b"\0\0\0\0"
|
||||
continue
|
||||
raw += bytes([min(255, int(round(p[k] / a * 255))) for k in range(3)] + [int(round(a * 255))])
|
||||
|
||||
def chunk(kind, payload):
|
||||
body = kind + payload
|
||||
return struct.pack(">I", len(payload)) + body + struct.pack(">I", zlib.crc32(body) & 0xFFFFFFFF)
|
||||
|
||||
with open(file, "wb") as f:
|
||||
f.write(b"\x89PNG\r\n\x1a\n")
|
||||
f.write(chunk(b"IHDR", struct.pack(">IIBBBBB", size, size, 8, 6, 0, 0, 0)))
|
||||
f.write(chunk(b"IDAT", zlib.compress(bytes(raw), 9)))
|
||||
f.write(chunk(b"IEND", b""))
|
||||
|
||||
|
||||
def main():
|
||||
root = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "data", "icons")
|
||||
os.makedirs(os.path.join(root, "png"), exist_ok=True)
|
||||
write_svg(os.path.join(root, "openpu.svg"), small=False)
|
||||
write_svg(os.path.join(root, "openpu-small.svg"), small=True)
|
||||
n = write_hvif(os.path.join(root, "openpu.hvif"), small=False)
|
||||
print("openpu.hvif: %d bytes" % n)
|
||||
sizes = [int(a) for a in sys.argv[1:]] or SIZES
|
||||
for size in sizes:
|
||||
write_png(os.path.join(root, "png", "openpu-%d.png" % size), size, render(size, size in SMALL_SIZES))
|
||||
print("openpu-%d.png" % size)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,174 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
"""Drive a headless QEMU VM through QMP: screenshots, absolute clicks, typing, power-off.
|
||||
|
||||
usage: python3 tools/qmp.py [--socket PATH] COMMAND...
|
||||
shot OUT.png screenshot (PNG, no external dependency)
|
||||
click X Y [right|double] click at screen pixel X,Y (needs a usb-tablet device)
|
||||
move X Y move the pointer
|
||||
type TEXT type text with a US keyboard layout
|
||||
typefile FILE type the content of FILE (newlines press Return)
|
||||
key COMBO... press key combos, e.g. ret, tab, ctrl-alt-delete, alt-f4
|
||||
powerdown ACPI power button
|
||||
hmp COMMAND human monitor command (prints the answer)
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import socket
|
||||
import struct
|
||||
import sys
|
||||
import time
|
||||
import zlib
|
||||
|
||||
|
||||
class Qmp:
|
||||
def __init__(self, path):
|
||||
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
self.sock.connect(path)
|
||||
self.buf = b""
|
||||
self._read() # greeting
|
||||
self.cmd("qmp_capabilities")
|
||||
|
||||
def _read(self):
|
||||
while b"\n" not in self.buf:
|
||||
chunk = self.sock.recv(65536)
|
||||
if not chunk:
|
||||
raise RuntimeError("QMP connection closed")
|
||||
self.buf += chunk
|
||||
line, self.buf = self.buf.split(b"\n", 1)
|
||||
return json.loads(line)
|
||||
|
||||
def cmd(self, name, **args):
|
||||
self.sock.sendall(json.dumps({"execute": name, "arguments": args}).encode() + b"\n")
|
||||
while True:
|
||||
msg = self._read()
|
||||
if "return" in msg:
|
||||
return msg["return"]
|
||||
if "error" in msg:
|
||||
raise RuntimeError(f"{name}: {msg['error'].get('desc')}")
|
||||
# asynchronous events are ignored
|
||||
|
||||
|
||||
def ppm_to_png(ppm, png):
|
||||
data = open(ppm, "rb").read()
|
||||
fields, pos = [], 0
|
||||
while len(fields) < 4: # P6, width, height, maxval
|
||||
while data[pos:pos + 1].isspace():
|
||||
pos += 1
|
||||
if data[pos:pos + 1] == b"#":
|
||||
pos = data.index(b"\n", pos) + 1
|
||||
continue
|
||||
end = pos
|
||||
while not data[end:end + 1].isspace():
|
||||
end += 1
|
||||
fields.append(data[pos:end])
|
||||
pos = end
|
||||
width, height = int(fields[1]), int(fields[2])
|
||||
pixels = data[pos + 1:]
|
||||
stride = width * 3
|
||||
raw = b"".join(b"\x00" + pixels[y * stride:(y + 1) * stride] for y in range(height))
|
||||
|
||||
def chunk(kind, payload):
|
||||
body = kind + payload
|
||||
return struct.pack(">I", len(payload)) + body + struct.pack(">I", zlib.crc32(body) & 0xFFFFFFFF)
|
||||
|
||||
with open(png, "wb") as f:
|
||||
f.write(b"\x89PNG\r\n\x1a\n")
|
||||
f.write(chunk(b"IHDR", struct.pack(">IIBBBBB", width, height, 8, 2, 0, 0, 0)))
|
||||
f.write(chunk(b"IDAT", zlib.compress(raw, 6)))
|
||||
f.write(chunk(b"IEND", b""))
|
||||
return width, height
|
||||
|
||||
|
||||
def screen_size(q):
|
||||
tmp = f"/tmp/qmp-size-{os.getpid()}.ppm"
|
||||
q.cmd("screendump", filename=tmp)
|
||||
with open(tmp, "rb") as f:
|
||||
head = f.read(64).split()
|
||||
os.unlink(tmp)
|
||||
return int(head[1]), int(head[2])
|
||||
|
||||
|
||||
def move(q, x, y):
|
||||
w, h = screen_size(q)
|
||||
q.cmd("input-send-event", events=[
|
||||
{"type": "abs", "data": {"axis": "x", "value": int(x * 32767 / max(1, w - 1))}},
|
||||
{"type": "abs", "data": {"axis": "y", "value": int(y * 32767 / max(1, h - 1))}},
|
||||
])
|
||||
|
||||
|
||||
def click(q, x, y, mode="left"):
|
||||
move(q, x, y)
|
||||
button = "right" if mode == "right" else "left"
|
||||
for _ in range(2 if mode == "double" else 1):
|
||||
for down in (True, False):
|
||||
q.cmd("input-send-event", events=[{"type": "btn", "data": {"down": down, "button": button}}])
|
||||
time.sleep(0.05)
|
||||
|
||||
|
||||
SHIFTED = {"_": "minus", ":": "semicolon", "\"": "apostrophe", "<": "comma", ">": "dot", "?": "slash",
|
||||
"!": "1", "@": "2", "#": "3", "$": "4", "%": "5", "^": "6", "&": "7", "*": "8", "(": "9",
|
||||
")": "0", "+": "equal", "{": "bracket_left", "}": "bracket_right", "|": "backslash", "~": "grave_accent"}
|
||||
PLAIN = {" ": "spc", "-": "minus", ".": "dot", "/": "slash", ",": "comma", ";": "semicolon", "'": "apostrophe",
|
||||
"=": "equal", "[": "bracket_left", "]": "bracket_right", "\\": "backslash", "`": "grave_accent",
|
||||
"\n": "ret", "\t": "tab"}
|
||||
|
||||
|
||||
def keys_for(ch):
|
||||
if ch.isalpha() and ch.isascii():
|
||||
return (["shift"] if ch.isupper() else []) + [ch.lower()]
|
||||
if ch.isdigit():
|
||||
return [ch]
|
||||
if ch in PLAIN:
|
||||
return [PLAIN[ch]]
|
||||
if ch in SHIFTED:
|
||||
return ["shift", SHIFTED[ch]]
|
||||
raise ValueError(f"cannot type {ch!r}")
|
||||
|
||||
|
||||
def press(q, names):
|
||||
# send-key returns before QEMU replays the keys: wait longer than the hold time, or
|
||||
# consecutive keys overlap (and a held shift leaks into the next characters).
|
||||
q.cmd("send-key", keys=[{"type": "qcode", "data": n} for n in names], **{"hold-time": 30})
|
||||
time.sleep(0.08)
|
||||
|
||||
|
||||
def main():
|
||||
args = sys.argv[1:]
|
||||
path = os.path.expanduser("~/openpu-vm/qmp.sock")
|
||||
if args[:1] == ["--socket"]:
|
||||
path, args = args[1], args[2:]
|
||||
if not args:
|
||||
print(__doc__, file=sys.stderr)
|
||||
sys.exit(2)
|
||||
q = Qmp(path)
|
||||
cmd, rest = args[0], args[1:]
|
||||
if cmd == "shot":
|
||||
tmp = os.path.abspath(rest[0]) + ".ppm"
|
||||
q.cmd("screendump", filename=tmp)
|
||||
w, h = ppm_to_png(tmp, rest[0])
|
||||
os.unlink(tmp)
|
||||
print(f"{rest[0]} {w}x{h}")
|
||||
elif cmd == "click":
|
||||
click(q, int(rest[0]), int(rest[1]), rest[2] if len(rest) > 2 else "left")
|
||||
elif cmd == "move":
|
||||
move(q, int(rest[0]), int(rest[1]))
|
||||
elif cmd == "type":
|
||||
for ch in " ".join(rest):
|
||||
press(q, keys_for(ch))
|
||||
elif cmd == "typefile":
|
||||
with open(rest[0], encoding="utf-8") as f:
|
||||
for ch in f.read():
|
||||
press(q, keys_for(ch))
|
||||
elif cmd == "key":
|
||||
for combo in rest:
|
||||
press(q, combo.split("-"))
|
||||
elif cmd == "powerdown":
|
||||
q.cmd("system_powerdown")
|
||||
elif cmd == "hmp":
|
||||
print(q.cmd("human-monitor-command", **{"command-line": " ".join(rest)}))
|
||||
else:
|
||||
print(__doc__, file=sys.stderr)
|
||||
sys.exit(2)
|
||||
|
||||
|
||||
main()
|
||||
@@ -25,10 +25,18 @@ grep -q "^project(openpu VERSION $VERSION " CMakeLists.txt || { echo "cannot upd
|
||||
sed -i "s/^## \[Unreleased\]$/## [Unreleased]\n\n## [$VERSION] - $TODAY/" CHANGELOG.md
|
||||
sed -i "s|^\[Unreleased\]: \(.*\)/compare/v[0-9.]*\.\.\.HEAD$|[Unreleased]: \1/compare/v$VERSION...HEAD\n[$VERSION]: \1/releases/tag/v$VERSION|" CHANGELOG.md
|
||||
|
||||
git add CMakeLists.txt CHANGELOG.md
|
||||
# AppStream metadata lists the releases, newest first.
|
||||
sed -i "s|^ <releases>$| <releases>\n <release version=\"$VERSION\" date=\"$TODAY\"/>|" data/io.github.openpu.OpenPU.metainfo.xml
|
||||
grep -q "<release version=\"$VERSION\"" data/io.github.openpu.OpenPU.metainfo.xml || { echo "cannot update the metainfo" >&2; exit 1; }
|
||||
|
||||
git add CMakeLists.txt CHANGELOG.md data/io.github.openpu.OpenPU.metainfo.xml
|
||||
# RELEASE_TRAILER: optional trailer lines appended to the release commit message (e.g. co-authors).
|
||||
git commit -q -m "release: v$VERSION" ${RELEASE_TRAILER:+-m "$RELEASE_TRAILER"}
|
||||
NOTES=$(awk -v v="$VERSION" '$0 ~ "^## \\[" v "\\]" {on=1; next} on && /^(## |\[)/ {exit} on {print}' CHANGELOG.md)
|
||||
# Plain string comparison (not a regex: "[" and "." in the heading would be special).
|
||||
NOTES=$(awk -v v="$VERSION" 'index($0, "## [" v "]") == 1 {on=1; next}
|
||||
on && (index($0, "## ") == 1 || index($0, "[") == 1) {exit}
|
||||
on {print}' CHANGELOG.md | sed -e '/./,$!d')
|
||||
[ -n "$NOTES" ] || { echo "no release notes found for $VERSION in CHANGELOG.md" >&2; exit 1; }
|
||||
git tag -a "v$VERSION" -m "OpenPU $VERSION" -m "$NOTES"
|
||||
echo "tagged v$VERSION (previous: ${PREVIOUS:-none})"
|
||||
|
||||
@@ -39,7 +47,12 @@ done
|
||||
GH=$(command -v gh || command -v gh.exe || true)
|
||||
[ -z "$GH" ] && [ -x "/c/Program Files/GitHub CLI/gh.exe" ] && GH="/c/Program Files/GitHub CLI/gh.exe"
|
||||
if [ -n "$GH" ]; then
|
||||
# The release workflow may have created the release already (to attach the binaries).
|
||||
if "$GH" release view "v$VERSION" >/dev/null 2>&1; then
|
||||
printf '%s\n' "$NOTES" | "$GH" release edit "v$VERSION" --title "OpenPU $VERSION" --notes-file -
|
||||
else
|
||||
printf '%s\n' "$NOTES" | "$GH" release create "v$VERSION" --verify-tag --title "OpenPU $VERSION" --notes-file -
|
||||
fi
|
||||
else
|
||||
echo "gh not found: create the GitHub release for v$VERSION by hand" >&2
|
||||
fi
|
||||