From a2bdb0c99af0c0d6d3d7c9eab460e7ce308d0970 Mon Sep 17 00:00:00 2001 From: newbieQQ Date: Tue, 7 Jul 2026 09:24:33 +0800 Subject: [PATCH] =?UTF-8?q?Release=20v1.0.0:=20deb=20+=20flatpak=20+=20win?= =?UTF-8?q?dows=20=E6=89=93=E5=8C=85=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 8 +++ actuator-reader.spec | 43 ++++++++++++++++ build-release.sh | 46 ++++++++++++++++++ packaging/deb/actuator-reader/DEBIAN/control | 11 +++++ .../applications/actuator-reader.desktop | 10 ++++ .../hicolor/256x256/apps/actuator-reader.png | Bin 0 -> 4686 bytes .../flatpak/top.qyhhh.actuator-reader.desktop | 8 +++ .../top.qyhhh.actuator-reader.metainfo.xml | 20 ++++++++ .../flatpak/top.qyhhh.actuator-reader.yml | 30 ++++++++++++ packaging/windows/build.bat | 15 ++++++ 10 files changed, 191 insertions(+) create mode 100644 actuator-reader.spec create mode 100644 build-release.sh create mode 100644 packaging/deb/actuator-reader/DEBIAN/control create mode 100644 packaging/deb/actuator-reader/usr/share/applications/actuator-reader.desktop create mode 100644 packaging/deb/actuator-reader/usr/share/icons/hicolor/256x256/apps/actuator-reader.png create mode 100644 packaging/flatpak/top.qyhhh.actuator-reader.desktop create mode 100644 packaging/flatpak/top.qyhhh.actuator-reader.metainfo.xml create mode 100644 packaging/flatpak/top.qyhhh.actuator-reader.yml create mode 100644 packaging/windows/build.bat diff --git a/.gitignore b/.gitignore index 4845697..3163496 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ __pycache__/ *.pyc *.pyo .venv/ +.build-venv/ venv/ *.egg-info/ dist/ @@ -12,3 +13,10 @@ build/ *~ *.csv *_frames/ +# 打包产物(不进仓库) +*.deb +*.tar.gz +# Flatpak 和 deb 里的大二进制文件 +packaging/deb/actuator-reader/usr/bin/ +packaging/flatpak/actuator-reader +packaging/flatpak/*.png diff --git a/actuator-reader.spec b/actuator-reader.spec new file mode 100644 index 0000000..9e76faf --- /dev/null +++ b/actuator-reader.spec @@ -0,0 +1,43 @@ +# -*- mode: python ; coding: utf-8 -*- + +a = Analysis( + ['main.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[ + 'cv2', + 'numpy', + 'PyQt6.QtCore', + 'PyQt6.QtGui', + 'PyQt6.QtWidgets', + ], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, +) + +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.datas, + [], + name='actuator-reader', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) diff --git a/build-release.sh b/build-release.sh new file mode 100644 index 0000000..640987e --- /dev/null +++ b/build-release.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# 构建所有平台的发布包 +set -e + +VERSION="1.0.0" +ROOT="$(cd "$(dirname "$0")" && pwd)" +DIST="$ROOT/dist" + +echo "=== Building Actuator Reader v$VERSION ===" + +# 1. PyInstaller Linux binary +echo "[1/3] Building Linux binary..." +cd "$ROOT" +if [ ! -d .build-venv ]; then + python3 -m venv .build-venv + .build-venv/bin/pip install pyinstaller opencv-python numpy PyQt6 +fi +.build-venv/bin/pyinstaller --clean --noconfirm actuator-reader.spec + +# 2. DEB package +echo "[2/3] Building .deb package..." +rm -rf packaging/deb/actuator-reader/usr/bin/actuator-reader +cp "$DIST/actuator-reader" packaging/deb/actuator-reader/usr/bin/ +cd packaging/deb +dpkg-deb --build --root-owner-group actuator-reader "actuator-reader_${VERSION}_amd64.deb" +cp "actuator-reader_${VERSION}_amd64.deb" "$DIST/" +cd "$ROOT" + +# 3. Flatpak bundle (manifest + binary) +echo "[3/3] Preparing Flatpak..." +cp "$DIST/actuator-reader" packaging/flatpak/ +cd packaging/flatpak +tar czf "$DIST/actuator-reader-${VERSION}-flatpak-sources.tar.gz" \ + actuator-reader \ + top.qyhhh.actuator-reader.yml \ + top.qyhhh.actuator-reader.desktop \ + top.qyhhh.actuator-reader.png \ + top.qyhhh.actuator-reader.metainfo.xml +cd "$ROOT" + +echo "" +echo "=== Done ===" +echo "Linux binary: dist/actuator-reader" +echo "DEB package: dist/actuator-reader_${VERSION}_amd64.deb" +echo "Flatpak sources: dist/actuator-reader-${VERSION}-flatpak-sources.tar.gz" +echo "Windows: packaging/windows/build.bat (在 Windows 上运行)" diff --git a/packaging/deb/actuator-reader/DEBIAN/control b/packaging/deb/actuator-reader/DEBIAN/control new file mode 100644 index 0000000..e6f9789 --- /dev/null +++ b/packaging/deb/actuator-reader/DEBIAN/control @@ -0,0 +1,11 @@ +Package: actuator-reader +Version: 1.0.0 +Section: science +Priority: optional +Architecture: amd64 +Depends: libc6 (>= 2.28), libgl1, libglib2.0-0, libxcb-cursor0 +Maintainer: Newbie +Description: 制动器角度读取工具 + 读取视频中的制动器弯曲角度。 + 手动点击标记点 O(圆心)、M(初始尾端)、M2(当前尾端), + 计算偏离角 ∠M2-O-M,支持逐帧测量、方向矫正、CSV 导出。 diff --git a/packaging/deb/actuator-reader/usr/share/applications/actuator-reader.desktop b/packaging/deb/actuator-reader/usr/share/applications/actuator-reader.desktop new file mode 100644 index 0000000..fb22d61 --- /dev/null +++ b/packaging/deb/actuator-reader/usr/share/applications/actuator-reader.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=Actuator Reader +Name[zh_CN]=制动器角度读取 +Comment=Brake actuator angle measurement tool +Comment[zh_CN]=制动器弯曲角度测量工具 +Exec=actuator-reader +Icon=actuator-reader +Terminal=false +Categories=Science;Engineering; diff --git a/packaging/deb/actuator-reader/usr/share/icons/hicolor/256x256/apps/actuator-reader.png b/packaging/deb/actuator-reader/usr/share/icons/hicolor/256x256/apps/actuator-reader.png new file mode 100644 index 0000000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krA5sq00358KYBe8JdV2{~B zUvehQGdd%lv>B$;DTF2zZ1;FU61UOXZ(#s?6H9Jtk7>J-ue`~{*S%k4TDMQWy`1jt zHsk<3X{6j=riZb2+%QHX#SC(l9?xJJ(WjB9$`b~*-y+n@Jq4)B3-&MwE$1@^xlZpf zBc~Lo$_MrU65Yo&OST{|q1upxsA>t!tUtU&N|-732TFE~?suu3%%r>YBVygjEGY(| z=nO{A!8`;A^+A)C1rDoONYBT&{jtR{P1;;Qq9T!{FtWlVZay^#r;b#h>G1AKZ=)sC zh=fK=(BME9jT}JJ;k{>4zeM(-CP*I>^k3_qJ*Wv~kkbqw_7MhwM6e<<)C6HS>1f0( znaw;n*q_P$;`_J{A1u=g5Zf!IzCC7?`+_uX6dCTqQ@~Hgs*|doO5pPBlBn&Wf$!T$ z_<;JO;KXhcWkbgoAXu_nbyx5km9H zL6!e{AjuNvOl2OQH88v{0{!md90ZVPsu++>^)S0cAlKokaHLGWePwlx4|wFPL|q3{ z-9w1|+CJ`$L&NGpiP{C4*zrxox&#L45UVo*;iM4VD*!1UR=bGR7(CD)0`g%WH~d<@ z;Tw_RDpe9fsXYuqydV#2Y4x8iL?qqNHY6w}W}-hpqq&$e}d}s;K`=TB{UNFezE-5Unht~ zSg#wdl*2Pm0mYnOF2o=ecu-4Je?)Xj__Ffyvj@-oWnyJr4159k-~Ii0% + + top.qyhhh.actuator-reader + MIT + MIT + Actuator Reader + 制动器角度读取 + Brake actuator angle measurement tool + 制动器弯曲角度测量工具 + +

