Skip to content

Commit ef14792

Browse files
authored
Merge pull request #92 from josevcm/develop
switch to NSIS installer and add portable package
2 parents 257b47d + 9bac6b6 commit ef14792

29 files changed

+638
-1110
lines changed

.github/workflows/cmake-build.yml

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,9 @@ jobs:
8686
echo "ninja-dir=${{ github.workspace }}/tools/ninja" >> "$GITHUB_OUTPUT"
8787
echo "cmake-dir=${{ github.workspace }}/tools/cmake_64" >> "$GITHUB_OUTPUT"
8888
echo "mingw-dir=${{ github.workspace }}/tools/mingw1310_64" >> "$GITHUB_OUTPUT"
89-
echo "installer-dir=${{ github.workspace }}/tools/QtInstallerFramework/4.7" >> "$GITHUB_OUTPUT"
9089
echo "package-dir=${{ github.workspace }}/build/installer/package" >> "$GITHUB_OUTPUT"
91-
echo "package-data-dir=${{ github.workspace }}/build/installer/package/org.josevcm.nfc-lab/data" >> "$GITHUB_OUTPUT"
92-
echo "package-meta-dir=${{ github.workspace }}/build/installer/package/org.josevcm.nfc-lab/meta" >> "$GITHUB_OUTPUT"
90+
echo "installer-data-dir=${{ github.workspace }}/build/installer/data" >> "$GITHUB_OUTPUT"
91+
echo "installer-meta-dir=${{ github.workspace }}/build/installer/meta" >> "$GITHUB_OUTPUT"
9392
echo "cpu-count=4" >> "$GITHUB_OUTPUT"
9493
9594
- name: 'Cache dependencies'
@@ -104,12 +103,16 @@ jobs:
104103
- name: 'Install dependencies'
105104
if: steps.cache-dependencies.outputs.cache-hit != 'true'
106105
run: |
106+
# install Qt and build tools
107107
choco install aqt -y --no-progress -r
108108
aqt install-qt windows desktop 6.7.2 win64_mingw --outputdir ${{ github.workspace }}/qt
109109
aqt install-tool windows desktop tools_mingw1310 qt.tools.win64_mingw1310 --outputdir ${{ github.workspace }}
110110
aqt install-tool windows desktop tools_cmake qt.tools.cmake --outputdir ${{ github.workspace }}
111111
aqt install-tool windows desktop tools_ninja qt.tools.ninja --outputdir ${{ github.workspace }}
112-
aqt install-tool windows desktop tools_ifw qt.tools.ifw.47 --outputdir ${{ github.workspace }}
112+
113+
- name: 'Install NSIS'
114+
run: |
115+
choco install nsis.portable -y --no-progress -r
113116
114117
- name: 'Build project'
115118
run: |
@@ -130,25 +133,23 @@ jobs:
130133
- name: 'Create installer'
131134
run: |
132135
# create installer folders
133-
New-Item -Force -ItemType "directory" -Path ${{ steps.strings-windows.outputs.package-data-dir }}
134-
New-Item -Force -ItemType "directory" -Path ${{ steps.strings-windows.outputs.package-meta-dir }}
136+
New-Item -Force -ItemType "directory" -Path ${{ steps.strings-windows.outputs.installer-data-dir }}
137+
New-Item -Force -ItemType "directory" -Path ${{ steps.strings-windows.outputs.installer-meta-dir }}
135138
136139
# copy executable and libraries
137-
Copy-Item -Force ${{ steps.strings-windows.outputs.build-dir }}/src/nfc-app/app-qt/nfc-lab.exe ${{ steps.strings-windows.outputs.package-data-dir }}
138-
Copy-Item -Force ${{ steps.strings-windows.outputs.mingw-dir }}/bin/*.dll ${{ steps.strings-windows.outputs.package-data-dir }}
139-
Copy-Item -Force ${{ github.workspace }}/dll/airspy/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.package-data-dir }}
140-
Copy-Item -Force ${{ github.workspace }}/dll/hydrasdr/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.package-data-dir }}
141-
Copy-Item -Force ${{ github.workspace }}/dll/openssl/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.package-data-dir }}
142-
Copy-Item -Force ${{ github.workspace }}/dll/rtlsdr/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.package-data-dir }}
143-
Copy-Item -Force ${{ github.workspace }}/dll/usb/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.package-data-dir }}
144-
145-
# copy drivers and firmware
146-
Copy-Item -Force -Recurse ${{ github.workspace }}/dat/config ${{ steps.strings-windows.outputs.package-data-dir }}
147-
Copy-Item -Force -Recurse ${{ github.workspace }}/dat/drivers ${{ steps.strings-windows.outputs.package-data-dir }}
148-
Copy-Item -Force -Recurse ${{ github.workspace }}/dat/firmware ${{ steps.strings-windows.outputs.package-data-dir }}
140+
Copy-Item -Force ${{ steps.strings-windows.outputs.build-dir }}/src/nfc-app/app-qt/nfc-lab.exe ${{ steps.strings-windows.outputs.installer-data-dir }}
141+
Copy-Item -Force ${{ steps.strings-windows.outputs.mingw-dir }}/bin/*.dll ${{ steps.strings-windows.outputs.installer-data-dir }}
142+
Copy-Item -Force ${{ github.workspace }}/dll/airspy/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.installer-data-dir }}
143+
Copy-Item -Force ${{ github.workspace }}/dll/hydrasdr/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.installer-data-dir }}
144+
Copy-Item -Force ${{ github.workspace }}/dll/openssl/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.installer-data-dir }}
145+
Copy-Item -Force ${{ github.workspace }}/dll/rtlsdr/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.installer-data-dir }}
146+
Copy-Item -Force ${{ github.workspace }}/dll/usb/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.installer-data-dir }}
149147
150-
# copy installer resources
151-
Copy-Item -Force ${{ steps.strings-windows.outputs.build-dir }}/installer/config/*.* ${{ steps.strings-windows.outputs.package-meta-dir }}
148+
# copy drivers, firmware and installer resources
149+
Copy-Item -Force -Recurse ${{ github.workspace }}/dat/config ${{ steps.strings-windows.outputs.installer-data-dir }}
150+
Copy-Item -Force -Recurse ${{ github.workspace }}/dat/drivers ${{ steps.strings-windows.outputs.installer-data-dir }}
151+
Copy-Item -Force -Recurse ${{ github.workspace }}/dat/firmware ${{ steps.strings-windows.outputs.installer-data-dir }}
152+
Copy-Item -Force -Recurse ${{ github.workspace }}/dat/resources ${{ steps.strings-windows.outputs.installer-meta-dir }}
152153
153154
# create deployment
154155
${{ steps.strings-windows.outputs.qt-dir }}/bin/windeployqt `
@@ -157,20 +158,23 @@ jobs:
157158
--no-translations `
158159
--no-system-d3d-compiler `
159160
--no-opengl-sw `
160-
${{ steps.strings-windows.outputs.package-data-dir }}/nfc-lab.exe
161-
161+
${{ steps.strings-windows.outputs.installer-data-dir }}/nfc-lab.exe
162+
163+
# create portable package
164+
Compress-Archive `
165+
-Path ${{ steps.strings-windows.outputs.installer-data-dir }}/* `
166+
-DestinationPath ${{ github.workspace }}/nfc-lab-${{ steps.strings-windows.outputs.build-version }}-x86_64-portable.zip
167+
162168
# create installer
163-
${{ steps.strings-windows.outputs.installer-dir }}/bin/binarycreator `
164-
--verbose `
165-
-c ${{ steps.strings-windows.outputs.build-dir }}/installer/config/config.xml `
166-
-p ${{ steps.strings-windows.outputs.package-dir }} `
167-
nfc-lab-${{ steps.strings-windows.outputs.build-version }}-x86_64.exe
169+
makensis ${{ steps.strings-windows.outputs.installer-meta-dir }}/script.nsi
168170
169171
- name: 'Upload artifact'
170172
uses: actions/upload-artifact@v4
171173
with:
172174
name: windows-artifact
173-
path: ${{ github.workspace }}/*.exe
175+
path: |
176+
${{ github.workspace }}/*.exe
177+
${{ github.workspace }}/*.zip
174178
175179
#
176180
# Create release job
@@ -230,17 +234,15 @@ jobs:
230234
# WinGet release job
231235
#
232236
winget-release:
233-
234237
runs-on: windows-latest
235238
needs: create-release
236-
if: github.ref_type == 'tag'
237-
239+
# if: github.ref_type == 'tag'
240+
if: false
238241
steps:
239-
240242
- name: 'WinGet Releaser'
241243
uses: vedantmgoyal9/winget-releaser@v2
242244
with:
243245
identifier: josevcm.nfc-lab
244-
installers-regex: 'nfc-lab-.*-x86_64\.exe$'
246+
installers-regex: 'nfc-lab-.*-x86_64-portable\.zip$'
245247
token: ${{ secrets.WINGET_TOKEN }}
246248
fork-user: josevcm

.github/workflows/flatpak-build.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
name: Flatpak CI
1+
name: Flatpak CI (DISABLED)
22

3+
# DISABLED: The Flatpak manifest (io.github.josevcm.nfc-laboratory.yml) now lives in the Flathub repository.
4+
# Flatpak builds are handled there instead of in this repository.
35
on:
4-
pull_request:
5-
paths:
6-
- 'io.github.josevcm.nfc-laboratory.yml'
7-
- 'dat/flatpak/**'
8-
- 'flatpak-build.yml'
9-
push:
10-
tags:
11-
- '*' # any tag
12-
paths:
13-
- 'io.github.josevcm.nfc-laboratory.yml'
14-
- 'dat/flatpak/**'
15-
- 'flatpak-build.yml'
6+
workflow_dispatch:
167

178
jobs:
189
validate-metadata:

.github/workflows/flatpak-update-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Check Flatpak Updates
1+
name: Check Flatpak Updates (DISABLED)
22

3+
# DISABLED: The Flatpak manifest (io.github.josevcm.nfc-laboratory.yml) now lives in the Flathub repository.
4+
# Update checks should be done in that repository instead.
35
on:
4-
schedule:
5-
- cron: '0 0 * * 0' # Weekly on Sunday at midnight UTC
66
workflow_dispatch:
77

88
jobs:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
/run/
55
src/nfc-app/app-qt/src/main/cpp/QtConfig.h
66
/build
7+
/build-*
8+
*.exe
9+
*-x86_64-portable.zip
710
/nfc-lab
811
.flatpak-builder/
912
build-dir/

CMakeLists.txt

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
55
set(COMPANY "Jose Vicente Campos")
66
set(PROGRAM_NAME "nfc-lab")
77
set(ICON_FILE_PATH "../assets/app/rc/nfc-lab.ico")
8-
set(APP_TARGET_DIR "@HomeDir@/.${PROGRAM_NAME}")
8+
set(APP_TARGET_DIR "@HomeDir@/AppData/Local/josevcm/${PROGRAM_NAME}")
99

1010
if(NOT DEFINED BUILD_PROJECT_VERSION)
1111
set(BUILD_PROJECT_VERSION "0.0.0")
@@ -99,21 +99,32 @@ else ()
9999
message(STATUS "librtlsdr not found, using local bundle in static mode")
100100
endif()
101101

102+
#-------------------------------------------------------------------------------
103+
# find dependency mirisdr
104+
#-------------------------------------------------------------------------------
105+
find_package(libmirisdr)
106+
107+
if(LIBMIRISDR_FOUND)
108+
message(STATUS "libmirisdr: found and using dynamic link mode")
109+
message(STATUS " include: " ${LIBMIRISDR_INCLUDE})
110+
message(STATUS " library: " ${LIBMIRISDR_LIBRARY})
111+
include_directories(${LIBMIRISDR_INCLUDE})
112+
else ()
113+
message(STATUS "libmirisdr not found, using local bundle in static mode")
114+
endif()
115+
102116
#-------------------------------------------------------------------------------
103117
# configure files
104118
#-------------------------------------------------------------------------------
105119

106120
if (WIN32)
107121

108-
# generate build scripts
122+
# generate manual build scripts
109123
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/scripts/build-runenv.ps1.in ${CMAKE_CURRENT_BINARY_DIR}/build-runenv.ps1)
110124
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/scripts/build-installer.ps1.in ${CMAKE_CURRENT_BINARY_DIR}/build-installer.ps1)
111125

112-
# generate build scripts
113-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/installer/config.xml.in ${CMAKE_CURRENT_BINARY_DIR}/installer/config/config.xml)
114-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/installer/package.xml.in ${CMAKE_CURRENT_BINARY_DIR}/installer/config/package.xml)
115-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/installer/license.txt.in ${CMAKE_CURRENT_BINARY_DIR}/installer/config/license.txt)
116-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/installer/script.js.in ${CMAKE_CURRENT_BINARY_DIR}/installer/config/script.js)
126+
# generate installer scripts
127+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dat/installer/script.nsi.in ${CMAKE_CURRENT_BINARY_DIR}/installer/meta/script.nsi)
117128

118129
endif (WIN32)
119130

FLATPAK.md

Lines changed: 22 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,47 @@
1-
# Flatpak Integration
1+
# Flatpak Distribution
22

3-
NFC Laboratory is available as a Flatpak package for Linux systems.
3+
NFC Laboratory is available as a Flatpak package on Flathub.
44

5-
## Quick Install (from Flathub)
6-
7-
Once published on Flathub:
5+
## Install
86

97
```bash
108
flatpak install flathub io.github.josevcm.nfc-laboratory
119
flatpak run io.github.josevcm.nfc-laboratory
1210
```
1311

14-
## Local Build
15-
16-
### Prerequisites
17-
18-
```bash
19-
sudo apt install flatpak flatpak-builder
20-
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
21-
flatpak install flathub org.kde.Platform//6.8 org.kde.Sdk//6.8
22-
```
23-
24-
**Note:** Runtime version 6.8 is the current stable version. Check available versions:
25-
26-
```bash
27-
flatpak remote-info flathub org.kde.Platform | grep Branch
28-
```
29-
30-
### Build and Install
31-
32-
```bash
33-
flatpak-builder --user --install --force-clean build-dir io.github.josevcm.nfc-laboratory.yml
34-
```
12+
## Hardware Access
3513

36-
### Run
14+
USB access for SDR receivers and logic analyzers:
3715

3816
```bash
39-
flatpak run io.github.josevcm.nfc-laboratory
17+
sudo usermod -a -G plugdev $USER # Add user to plugdev group
18+
# Install device-specific udev rules
19+
# Log out and back in
4020
```
4121

42-
## Validation
22+
## Configuration
4323

44-
```bash
45-
# Standard validation
46-
appstreamcli validate --pedantic dat/flatpak/io.github.josevcm.nfc-laboratory.metainfo.xml
47-
desktop-file-validate dat/flatpak/io.github.josevcm.nfc-laboratory.desktop
24+
User data stored in: `~/.var/app/io.github.josevcm.nfc-laboratory/.nfc-lab/`
4825

49-
# Flatpak-builder lint (optional, for Flathub submission)
50-
flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest io.github.josevcm.nfc-laboratory.yml
51-
flatpak run --command=flatpak-builder-lint org.flatpak.Builder appstream dat/flatpak/io.github.josevcm.nfc-laboratory.metainfo.xml
52-
```
26+
## Building Locally
5327

54-
## Testing
28+
The project uses a universal build system that supports both normal and Flatpak builds:
5529

5630
```bash
57-
# Test flags
58-
flatpak run io.github.josevcm.nfc-laboratory --help
59-
flatpak run io.github.josevcm.nfc-laboratory --version
60-
61-
# Check library dependencies
62-
flatpak run --command=sh io.github.josevcm.nfc-laboratory -c "ldd /app/bin/nfc-lab | grep 'not found'"
63-
64-
# Build with local repository (for testing installation)
65-
flatpak-builder --force-clean --repo=repo build-dir io.github.josevcm.nfc-laboratory.yml
66-
flatpak --user remote-add --no-gpg-verify test-repo repo
67-
flatpak --user install test-repo io.github.josevcm.nfc-laboratory
31+
# Normal build (installs as 'nfc-lab')
32+
cmake -B build -DCMAKE_BUILD_TYPE=Release
33+
cmake --build build
6834

69-
# Lint build artifacts (may show screenshot warnings - acceptable)
70-
flatpak run --command=flatpak-builder-lint org.flatpak.Builder builddir build-dir
71-
flatpak run --command=flatpak-builder-lint org.flatpak.Builder repo repo
35+
# Flatpak build (installs as 'io.github.josevcm.nfc-laboratory')
36+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DFLATPAK_BUILD=ON
37+
cmake --build build
7238
```
7339

74-
## Hardware Access
75-
76-
The Flatpak requires USB access for SDR receivers and logic analyzers:
77-
78-
1. Add user to plugdev group:
79-
80-
```bash
81-
sudo usermod -a -G plugdev $USER
82-
```
83-
84-
2. Install udev rules for your hardware (device-specific)
85-
86-
3. Log out and log back in
40+
The Flatpak manifest is maintained in the [Flathub repository](https://github.com/flathub/io.github.josevcm.nfc-laboratory).
8741

88-
## File Structure
42+
## Metadata Files
8943

90-
- `io.github.josevcm.nfc-laboratory.yml` - Flatpak manifest
44+
Flatpak metadata is located in:
9145
- `dat/flatpak/io.github.josevcm.nfc-laboratory.metainfo.xml` - AppStream metadata
9246
- `dat/flatpak/io.github.josevcm.nfc-laboratory.desktop` - Desktop entry
93-
- `dat/flatpak/README.md` - Additional documentation
94-
95-
## Configuration
96-
97-
User configuration is stored in:
98-
99-
```
100-
~/.var/app/io.github.josevcm.nfc-laboratory/.nfc-lab/
101-
```
102-
103-
## Support
104-
105-
For issues specific to the Flatpak package, please report at:
106-
<https://github.com/josevcm/nfc-laboratory/issues>
47+
- `src/nfc-app/app-qt/src/main/assets/app/rc/` - Files installed during build

cmake/Findlibmirisdr.cmake

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
if (LIBMIRISDR_LIBRARY AND LIBMIRISDR_INCLUDE)
3+
set(LIBMIRISDR_FOUND TRUE)
4+
else (LIBMIRISDR_LIBRARY AND LIBMIRISDR_INCLUDE)
5+
6+
find_path(LIBMIRISDR_INCLUDE
7+
NAMES
8+
mirisdr.h
9+
PATHS
10+
/usr/include
11+
/usr/local/include
12+
/opt/local/include
13+
PATH_SUFFIXES
14+
libmirisdr
15+
)
16+
17+
find_library(LIBMIRISDR_LIBRARY
18+
NAMES
19+
mirisdr
20+
PATHS
21+
/usr/local/lib64
22+
/opt/local/lib64
23+
/usr/lib64
24+
/usr/local/lib
25+
/opt/local/lib
26+
/usr/lib
27+
)
28+
29+
if (LIBMIRISDR_INCLUDE AND LIBMIRISDR_LIBRARY)
30+
set(LIBMIRISDR_FOUND TRUE)
31+
else ()
32+
set(LIBMIRISDR_LIBRARY "mirisdr")
33+
endif ()
34+
35+
endif (LIBMIRISDR_LIBRARY AND LIBMIRISDR_INCLUDE)
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
[Desktop Entry]
22
Type=Application
33
Name=NFC Laboratory
4-
GenericName=NFC Signal and Protocol Analyzer
5-
Comment=NFC signal sniffer and protocol decoder using SDR receiver
4+
GenericName=NFC signal and protocol analyzer
5+
Comment=NFC signal and protocol analyzer using SDR receiver
66
Exec=nfc-lab
77
Terminal=false
88
Icon=io.github.josevcm.nfc-laboratory
99
Categories=Science;Engineering;
10-
Keywords=NFC;SDR;Radio;Protocol;Analyzer;SignalProcessing;ISO14443;ISO15693;RFID;
11-
StartupNotify=true
12-
StartupWMClass=nfc-lab
10+
Keywords=NFC;SDR;Radio;protocol analyzer;signal decoder;RTL-SDR;AirSpy;HydraSDR;ISO14443;ISO15693;ISO7816;RFID;smart card;

0 commit comments

Comments
 (0)