From 4957c6bda40448f8b0de27b41e93941b44289f70 Mon Sep 17 00:00:00 2001 From: spiros Date: Sun, 23 Jun 2024 00:14:15 +0300 Subject: [PATCH] Make the project able to install --- .github/workflows/build.yaml | 4 ++-- CMakeLists.txt | 4 ++++ README.md | 22 +++++++++++++++++++++ {.github/scripts => dist}/QDiskInfo.desktop | 2 ++ src/icon.svg => dist/QDiskInfo.svg | 0 src/resources.qrc | 10 +++++----- 6 files changed, 35 insertions(+), 7 deletions(-) rename {.github/scripts => dist}/QDiskInfo.desktop (77%) rename src/icon.svg => dist/QDiskInfo.svg (100%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 27567e8..5872f90 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -52,8 +52,8 @@ jobs: mkdir -p AppDir/usr/bin cp build/QDiskInfo AppDir/usr/bin/ cp .github/scripts/smartctl AppDir/usr/bin/ - cp .github/scripts/QDiskInfo.desktop AppDir/ - cp src/icon.svg AppDir/QDiskInfo.svg + cp dist/QDiskInfo.desktop AppDir/ + cp dist/QDiskInfo.svg AppDir/QDiskInfo.svg APPIMAGE_EXTRACT_AND_RUN=1 NO_STRIP=1 QMAKE=/usr/bin/qmake6 ARCH=x86_64 ./linuxdeploy-static-x86_64.AppImage --appdir=AppDir/ -d AppDir/QDiskInfo.desktop -i AppDir/QDiskInfo.svg -e AppDir/usr/bin/QDiskInfo --plugin qt echo 'export PATH="$this_dir"/usr/bin:"$PATH"' >> AppDir/apprun-hooks/linuxdeploy-plugin-qt-hook.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 89eae2a..8191f49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,10 @@ install(TARGETS QDiskInfo LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +install(FILES "dist/QDiskInfo.desktop" + DESTINATION "share/applications") +install(FILES "dist/QDiskInfo.svg" + DESTINATION "share/icons/hicolor/scalable/apps") if(QT_VERSION_MAJOR EQUAL 6) qt_finalize_executable(QDiskInfo) diff --git a/README.md b/README.md index 3d1c059..6fc8a3c 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,25 @@ CrystalDiskInfo alternative for Linux ![mockup](https://github.com/edisionnano/QDiskInfo/assets/26039434/e5488f41-6ea2-4304-9ae8-13d5dac7715b) The icon is a modified version of the KDE Partition Manager logo which is available under GPL-3.0+ + +## Compiling and Installing +First you will need to clone the repository and cd inside +```sh +https://github.com/edisionnano/QDiskInfo.git && cd QDiskInfo +``` +Then you must create a build directory and cd inside +```sh +mkdir build && cd build +``` +After that use CMake to setup the project, Qt version can also be set to 5 (for example for Ubuntu) +```sh +cmake .. -DCMAKE_BUILD_TYPE:STRING=MinSizeRel -DQT_VERSION_MAJOR=6 +``` +And finally compile the project with all the threads +```sh +make -j$(nproc) +``` +This will create a `QDiskInfo` binary on the build directory but you can also install it using +```sh +sudo make install +``` diff --git a/.github/scripts/QDiskInfo.desktop b/dist/QDiskInfo.desktop similarity index 77% rename from .github/scripts/QDiskInfo.desktop rename to dist/QDiskInfo.desktop index 707e857..85947be 100644 --- a/.github/scripts/QDiskInfo.desktop +++ b/dist/QDiskInfo.desktop @@ -2,6 +2,8 @@ Type=Application Version=1.0 Name=QDiskInfo +GenericName=SMART Viwer +Comment=SMART data viewer Icon=QDiskInfo Exec=QDiskInfo Terminal=false diff --git a/src/icon.svg b/dist/QDiskInfo.svg similarity index 100% rename from src/icon.svg rename to dist/QDiskInfo.svg diff --git a/src/resources.qrc b/src/resources.qrc index dbfc380..0d2a1f1 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -1,10 +1,10 @@ - icon.svg + ../dist/QDiskInfo.svg - - ../translations/qdiskinfo_el_GR.qm - ../translations/qdiskinfo_es_ES.qm - ../translations/qdiskinfo_pt_BR.qm + + ../translations/qdiskinfo_el_GR.qm + ../translations/qdiskinfo_es_ES.qm + ../translations/qdiskinfo_pt_BR.qm