Skip to content

Commit 3d55a4b

Browse files
committed
merge: bring distro hardening into dev
2 parents f4a7f15 + 37995a8 commit 3d55a4b

70 files changed

Lines changed: 11168 additions & 1188 deletions

Some content is hidden

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

.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* @Project-Ro-ASD
2+
3+
/src/backend/ @Project-Ro-ASD
4+
/src/qml/ @Project-Ro-ASD
5+
/docs/ @Project-Ro-ASD
6+
/packaging/ @Project-Ro-ASD

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ jobs:
1717
build:
1818
name: Build & Test
1919
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
fedora: [41, 42]
2024
container:
21-
image: fedora:41
25+
image: fedora:${{ matrix.fedora }}
2226

2327
steps:
2428
- name: Checkout repository
@@ -52,7 +56,7 @@ jobs:
5256
run: cmake --build build --parallel
5357

5458
- name: Run tests
55-
run: cd build && ctest --output-on-failure
59+
run: ctest --test-dir build --output-on-failure
5660

5761
- name: Check formatting (clang-format)
5862
run: |
@@ -63,7 +67,7 @@ jobs:
6367
name: RPM Build Check
6468
runs-on: ubuntu-latest
6569
container:
66-
image: fedora:41
70+
image: fedora:42
6771

6872
steps:
6973
- name: Checkout repository

.github/workflows/release.yml

Lines changed: 76 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,36 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
release:
11-
name: Create GitHub Release
10+
artifacts:
11+
name: Build Release Artifacts
1212
runs-on: ubuntu-latest
13+
container:
14+
image: fedora:42
1315

1416
permissions:
15-
contents: write
17+
contents: read
1618

1719
steps:
1820
- name: Checkout repository
1921
uses: actions/checkout@v4
2022

23+
- name: Install packaging dependencies
24+
run: |
25+
dnf install -y \
26+
git \
27+
rpm-build \
28+
cmake \
29+
extra-cmake-modules \
30+
gcc-c++ \
31+
ninja-build \
32+
qt6-qtbase-devel \
33+
qt6-qtbase-private-devel \
34+
qt6-qtdeclarative-devel \
35+
qt6-qttools-devel \
36+
qt6-qtwayland-devel \
37+
kf6-qqc2-desktop-style \
38+
polkit-devel
39+
2140
- name: Derive release version
2241
run: |
2342
VERSION="${GITHUB_REF_NAME#v}"
@@ -29,10 +48,62 @@ jobs:
2948
git archive --format=tar.gz --prefix="${PREFIX}/" --output="${PREFIX}.tar.gz" "${GITHUB_SHA}"
3049
git archive --format=zip --prefix="${PREFIX}/" --output="${PREFIX}.zip" "${GITHUB_SHA}"
3150
51+
- name: Build RPM artifacts
52+
run: |
53+
mkdir -p ~/rpmbuild/SOURCES ~/rpmbuild/SPECS
54+
cp "ro-control-${VERSION}.tar.gz" "${HOME}/rpmbuild/SOURCES/"
55+
cp packaging/rpm/ro-control.spec "${HOME}/rpmbuild/SPECS/ro-control.spec"
56+
rpmbuild -ba "${HOME}/rpmbuild/SPECS/ro-control.spec" \
57+
--define "_topdir ${HOME}/rpmbuild"
58+
cp ~/rpmbuild/SRPMS/*.src.rpm .
59+
cp ~/rpmbuild/RPMS/*/*.rpm .
60+
61+
- name: Generate checksums
62+
run: |
63+
sha256sum \
64+
"ro-control-${VERSION}.tar.gz" \
65+
"ro-control-${VERSION}.zip" \
66+
*.rpm \
67+
*.src.rpm > "ro-control-${VERSION}-SHA256SUMS.txt"
68+
69+
- name: Upload release artifacts
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: ro-control-release-${{ env.VERSION }}
73+
path: |
74+
ro-control-${{ env.VERSION }}.tar.gz
75+
ro-control-${{ env.VERSION }}.zip
76+
*.rpm
77+
*.src.rpm
78+
ro-control-${{ env.VERSION }}-SHA256SUMS.txt
79+
80+
release:
81+
name: Create GitHub Release
82+
runs-on: ubuntu-latest
83+
needs: artifacts
84+
85+
permissions:
86+
contents: write
87+
88+
steps:
89+
- name: Derive release version
90+
run: |
91+
VERSION="${GITHUB_REF_NAME#v}"
92+
echo "VERSION=${VERSION}" >> "${GITHUB_ENV}"
93+
94+
- name: Download release artifacts
95+
uses: actions/download-artifact@v4
96+
with:
97+
name: ro-control-release-${{ env.VERSION }}
98+
path: dist
99+
32100
- name: Publish release
33101
uses: softprops/action-gh-release@v2
34102
with:
35103
generate_release_notes: true
36104
files: |
37-
ro-control-${{ env.VERSION }}.tar.gz
38-
ro-control-${{ env.VERSION }}.zip
105+
dist/ro-control-${{ env.VERSION }}.tar.gz
106+
dist/ro-control-${{ env.VERSION }}.zip
107+
dist/*.rpm
108+
dist/*.src.rpm
109+
dist/ro-control-${{ env.VERSION }}-SHA256SUMS.txt

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Build directories
22
build/
33
build-*/
4+
src/build-*/
45
cmake-build-*/
56
out/
67

