From 75fb0a8669c21ac02df41c3f86b8ae410bf028d3 Mon Sep 17 00:00:00 2001 From: Alexandre Lavigne Date: Sun, 31 Jan 2021 21:26:31 +0100 Subject: [PATCH 1/2] Closes #38 - Closes #43 - Add desktop file, move bin standard path Moved instalation binary to /usr/bin Updated plugin loading path Added .desktop file and icon --- assets/default.desktop | 9 +++++---- build_package.sh | 27 ++++++++++++++++++++++----- src/App/App.pro | 6 +++--- src/App/mainwindow.cpp | 3 +-- src/App/mainwindow.h | 2 +- src/plugins/Html/Html.pro | 2 +- src/plugins/Pie/Pie.pro | 2 +- 7 files changed, 34 insertions(+), 17 deletions(-) diff --git a/assets/default.desktop b/assets/default.desktop index dbf8464..34c9ae5 100644 --- a/assets/default.desktop +++ b/assets/default.desktop @@ -1,8 +1,9 @@ [Desktop Entry] Type=Application Name=AnimationMaker -Exec=usr/bin/AnimationMaker -Icon=default -Comment=AnimationMaker -Terminal=true +Exec=animationmaker +Icon=animationmaker.svg +Comment=AnimationMaker - quicly build animations +Terminal=false +Version=1.0 Categories=Graphics; diff --git a/build_package.sh b/build_package.sh index 1a3cb60..bf20fca 100755 --- a/build_package.sh +++ b/build_package.sh @@ -14,8 +14,10 @@ fi BUILD_DIR="${2}" TYPE="${1}" SOURCE_DIR="${BUILD_DIR}/output" -PLUGIN_DIR="${SOURCE_DIR}/plugins" -INSTALL_PREFIX="/opt/animationmaker/" +PLUGIN_DIR="${SOURCE_DIR}/opt/animationmaker/plugins" +INSTALL_PREFIX="/" +ICON="assets/default_64_64.svg" +DESKTOP="assets/default.desktop" PACKAGE_DESCRIPTION="AnimationMaker is a software designed to help you to quickly build animations video.\n\n These animations can be exported to a video file/gif image or you can build your own export plugin." @@ -49,8 +51,23 @@ minor=$(_extract_version "MINOR") build=$(_extract_version "BUILD") VERSION="${major}.${minor}.${build}" -# rename the binary to lowercase letter to comply with deb packages -mv ${SOURCE_DIR}/AnimationMaker ${SOURCE_DIR}/animationmaker +# Copy .desktop entry and icon to apropriate folders +if [[ ! -f ${ICON} ]] +then + echo "Could not find icon file '${ICON}'" +else + mkdir -p ${SOURCE_DIR}/usr/share/pixmaps + cp ${ICON} ${SOURCE_DIR}/usr/share/pixmaps/animationmaker.svg +fi + +if [[ ! -f ${DESKTOP} ]] +then + echo "Could not find desktop entry file '${DESKTOP}'" +else + mkdir -p ${SOURCE_DIR}/usr/share/applications + cp ${DESKTOP} ${SOURCE_DIR}/usr/share/applications/animationmaker.desktop + chmod a+x ${SOURCE_DIR}/usr/share/applications/animationmaker.desktop +fi if [[ "${TYPE}" == "deb" ]] then @@ -80,4 +97,4 @@ fpm \ --url "https://github.com/Artanidos/AnimationMaker" \ --version ${VERSION} \ ${deps[@]} \ - animationmaker plugins + opt usr diff --git a/src/App/App.pro b/src/App/App.pro index 0214735..e550fc9 100644 --- a/src/App/App.pro +++ b/src/App/App.pro @@ -27,15 +27,15 @@ debug { DEFINES += DEBUG } -TARGET = AnimationMaker +TARGET = animationmaker TEMPLATE = app INSTALLS += target OBJECTS_DIR = objs/ MOC_DIR = mocs/ INCLUDEPATH += ../AnimationItems/ -DESTDIR = $$OUT_PWD/../../output -target.path = /opt/animationmaker/ +DESTDIR = $$OUT_PWD/../../output/usr/bin/ +target.path = /usr/bin/animationmaker LIBS += -L$$OUT_PWD/../AnimationItems -lAnimationItems diff --git a/src/App/mainwindow.cpp b/src/App/mainwindow.cpp index 62eae48..7e057dc 100644 --- a/src/App/mainwindow.cpp +++ b/src/App/mainwindow.cpp @@ -84,11 +84,10 @@ MainWindow::~MainWindow() void MainWindow::loadPlugins() { - QDir pluginsDir(QCoreApplication::applicationDirPath()); + QDir pluginsDir = QDir(); if (!pluginsDir.cd(PLUGIN_DIR)) { statusBar()->showMessage("Could not access plugin directory '" + PLUGIN_DIR + "'", 5000); - return; } diff --git a/src/App/mainwindow.h b/src/App/mainwindow.h index 2460eff..56cbc55 100644 --- a/src/App/mainwindow.h +++ b/src/App/mainwindow.h @@ -121,7 +121,7 @@ class MainWindow : public QMainWindow QMenu *exportMenu; QUndoStack *m_undoStack; const QString FFMPEG = "ffmpeg"; - const QString PLUGIN_DIR = "plugins"; + const QString PLUGIN_DIR = "/opt/animationmaker/plugins"; public slots: void reset(); diff --git a/src/plugins/Html/Html.pro b/src/plugins/Html/Html.pro index 2bcd8aa..3427ddf 100644 --- a/src/plugins/Html/Html.pro +++ b/src/plugins/Html/Html.pro @@ -27,7 +27,7 @@ MOC_DIR = mocs/ DEPENDPATH += ../../AnimationItems/ INCLUDEPATH += ../../AnimationItems/ -DESTDIR = $$OUT_PWD/../../../output/plugins +DESTDIR = $$OUT_PWD/../../../output/opt/animationmaker/plugins/ target.path = /opt/animationmaker/plugins LIBS += -L$$OUT_PWD/../../AnimationItems -lAnimationItems diff --git a/src/plugins/Pie/Pie.pro b/src/plugins/Pie/Pie.pro index 37bdb75..5b68d0b 100644 --- a/src/plugins/Pie/Pie.pro +++ b/src/plugins/Pie/Pie.pro @@ -27,7 +27,7 @@ MOC_DIR = mocs/ DEPENDPATH += ../../AnimationItems/ INCLUDEPATH += ../../AnimationItems/ -DESTDIR = $$OUT_PWD/../../../output/plugins +DESTDIR = $$OUT_PWD/../../../output/opt/animationmaker/plugins target.path = /opt/animationmaker/plugins LIBS += -L$$OUT_PWD/../../AnimationItems -lAnimationItems From 74d90ed7f5b98508ae598127c8d7687e9b22e869 Mon Sep 17 00:00:00 2001 From: Alexandre Lavigne Date: Sun, 31 Jan 2021 21:28:25 +0100 Subject: [PATCH 2/2] Update Qt minimal version Update minimal Qt version to match version used in Ubuntu 18.04. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 737a617..fa2149f 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ In order to build AnimationMaker you must first setup either *QtCreator* or inst First you must download and install QtCreator 1. Download the QtCreator installer from [Qt website](https://www.qt.io/download-qt-installer). -2. Run it, when choosing Qt library, choose **version 5.12**, this is the currently used version. +2. Run it, when choosing Qt library, choose any version above **version 5.9.5**. Don't forget to pick the component 'gcc' in Qt version in order to obtain the necessary libraries 3. Start QtCreator