Skip to content

Commit 3a6385d

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents 6400074 + dbf8fc6 commit 3a6385d

File tree

126 files changed

+8225
-1994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+8225
-1994
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Desktop Entry]
2+
Name=OpenModScan
3+
Comment=An Open Source Modbus Master (Client) Utility
4+
Exec=/app/bin/omodscan
5+
Icon=io.github.sanny32.omodscan
6+
Terminal=false
7+
Type=Application
8+
Categories=Utility;
9+
StartupNotify=true
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<component type="desktop-application">
3+
<id>io.github.sanny32.omodscan</id>
4+
<name>OpenModScan</name>
5+
<summary>An Open Source Modbus Master (Client) Utility</summary>
6+
<metadata_license>CC0-1.0</metadata_license>
7+
<project_license>MIT</project_license>
8+
<description>
9+
<p>OpenModScan is a free and open-source Modbus Master (Client) utility supporting both Modbus-TCP and Modbus-RTU protocols.</p>
10+
</description>
11+
<categories>
12+
<category>Network</category>
13+
<category>Utility</category>
14+
</categories>
15+
<keywords>
16+
<keyword>modbus</keyword>
17+
<keyword>master</keyword>
18+
<keyword>client</keyword>
19+
</keywords>
20+
<url type="homepage">https://github.com/sanny32/OpenModScan</url>
21+
<launchable type="desktop-id">io.github.sanny32.omodscan.desktop</launchable>
22+
</component>
671 Bytes
Loading
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
id: io.github.sanny32.omodscan
2+
branch: stable
3+
runtime: org.kde.Sdk
4+
runtime-version: "6.9"
5+
sdk: org.kde.Sdk
6+
command: omodscan
7+
finish-args:
8+
- "--socket=wayland"
9+
- "--socket=fallback-x11"
10+
- "--socket=cups"
11+
- "--device=all"
12+
- "--share=network"
13+
- "--filesystem=home"
14+
- "--system-talk-name=org.freedesktop.UDisks2"
15+
cleanup:
16+
- /include
17+
- /lib/cmake
18+
- /lib/libexec
19+
- /lib/metatypes
20+
- /lib/pkgconfig
21+
- /lib/sbom
22+
- /lib/systemd
23+
- /bin/canbusutil
24+
- /mkspecs
25+
- /modules
26+
- '*.a'
27+
28+
modules:
29+
- name: qt6-serialport
30+
buildsystem: cmake
31+
config-opts:
32+
- -DCMAKE_BUILD_TYPE=Release
33+
sources:
34+
- type: archive
35+
url: https://mirrors.20i.com/pub/qt.io/archive/qt/6.9/6.9.3/submodules/qtserialport-everywhere-src-6.9.3.tar.xz
36+
sha256: 4b18ec030ff2644698c3f5c776894d8ffe5d3174c964d9bd8668429c943e8298
37+
38+
- name: qt6-serialbus
39+
buildsystem: cmake
40+
config-opts:
41+
- -DCMAKE_BUILD_TYPE=Release
42+
- -DQT_FEATURE_socketcan=OFF
43+
sources:
44+
- type: archive
45+
url: https://mirrors.20i.com/pub/qt.io/archive/qt/6.9/6.9.3/submodules/qtserialbus-everywhere-src-6.9.3.tar.xz
46+
sha256: 0a8139da071afcb768b9d115f514a3e5783312530b2be69e3ee42b301d775bcf
47+
48+
- name: omodscan
49+
builddir: true
50+
buildsystem: simple
51+
build-commands:
52+
- cmake -DCMAKE_BUILD_TYPE=Release -B ../build
53+
- cmake --build ../build -- -j$(nproc)
54+
post-install:
55+
- install -D ../build/omodscan /app/bin/omodscan
56+
- install -Dm644 ../io.github.sanny32.omodscan.png -t /app/share/icons/hicolor/128x128/apps
57+
- install -Dm644 ../io.github.sanny32.omodscan.desktop -t /app/share/applications
58+
- install -Dm644 ../io.github.sanny32.omodscan.metainfo.xml -t /app/share/metainfo
59+
subdir: omodscan
60+
sources:
61+
- type: git
62+
url: https://github.com/sanny32/OpenModScan.git
63+
branch: main
64+
- type: file
65+
path: io.github.sanny32.omodscan.png
66+
- type: file
67+
path: io.github.sanny32.omodscan.desktop
68+
- type: file
69+
path: io.github.sanny32.omodscan.metainfo.xml
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
name: Build Debian package (Ubuntu x64, Qt5)
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch:
8+
inputs:
9+
branch:
10+
description: 'Checkout branch'
11+
required: false
12+
tag:
13+
description: 'Checkout tag'
14+
required: false
15+
16+
jobs:
17+
build-omodscan:
18+
name: Build OpenModScan deb package version '${{ github.event.inputs.tag || github.event.inputs.branch || github.ref_name }}' with Qt5
19+
runs-on: ubuntu-latest
20+
container:
21+
image: ubuntu:20.04
22+
23+
env:
24+
QT_VERSION: "5.15.2"
25+
QT_HOST: "linux"
26+
QT_TARGET: "desktop"
27+
QT_ARCH: "gcc_64"
28+
QT_INSTALL_DIR: "/opt/Qt"
29+
CMAKE_COMPILER: "gcc_64"
30+
CMAKE_GENERATOR: "Ninja"
31+
BUILD_TYPE: "Release"
32+
DEB_REVISION: "1"
33+
DEB_ARCH: "amd64"
34+
DEB_PACKAGE_NAME: "qt5-omodscan"
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
39+
with:
40+
ref: ${{ github.event.inputs.tag || github.event.inputs.branch || github.ref_name }}
41+
42+
- name: Extract version from CMakeLists.txt
43+
id: extract_version
44+
run: |
45+
FULL_VERSION=$(grep -oP 'VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' omodscan/CMakeLists.txt)
46+
47+
if [ "${GITHUB_REF_NAME}" = "dev" ] || [ "${{ github.event.inputs.branch }}" = "dev" ]; then
48+
MAJOR_MINOR=$(echo "$FULL_VERSION" | cut -d. -f1,2)
49+
APP_VERSION="${MAJOR_MINOR}~dev"
50+
else
51+
APP_VERSION="$FULL_VERSION"
52+
fi
53+
54+
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
55+
echo "Extracted version: $APP_VERSION"
56+
57+
- name: Install dependencies
58+
run: |
59+
export DEBIAN_FRONTEND=noninteractive
60+
apt-get update
61+
apt-get install -y \
62+
git build-essential ninja-build cmake python3-pip patchelf rsync \
63+
dh-make debhelper debhelper-compat lintian fakeroot \
64+
libglu1-mesa libgl1-mesa-dev libxkbcommon0 libxkbcommon-x11-0 \
65+
libxcb1 libxcb-xinerama0 libxcb-cursor0 libxcb-keysyms1 libxcb-xfixes0 \
66+
libxcb-shape0 libxcb-render-util0 libxcb-icccm4 libxcb-image0 \
67+
libfontconfig1 libfreetype6 libx11-6 libxext6 libxrender1 \
68+
zlib1g-dev libpng-dev libjpeg-dev libdbus-1-3 \
69+
libwayland-cursor0 libwayland-egl1-mesa \
70+
libgtk-3-0 libgdk-pixbuf2.0-0 libpangocairo-1.0-0 libpango-1.0-0 libatk1.0-0 libcairo2 libcairo-gobject2 \
71+
libcups2 \
72+
odbcinst libodbc1 \
73+
libpq5 libmysqlclient21
74+
75+
- name: Upgrade pip
76+
run: python3 -m pip install --upgrade pip
77+
78+
- name: Install aqtinstall
79+
run: python3 -m pip install aqtinstall
80+
81+
- name: Download Qt
82+
run: |
83+
mkdir -p ${{ env.QT_INSTALL_DIR }}
84+
aqt install-qt \
85+
${{ env.QT_HOST }} \
86+
${{ env.QT_TARGET }} \
87+
${{ env.QT_VERSION }} \
88+
${{ env.QT_ARCH }} \
89+
-O ${{ env.QT_INSTALL_DIR }}
90+
91+
- name: Add Qt to PATH
92+
run: echo "${{ env.QT_INSTALL_DIR }}/${{ env.QT_VERSION }}/${{ env.CMAKE_COMPILER }}/bin" >> $GITHUB_PATH
93+
94+
- name: Install cmake 3.26
95+
run: |
96+
apt-get remove -y cmake
97+
apt-get install -y wget
98+
wget https://github.com/Kitware/CMake/releases/download/v3.26.5/cmake-3.26.5-linux-x86_64.sh
99+
sh cmake-3.26.5-linux-x86_64.sh --skip-license --prefix=/usr/local
100+
cmake --version
101+
102+
- name: Set BUILD_DIR
103+
run: echo "BUILD_DIR=build-omodscan-Qt_${{ env.QT_VERSION }}_${{ env.CMAKE_COMPILER }}bit-${{ env.BUILD_TYPE }}" >> $GITHUB_ENV
104+
105+
- name: Configure project
106+
run: |
107+
cmake omodscan -B ${{ env.BUILD_DIR }} \
108+
-G "${{ env.CMAKE_GENERATOR }}" \
109+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
110+
-DCMAKE_PREFIX_PATH=${{ env.QT_INSTALL_DIR }}/${{ env.QT_VERSION }}/${{ env.CMAKE_COMPILER }}
111+
112+
- name: Build
113+
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }} --parallel
114+
115+
- name: Set BUILD_DEB_DIR
116+
run: echo "BUILD_DEB_DIR=build-deb-package-Qt_${{ env.QT_VERSION }}_${{ env.CMAKE_COMPILER }}bit" >> $GITHUB_ENV
117+
118+
- name: Set DEB_SRC_DIR
119+
run: echo "DEB_SRC_DIR=${{ env.BUILD_DEB_DIR }}/${{ env.DEB_PACKAGE_NAME }}-${{ env.APP_VERSION }}-${{ env.DEB_REVISION }}_${{ env.DEB_ARCH }}" >> $GITHUB_ENV
120+
121+
- name: Create DEB build directories
122+
run: |
123+
mkdir -p ${{ env.DEB_SRC_DIR }}/debian
124+
mkdir -p ${{ env.DEB_SRC_DIR }}/usr
125+
126+
- name: Copy files to DEB_SRC_DIR
127+
run: |
128+
cp -r .pkg/deb/* ${{ env.DEB_SRC_DIR }}/debian
129+
cp -r .pkg/usr/* ${{ env.DEB_SRC_DIR }}/usr
130+
131+
- name: Install cqtdeployer from sources
132+
run: |
133+
git clone https://github.com/QuasarApp/CQtDeployer.git
134+
cd CQtDeployer
135+
git checkout v1.6.2365
136+
git submodule update --init --recursive
137+
cmake -B build -DCMAKE_BUILD_TYPE=Release \
138+
-DCMAKE_PREFIX_PATH=${{ env.QT_INSTALL_DIR }}/${{ env.QT_VERSION }}/${{ env.CMAKE_COMPILER }} \
139+
-DBUILD_SHARED_LIBS=OFF \
140+
-DCQT_DEPLOYER_TESTS=OFF \
141+
-DCMAKE_INSTALL_PREFIX=/usr/local \
142+
-DCMAKE_INSTALL_RPATH=${{ env.QT_INSTALL_DIR }}/${{ env.QT_VERSION }}/${{ env.CMAKE_COMPILER }}/lib \
143+
-Wno-dev
144+
cmake --build build --parallel
145+
cmake --install build
146+
147+
- name: Bundle Qt libraries and plugins throught cqtdeployer
148+
run: |
149+
CQtDeployer -bin ${{ env.BUILD_DIR }}/omodscan \
150+
-targetDir ${{ env.DEB_SRC_DIR }}/opt/OpenModScan \
151+
-libDir ${{ env.QT_INSTALL_DIR }}/${{ env.QT_VERSION }}/${{ env.CMAKE_COMPILER }}/lib \
152+
-ignore libcrypto.so.3,libmysqlclient.so.21,libpq.so.5,libssl.so.3,libqsqlmimer.so,libqsqlmysql.so,libqsqlodbc.so,libqsqlpsql.so \
153+
-extraLibs icudata,icui18n,icuuc,libxcb-util
154+
155+
- name: Create Debian control file
156+
run: |
157+
sed -e "s|@PACKAGE_NAME@|${{ env.DEB_PACKAGE_NAME }}|g" \
158+
-e "s|@PACKAGE_SOURCE@|${{ env.DEB_PACKAGE_NAME }}|g" \
159+
${{ env.DEB_SRC_DIR }}/debian/control.in > ${{ env.DEB_SRC_DIR }}/debian/control
160+
rm ${{ env.DEB_SRC_DIR }}/debian/control.in
161+
cat -n ${{ env.DEB_SRC_DIR }}/debian/control
162+
163+
- name: Create Debian changelog file
164+
run: |
165+
sed -e "s|@PACKAGE_NAME@|${{ env.DEB_PACKAGE_NAME }}|g" \
166+
-e "s|@APP_VERSION@|${{ env.APP_VERSION }}|g" \
167+
-e "s|@DEB_REVISION@|${{ env.DEB_REVISION }}|g" \
168+
-e "s|@RELEASE_DATE@|$(date -R)|g" \
169+
${{ env.DEB_SRC_DIR }}/debian/changelog.in > ${{ env.DEB_SRC_DIR }}/debian/changelog
170+
rm ${{ env.DEB_SRC_DIR }}/debian/changelog.in
171+
cat -n ${{ env.DEB_SRC_DIR }}/debian/changelog
172+
173+
- name: Create Debian copyrigth file
174+
run: |
175+
sed -e "s|@PACKAGE_NAME@|${{ env.DEB_PACKAGE_NAME }}|g" \
176+
-e "s|@RELEASE_YEAR@|$(date +%Y)|g" \
177+
${{ env.DEB_SRC_DIR }}/debian/copyrigth.in > ${{ env.DEB_SRC_DIR }}/debian/copyrigth
178+
rm ${{ env.DEB_SRC_DIR }}/debian/copyrigth.in
179+
cat -n ${{ env.DEB_SRC_DIR }}/debian/copyrigth
180+
181+
- name: Create Debian rules file
182+
run: |
183+
sed -e "s|@QT_LIB_PATH@|${{ env.QT_INSTALL_DIR }}/${{ env.QT_VERSION }}/${{ env.CMAKE_COMPILER }}/lib|g" \
184+
${{ env.DEB_SRC_DIR }}/debian/rules.in > ${{ env.DEB_SRC_DIR }}/debian/rules
185+
rm ${{ env.DEB_SRC_DIR }}/debian/rules.in
186+
cat -n ${{ env.DEB_SRC_DIR }}/debian/rules
187+
188+
- name: Patch binary file
189+
run: patchelf --set-rpath /opt/OpenModScan/lib "${{ env.DEB_SRC_DIR }}/opt/OpenModScan/bin/omodscan"
190+
191+
- name: Build DEB package
192+
working-directory: ${{ env.DEB_SRC_DIR }}
193+
run: dpkg-buildpackage -us -uc -tc -b
194+
195+
- name: Upload DEB package
196+
uses: actions/upload-artifact@v4
197+
if: success()
198+
with:
199+
name: ${{ env.DEB_PACKAGE_NAME }}_${{ env.APP_VERSION }}-${{ env.DEB_REVISION }}_${{ env.DEB_ARCH }}
200+
path: ${{ env.BUILD_DEB_DIR }}/${{ env.DEB_PACKAGE_NAME }}_${{ env.APP_VERSION }}-${{ env.DEB_REVISION }}_${{ env.DEB_ARCH }}.deb

0 commit comments

Comments
 (0)