@@ -54,6 +55,9 @@ CMakeLists.txt.user
5455
*.tar.gz
5556
*.tar.xz
5657
*.AppImage
58+
packaging/rpm/.ccache/
59+
packaging/rpm/rpmbuild/
60+
packaging/rpm/rpmbuild-*/
5761

5862
# Logs
5963
*.log

CMakeLists.txt

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ set(CMAKE_AUTOUIC ON)
3131

3232
find_package(Qt6 REQUIRED COMPONENTS
3333
Core
34+
Qml
3435
Quick # Qt Quick / QML engine
3536
QuickControls2 # QML controls (Button, Slider, etc.)
3637
Widgets # QApplication base
@@ -70,15 +71,45 @@ set(BACKEND_SOURCES
7071
src/backend/system/polkit.cpp
7172
src/backend/system/dnfmanager.cpp
7273
src/backend/system/commandrunner.cpp
74+
src/backend/system/sessionutil.cpp
75+
src/backend/system/capabilityprobe.cpp
76+
src/backend/system/languagemanager.cpp
77+
src/backend/system/uipreferencesmanager.cpp
7378
)
7479

7580
set(APP_SOURCES
7681
src/main.cpp
7782
src/cli/cli.cpp
78-
${BACKEND_SOURCES}
7983
)
8084

8185
# ─── QML Resources ────────────────────────────────────────────────────────────
86+
add_library(ro-control-backend STATIC ${BACKEND_SOURCES})
87+
88+
target_link_libraries(ro-control-backend PUBLIC
89+
Qt6::Core
90+
Qt6::DBus
91+
Qt6::Qml
92+
)
93+
94+
target_compile_options(ro-control-backend PRIVATE
95+
-Wall
96+
-Wextra
97+
-Wpedantic
98+
$<$<CONFIG:Debug>:-g -O0>
99+
$<$<CONFIG:Release>:-O2>
100+
)
101+
102+
target_include_directories(ro-control-backend PUBLIC
103+
${CMAKE_CURRENT_SOURCE_DIR}/src
104+
${CMAKE_CURRENT_SOURCE_DIR}/src/backend
105+
)
106+
107+
target_compile_definitions(ro-control-backend PUBLIC
108+
RO_CONTROL_POLICY_ID="${RO_CONTROL_POLICY_ID}"
109+
RO_CONTROL_HELPER_BUILD_PATH="${RO_CONTROL_HELPER_BUILD_PATH}"
110+
RO_CONTROL_HELPER_INSTALL_PATH="${RO_CONTROL_HELPER_INSTALL_PATH}"
111+
)
112+
82113
qt_add_executable(ro-control ${APP_SOURCES})
83114

84115
set_source_files_properties(src/qml/assets/ro-control-logo.svg PROPERTIES
@@ -97,6 +128,11 @@ qt_add_qml_module(ro-control
97128
src/qml/pages/DriverPage.qml
98129
src/qml/pages/MonitorPage.qml
99130
src/qml/pages/SettingsPage.qml
131+
src/qml/components/InfoBadge.qml
132+
src/qml/components/ActionButton.qml
133+
src/qml/components/DetailRow.qml
134+
src/qml/components/SectionPanel.qml
135+
src/qml/components/StatusBanner.qml
100136
src/qml/components/StatCard.qml
101137
src/qml/components/SidebarMenu.qml
102138
RESOURCES
@@ -105,8 +141,11 @@ qt_add_qml_module(ro-control
105141
)
106142

107143
if(Qt6LinguistTools_FOUND)
144+
# English strings ship directly from source code. Keep the English TS file
145+
# for catalog maintenance, but only compile non-source locales into .qm.
108146
set(TS_FILES
109-
i18n/ro-control_en.ts
147+
i18n/ro-control_de.ts
148+
i18n/ro-control_es.ts
110149
i18n/ro-control_tr.ts
111150
)
112151

@@ -118,11 +157,10 @@ endif()
118157

119158
# ─── Link Qt Libraries ────────────────────────────────────────────────────────
120159
target_link_libraries(ro-control PRIVATE
121-
Qt6::Core
122160
Qt6::Quick
123161
Qt6::QuickControls2
124162
Qt6::Widgets
125-
Qt6::DBus
163+
ro-control-backend
126164
)
127165

128166
# ─── Compiler Warnings ────────────────────────────────────────────────────────
@@ -152,8 +190,6 @@ target_include_directories(ro-control PRIVATE
152190

153191
target_compile_definitions(ro-control PRIVATE
154192
RO_CONTROL_POLICY_ID="${RO_CONTROL_POLICY_ID}"
155-
RO_CONTROL_HELPER_BUILD_PATH="${RO_CONTROL_HELPER_BUILD_PATH}"
156-
RO_CONTROL_HELPER_INSTALL_PATH="${RO_CONTROL_HELPER_INSTALL_PATH}"
157193
)
158194

159195
configure_file(
@@ -162,6 +198,7 @@ configure_file(
162198
@ONLY
163199
NEWLINE_STYLE UNIX
164200
)
201+
execute_process(COMMAND chmod +x ${RO_CONTROL_HELPER_BUILD_PATH})
165202

166203
configure_file(
167204
data/polkit/io.github.ProjectRoASD.rocontrol.policy.in
@@ -179,7 +216,7 @@ install(PROGRAMS ${RO_CONTROL_HELPER_BUILD_PATH}
179216
RENAME ${RO_CONTROL_HELPER_NAME}
180217
)
181218

182-
install(FILES data/icons/ro-control.desktop
219+
install(FILES data/icons/io.github.projectroasd.rocontrol.desktop
183220
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
184221
)
185222

@@ -193,7 +230,7 @@ install(FILES
193230
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/256x256/apps
194231
)
195232

196-
install(FILES data/icons/ro-control.metainfo.xml
233+
install(FILES data/icons/io.github.projectroasd.rocontrol.metainfo.xml
197234
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo
198235
)
199236

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ cd build && ctest --output-on-failure
143143

144144
**PRs to `main` will be rejected.** All contributions go through `dev` first.
145145

146+
Recommended PR checklist:
147+
148+
- Keep scope focused to one feature/fix/theme
149+
- Update docs when user-visible behavior changes
150+
- Update translations when adding or changing UI strings
151+
- Include before/after screenshots for UI changes
152+
- Run `ctest --test-dir build --output-on-failure` locally
153+
146154
---
147155

148156
## Translations
@@ -186,3 +194,5 @@ Use the [bug report template](.github/ISSUE_TEMPLATE/bug_report.md) and include:
186194
- Steps to reproduce
187195
- Expected vs actual behavior
188196
- Relevant terminal output, `coredumpctl info ro-control`, or recent journal entries
197+
198+
For general setup questions, diagnostics help, or uncertainty about whether something is a bug, start with [SUPPORT.md](SUPPORT.md).

0 commit comments

Comments
 (0)