Read actuator bending angles from video. Click marker points O (center), + M (initial tip), M2 (current tip) to measure deviation angle ∠M2-O-M.

+

从视频中读取制动器弯曲角度。点击标记点 O(圆心)、 + M(初始尾端)、M2(当前尾端),计算偏离角 ∠M2-O-M。

+
+ https://git.qyhhh.top/newbie/Actuators + + + +
diff --git a/packaging/flatpak/top.qyhhh.actuator-reader.yml b/packaging/flatpak/top.qyhhh.actuator-reader.yml new file mode 100644 index 0000000..9ec698e --- /dev/null +++ b/packaging/flatpak/top.qyhhh.actuator-reader.yml @@ -0,0 +1,30 @@ +app-id: top.qyhhh.actuator-reader +runtime: org.kde.Platform +runtime-version: "6.7" +sdk: org.kde.Sdk +command: actuator-reader +finish-args: + - --socket=wayland + - --socket=fallback-x11 + - --socket=pulseaudio + - --share=ipc + - --device=dri + - --filesystem=host + +modules: + - name: actuator-reader + buildsystem: simple + build-commands: + - install -Dm755 actuator-reader /app/bin/actuator-reader + - install -Dm644 top.qyhhh.actuator-reader.desktop /app/share/applications/top.qyhhh.actuator-reader.desktop + - install -Dm644 top.qyhhh.actuator-reader.png /app/share/icons/hicolor/256x256/apps/top.qyhhh.actuator-reader.png + - install -Dm644 top.qyhhh.actuator-reader.metainfo.xml /app/share/metainfo/top.qyhhh.actuator-reader.metainfo.xml + sources: + - type: file + path: actuator-reader + - type: file + path: top.qyhhh.actuator-reader.desktop + - type: file + path: top.qyhhh.actuator-reader.png + - type: file + path: top.qyhhh.actuator-reader.metainfo.xml diff --git a/packaging/windows/build.bat b/packaging/windows/build.bat new file mode 100644 index 0000000..bcb767b --- /dev/null +++ b/packaging/windows/build.bat @@ -0,0 +1,15 @@ +:: Windows 打包脚本 — 在 Windows 上运行 +:: 前提:安装 Python 3.10+,然后 pip install pyinstaller opencv-python numpy PyQt6 + +pyinstaller --clean --noconfirm ^ + --name "actuator-reader" ^ + --windowed ^ + --hidden-import cv2 ^ + --hidden-import numpy ^ + --hidden-import PyQt6.QtCore ^ + --hidden-import PyQt6.QtGui ^ + --hidden-import PyQt6.QtWidgets ^ + main.py + +echo Build complete: dist\actuator-reader.exe +pause