Skip to content

Commit

Permalink
Add org.meshtastic.meshtasticd
Browse files Browse the repository at this point in the history
  • Loading branch information
vidplace7 committed Feb 10, 2025
1 parent 746ea89 commit 376fe56
Show file tree
Hide file tree
Showing 14 changed files with 1,197 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches: [meshtasticd]
pull_request:

jobs:
flatpak-amd64:
runs-on: ubuntu-24.04
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:freedesktop-24.08
options: --privileged
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: flathub-infra/flatpak-github-actions/flatpak-builder@master
with:
bundle: meshtasticd.flatpak
manifest-path: org.meshtastic.meshtasticd.yaml
arch: x86_64
cache-key: flatpak-builder-${{ github.sha }}

flatpak-arm64:
runs-on: ubuntu-24.04-arm
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:freedesktop-24.08
options: --privileged
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: flathub-infra/flatpak-github-actions/flatpak-builder@master
with:
bundle: meshtasticd.flatpak
manifest-path: org.meshtastic.meshtasticd.yaml
arch: aarch64
cache-key: flatpak-builder-${{ github.sha }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode/settings.json

.flatpak
.flatpak-builder
build
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "shared-modules"]
path = shared-modules
url = https://github.com/flathub/shared-modules.git
675 changes: 675 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions meshtasticd-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

CONF_DIR="$XDG_CONFIG_HOME/meshtasticd"

# Ensure conf directories exist
mkdir -p "$CONF_DIR/config.d"
mkdir -p "$CONF_DIR/available.d"

