Skip to content

Commit 64eb058

Browse files
authored
Merge pull request #10 from arch-linux-gui/qt6/c++
Qt6/c++
2 parents a25e616 + 35b6b8d commit 64eb058

File tree

108 files changed

+5494
-10496
lines changed

Some content is hidden

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

108 files changed

+5494
-10496
lines changed

.clang-format

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
BasedOnStyle: WebKit
2+
3+
AlignAfterOpenBracket: Align
4+
AlignEscapedNewlines: DontAlign
5+
AllowAllParametersOfDeclarationOnNextLine: "false"
6+
AllowShortFunctionsOnASingleLine: Inline
7+
AllowShortIfStatementsOnASingleLine: "false"
8+
AllowShortLambdasOnASingleLine: All
9+
AllowShortLoopsOnASingleLine: "false"
10+
AlwaysBreakAfterReturnType: TopLevelDefinitions
11+
AlwaysBreakTemplateDeclarations: Yes
12+
BinPackArguments: "false"
13+
BinPackParameters: "false"
14+
BreakBeforeBraces: Allman
15+
BreakBeforeTernaryOperators: "true"
16+
BreakConstructorInitializers: BeforeComma
17+
ColumnLimit: 120
18+
Cpp11BracedListStyle: "false"
19+
FixNamespaceComments: "true"
20+
IncludeBlocks: Preserve
21+
IndentWidth: "4"
22+
InsertBraces: "true"
23+
MaxEmptyLinesToKeep: "2"
24+
NamespaceIndentation: None
25+
PointerAlignment: Left
26+
ReflowComments: "false"
27+
SortIncludes: "true"
28+
SpaceAfterCStyleCast: "false"
29+
SpaceInEmptyBlock: "false"
30+
SpacesBeforeTrailingComments: "2"
31+
SpacesInAngles: "true"
32+
SpacesInParentheses: "true"
33+
SpacesInSquareBrackets: "true"
34+
Standard: c++17

.github/workflows/build.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build ALG App Store
2+
3+
on:
4+
push:
5+
branches: [ "main", "qt6/c++" ]
6+
pull_request:
7+
branches: [ "main", "qt6/c++" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Install dependencies
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y \
22+
build-essential \
23+
cmake \
24+
qt6-base-dev \
25+
qt6-tools-dev \
26+
qt6-tools-dev-tools \
27+
libalpm-dev \
28+
libarchive-dev \
29+
libcurl4-openssl-dev \
30+
pkg-config
31+
32+
- name: Configure CMake
33+
run: |
34+
mkdir -p build
35+
cd build
36+
cmake ..
37+
38+
- name: Build
39+
run: |
40+
cd build
41+
make -j$(nproc)
42+
43+
- name: Check build artifacts
44+
run: |
45+
ls -lh build/alg-app-store
46+
file build/alg-app-store
47+
48+
- name: Upload build artifact
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: alg-app-store
52+
path: build/alg-app-store
53+
retention-days: 7

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Qt/C++ Build artifacts
2+
build/
3+
*.o
4+
*.so
5+
*.a
6+
*.user
7+
*.autosave
8+
moc_*.cpp
9+
qrc_*.cpp
10+
ui_*.h
11+
12+
# CMake
13+
CMakeCache.txt
14+
CMakeFiles/
15+
cmake_install.cmake
16+
Makefile
17+
18+
# Qt Creator
19+
*.pro.user
20+
*.pro.user.*
21+
22+
# Executable
23+
alg-app-store
24+
25+
# IDE
26+
.vscode/
27+
.idea/
28+
*.swp
29+
*.swo
30+
*~
31+
32+
# Compiled Object files
33+
*.obj
34+
35+
# Precompiled Headers
36+
*.gch
37+
*.pch
38+
39+
# Debug files
40+
*.dSYM/
41+
*.su
42+
*.idb
43+
*.pdb
44+
45+
# OS specific
46+
.DS_Store
47+
Thumbs.db
48+
49+
# Backup files
50+
*~
51+
*.bak
52+
*.backup

CMakeLists.txt

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
project(alg-app-store VERSION 2.0.0 LANGUAGES CXX)
4+
5+
set(CMAKE_CXX_STANDARD 17)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
set(CMAKE_AUTOMOC ON)
8+
set(CMAKE_AUTORCC ON)
9+
set(CMAKE_AUTOUIC ON)
10+
11+
# Find Qt6 packages
12+
find_package(Qt6 REQUIRED COMPONENTS
13+
Core
14+
Gui
15+
Widgets
16+
Network
17+
Concurrent
18+
)
19+
20+
# Find libalpm
21+
find_package(PkgConfig REQUIRED)
22+
pkg_check_modules(ALPM REQUIRED libalpm)
23+
24+
# Include directories
25+
include_directories(
26+
${CMAKE_SOURCE_DIR}/src
27+
${ALPM_INCLUDE_DIRS}
28+
)
29+
30+
# Source files
31+
set(SOURCES
32+
src/main.cpp
33+
34+
# Core
35+
src/core/alpm_wrapper.cpp
36+
src/core/aur_helper.cpp
37+
src/core/package_manager.cpp
38+
39+
# GUI
40+
src/gui/mainwindow.cpp
41+
src/gui/home_widget.cpp
42+
src/gui/search_widget.cpp
43+
src/gui/installed_widget.cpp
44+
src/gui/updates_widget.cpp
45+
src/gui/settings_widget.cpp
46+
src/gui/package_card.cpp
47+
src/gui/package_details_dialog.cpp
48+
)
49+
50+
# Header files
51+
set(HEADERS
52+
src/utils/logger.h
53+
src/utils/types.h
54+
55+
# Core
56+
src/core/alpm_wrapper.h
57+
src/core/aur_helper.h
58+
src/core/package_manager.h
59+
60+
# GUI
61+
src/gui/mainwindow.h
62+
src/gui/home_widget.h
63+
src/gui/search_widget.h
64+
src/gui/installed_widget.h
65+
src/gui/updates_widget.h
66+
src/gui/settings_widget.h
67+
src/gui/package_card.h
68+
src/gui/package_details_dialog.h
69+
)
70+
71+
# Create executable
72+
add_executable(${PROJECT_NAME}
73+
${SOURCES}
74+
${HEADERS}
75+
)
76+
77+
# Link libraries
78+
target_link_libraries(${PROJECT_NAME} PRIVATE
79+
Qt6::Core
80+
Qt6::Gui
81+
Qt6::Widgets
82+
Qt6::Network
83+
Qt6::Concurrent
84+
${ALPM_LIBRARIES}
85+
)
86+
87+
# Link directories
88+
link_directories(${ALPM_LIBRARY_DIRS})
89+
90+
# Compiler flags
91+
target_compile_options(${PROJECT_NAME} PRIVATE
92+
-Wall
93+
-Wextra
94+
-Wpedantic
95+
)
96+
97+
# Install target
98+
install(TARGETS ${PROJECT_NAME}
99+
RUNTIME DESTINATION bin
100+
)
101+
102+
# Install desktop file
103+
install(FILES assets/alg-app-store.desktop
104+
DESTINATION share/applications
105+
)
106+
107+
# Copy stylesheet to build directory
108+
configure_file(
109+
${CMAKE_SOURCE_DIR}/stylesheet.qss
110+
${CMAKE_BINARY_DIR}/stylesheet.qss
111+
COPYONLY
112+
)
113+
114+
# Install stylesheet
115+
install(FILES stylesheet.qss
116+
DESTINATION share/alg-app-store
117+
)

0 commit comments

Comments
 (0)