# Always copy available.d config files
cp -R /app/share/meshtasticd/available.d/* "$CONF_DIR/available.d/"

# Copy default config if it doesn't exist
if [ ! -f "$CONF_DIR/config.yaml" ]; then
echo "Copying default config to $CONF_DIR/config.yaml"
cp /app/share/meshtasticd/config-dist.yaml $CONF_DIR/config.yaml
sed -i 's|/usr/share/meshtasticd|/app/share/meshtasticd|g' $CONF_DIR/config.yaml
sed -i "s|/etc/meshtasticd|$CONF_DIR|g" $CONF_DIR/config.yaml
fi

# Copy default UI config if it doesn't exist
if [ ! -f "$CONF_DIR/config.d/MUI.yaml" ]; then
echo "Copying default UI config to $CONF_DIR/config.d/MUI.yaml"
cp /app/share/meshtasticd/available.d/MUI/X11_480x480.yaml $CONF_DIR/config.d/MUI.yaml
fi

exec meshtasticd "--fsdir=$XDG_DATA_HOME" "--config=$XDG_CONFIG_HOME/meshtasticd/config.yaml" "$@"
8 changes: 8 additions & 0 deletions org.meshtastic.meshtasticd.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Name=Meshtastic
Comment=Meshtastic App
Exec=meshtasticd-wrapper.sh
Icon=org.meshtastic.meshtasticd
Terminal=true
Type=Application
Categories=Utility;
29 changes: 29 additions & 0 deletions org.meshtastic.meshtasticd.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.meshtastic.meshtasticd</id>

<name>Meshtastic</name>
<summary>An open source, off-grid, decentralized, mesh network built to run on affordable, low-power devices</summary>

<metadata_license>CC-BY-4.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>

<supports>
<control>pointing</control>
<control>keyboard</control>
<control>touch</control>
</supports>

<description>
<p>
Meshtastic® is a project that enables you to use inexpensive LoRa radios as a long range off-grid communication platform in areas without existing or reliable communications infrastructure. This project is 100% community driven and open source!
</p>
</description>

<launchable type="desktop-id">org.meshtastic.meshtasticd.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/meshtastic/flathub-submissions/refs/heads/meshtasticd/static/Screenshot_1.png</image>
</screenshot>
</screenshots>
</component>
16 changes: 16 additions & 0 deletions org.meshtastic.meshtasticd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
185 changes: 185 additions & 0 deletions org.meshtastic.meshtasticd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
id: org.meshtastic.meshtasticd
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
command: meshtasticd-wrapper.sh
modules:
- name: meshtasticd-wrapper
buildsystem: simple
build-commands:
- install -Dm755 meshtasticd-wrapper.sh /app/bin/meshtasticd-wrapper.sh
- install -Dm644 -t /app/share/icons/hicolor/scalable/apps/ org.meshtastic.meshtasticd.svg
- install -Dm644 -t /app/share/applications org.meshtastic.meshtasticd.desktop
- install -Dm644 -t /app/share/metainfo org.meshtastic.meshtasticd.metainfo.xml
sources:
- type: file
path: meshtasticd-wrapper.sh
- type: file
path: org.meshtastic.meshtasticd.desktop
- type: file
path: org.meshtastic.meshtasticd.svg
- type: file
path: org.meshtastic.meshtasticd.metainfo.xml
- name: meshtasticd
buildsystem: simple
build-options:
# build-args:
# # PlatformIO requires internet access at build-time to download pkgs
# - --share=network
env:
PLATFORMIO_BUILD_FLAGS: -L/app/lib
PLATFORMIO_LIBDEPS_DIR: pio/libdeps
PLATFORMIO_PACKAGES_DIR: pio/packages
PLATFORMIO_CORE_DIR: pio/core
build-commands:
- pwd
- ls -lah pio
- mv pio/libdeps/native pio/libdeps/native-tft
# - mv pio/core/platforms/native pio/core/platforms/native-tft
- platformio run -e native-tft
- install -Dm755 .pio/build/native-tft/program /app/bin/meshtasticd
# Install the default config files and directories
- install -d /app/share/meshtasticd
- install -d /app/share/meshtasticd/config.d
- install -d /app/share/meshtasticd/available.d
- cp -R bin/config.d/* /app/share/meshtasticd/available.d
- install -m644 bin/config-dist.yaml /app/share/meshtasticd/config-dist.yaml
sources:
- type: git
url: https://github.com/meshtastic/firmware.git
# tag: v2.5.21.447533a
# commit: 447533aae5b82398e8dcd648745a4ff1a3c0a8ac
branch: '2.6'
- type: patch
paths:
- patches/stdcppfs.patch
- type: archive
url: https://github.com/meshtastic/firmware/releases/download/v2.5.21.447533a/platformio-deps-native-2.5.21.447533a.zip
sha256: 3cf3d3511f49885e08dbceebc440f3ef8dd96c508691cc079f40f3694b49f764
strip-components: 0
dest: pio
modules:
- python3-modules.json
- shared-modules/libusb/libusb.json
- name: yaml-cpp
buildsystem: cmake-ninja
config-opts:
- -DBUILD_SHARED_LIBS=ON
- -DYAML_BUILD_SHARED_LIBS=ON
- -DYAML_CPP_BUILD_TOOLS=OFF
- -DYAML_CPP_BUILD_TESTS=OFF
- -DYAML_CPP_BUILD_CONTRIB=OFF
sources:
- type: archive
url: https://github.com/jbeder/yaml-cpp/archive/refs/tags/0.8.0.tar.gz
sha256: fbe74bbdcee21d656715688706da3c8becfd946d92cd44705cc6098bb23b3a16
- name: libgpiod
buildsystem: autotools
sources:
- type: archive
url: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-2.2.tar.gz
sha256: ae35329db7027c740e90c883baf27c26311f0614e6a7b115771b28188b992aec
- name: i2c-tools
buildsystem: simple
build-commands:
- make PREFIX=${FLATPAK_DEST} install
sources:
- type: archive
url: https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git/snapshot/i2c-tools-4.4.tar.gz
sha256: af01d0fbe78e109a2db7137c7e9bfda3f3fb236c3177744c0f2695d1056cde71
- name: libevdev
buildsystem: meson
config-opts:
- -Dtests=disabled
- -Ddocumentation=disabled
sources:
- type: archive
url: https://www.freedesktop.org/software/libevdev/libevdev-1.13.3.tar.xz
sha256: abf1aace86208eebdd5d3550ffded4c8d73bb405b796d51c389c9d0604cbcfbf
x-checker-data:
type: anitya
project-id: 20540
stable-only: true
url-template: https://www.freedesktop.org/software/libevdev/libevdev-$version.tar.xz
cleanup:
- /bin
- /include
- /lib/pkgconfig
- /share/man
- name: libinput
buildsystem: meson
config-opts:
- --libexec=lib
- -Dlibwacom=false
- -Ddebug-gui=false
- -Dtests=false
- -Ddocumentation=false
- -Dzshcompletiondir=no
sources:
- type: archive
url: https://gitlab.freedesktop.org/libinput/libinput/-/archive/1.27.0/libinput-1.27.0.tar.gz
sha256: b11b900bf88ef68fe688c107226bb453ef26faf461ae2dcf9690b00009d660a6
x-checker-data:
type: anitya
project-id: 5781
stable-only: true
url-template: https://gitlab.freedesktop.org/libinput/libinput/-/archive/$version/libinput-$version.tar.gz
cleanup:
- /bin
- /etc
- /lib/libinput
- /lib/udev
- /share
- /include
- /lib/pkgconfig
modules:
- name: mtdev
buildsystem: autotools
config-opts:
- --disable-static
sources:
- type: archive
url: https://bitmath.org/code/mtdev/mtdev-1.1.7.tar.bz2
sha256: a107adad2101fecac54ac7f9f0e0a0dd155d954193da55c2340c97f2ff1d814e
x-checker-data:
type: anitya
project-id: 8868
stable-only: true
url-template: https://bitmath.org/code/mtdev/mtdev-$version.tar.bz2
# Upstream uses an outdated version of the config.guess/config.sub script,
# so we override it here to fix aarch64 builds.
- type: shell
commands:
- cp -p /usr/share/automake-*/config.{sub,guess} config-aux/
cleanup:
- /bin
- /include
- /lib/*.la
- /lib/pkgconfig
- name: xkbcommon
buildsystem: meson
config-opts:
- --buildtype=release
- -Ddefault_library=static
- -Denable-docs=false
- -Denable-tools=false
- -Denable-bash-completion=false
- -Dx-locale-root=/usr/share/X11/locale
cleanup:
- /bin
- /libexec
sources:
- type: archive
url: https://xkbcommon.org/download/libxkbcommon-1.6.0.tar.xz
sha256: 0edc14eccdd391514458bc5f5a4b99863ed2d651e4dd761a90abf4f46ef99c2b

finish-args:
# Allow the app to talk to the X server
- --socket=x11
# Required for CH341 USB radio
- --device=all
# Needs to talk to the network:
- --share=network
# Persist the meshtasticd configs
- --filesystem=xdg-config
- --filesystem=xdg-data
12 changes: 12 additions & 0 deletions patches/stdcppfs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini
index aa1150e9..26377345 100644
--- a/arch/portduino/portduino.ini
+++ b/arch/portduino/portduino.ini
@@ -35,7 +35,6 @@ build_flags =
-DRADIOLIB_EEPROM_UNSUPPORTED
-DPORTDUINO_LINUX_HARDWARE
-lpthread
- -lstdc++fs
-lbluetooth
-lgpiod
-lyaml-cpp
Loading

0 comments on commit 376fe56

Please sign in to comment.