From 334b513a0c0953df2155c2306ba27e67221cd04d Mon Sep 17 00:00:00 2001 From: Igor Diakonov Date: Wed, 31 Mar 2021 23:37:36 +0300 Subject: [PATCH 1/3] Can be built in docker --- .dockerignore | 2 ++ CMakeLists.txt | 3 ++- Dockerfile | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..331d3872 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +Dockerfile diff --git a/CMakeLists.txt b/CMakeLists.txt index 25b14f36..eb490c53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" O # Minimum Versions set(KF5_MINIMUM_VERSION "5.36.0") set(QT_MINIMUM_VERSION "5.12.0") -set(QTXDG_MINIMUM_VERSION "3.6.0") +set(QTXDG_MINIMUM_VERSION "3.4.0") find_package(Qt5LinguistTools ${QT_MINIMUM_VERSION} REQUIRED) find_package(Qt5Network ${QT_MINIMUM_VERSION} REQUIRED) @@ -102,6 +102,7 @@ add_definitions(-DSG_ICONPATH="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src") add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src/common/qkeysequencewidget") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/common/qkeysequencewidget/src") +include_directories("/usr/include/qt5xdg") if (SG_EXT_EDIT) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/modules/extedit") diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..86dcfca5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:focal +ENV TZ=Europe/Moscow +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN apt update && apt install -y --no-install-recommends gcc g++ make cmake \ + libxcb-shape0-dev libxcb-xfixes0-dev libx11-xcb-dev \ + libglib2.0-dev \ + qt5-default qttools5-dev libqt5xdg-dev \ + libkf5windowsystem-dev libqt5svg5-dev \ + libqt5x11extras5-dev +WORKDIR /src +RUN ls /usr/include/qt5xdg +COPY ./ ./ +RUN mkdir build && cd build && cmake -DSG_DBUS_NOTIFY=ON ../ && make VERBOSE=1 && make install +RUN strip --strip-unneeded /usr/local/bin/screengrab +ENTRYPOINT /usr/local/bin/screengrab From 9176a6e26d68340759fda109459637fa5ea002b6 Mon Sep 17 00:00:00 2001 From: Igor Diakonov Date: Wed, 31 Mar 2021 23:47:53 +0300 Subject: [PATCH 2/3] Moved to /usr --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 86dcfca5..2a778d93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,6 @@ RUN apt update && apt install -y --no-install-recommends gcc g++ make cmake \ WORKDIR /src RUN ls /usr/include/qt5xdg COPY ./ ./ -RUN mkdir build && cd build && cmake -DSG_DBUS_NOTIFY=ON ../ && make VERBOSE=1 && make install -RUN strip --strip-unneeded /usr/local/bin/screengrab -ENTRYPOINT /usr/local/bin/screengrab +RUN mkdir build && cd build && cmake -DSG_DBUS_NOTIFY=ON -DCMAKE_INSTALL_PREFIX=/usr ../ && make VERBOSE=1 && make install +RUN strip --strip-unneeded /usr/bin/screengrab +ENTRYPOINT /usr/bin/screengrab From 73456773d5f9f1bab69fbb7ac62ea3373dd12f93 Mon Sep 17 00:00:00 2001 From: Igor Diakonov Date: Wed, 31 Mar 2021 23:56:13 +0300 Subject: [PATCH 3/3] Fixed README.md --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5f0a7813..608e20f2 100644 --- a/README.md +++ b/README.md @@ -4,27 +4,27 @@ ScreenGrab - A program for fast creating screenshots, and easily publishing them on internet image hosting services. It works on Linux and Windows operating systems. ScreenGrab uses the Qt framework and thus, it is independent from any desktop environment. -### Build requirements +### Requirements - * Qt5 >= 5.2 (Qt 4.x support only 1.x branch) - * CMake >= 3.1.0 (only for building ScreenGrab from sources) - * GCC > 4.5 - * KF5WindowSystem - * [optional] Qxt Library > 0.6 (if you want to build ScreenGrab using your system Qxt version - see the "Build options" section in this file) +- Ubuntu:focal +- docker ### Build To build ScreenGrab from sources, use these commands: - mkdir build - cd build - cmake [BUILD OPTIONS] ../ - make - make install +``` +docker build -t screengrab . +id=$(docker create screengrab) +docker cp $id:/usr/local/bin/screengrab - > screengrab.tar +tar xf screengrab.tar +rm screengrab.tar +docker rm -v $id +``` ### Build options -You can use some or all of these parameters to customise your build. +You can use some or all of these parameters to customise your build in Dockerfile. * **-DCMAKE_INSTALL_PREFIX** - Install prefix for Linux distro. Default setting: "/usr". * **-DSG_XDG_CONFIG_SUPPORT** - Place config files into XDGC_CONFIG_HOME directory (usually - ~/.config/${app_name) ). Default setting: ON. In previous versions the config files were stored in ~/.screengrab (Set this parameter to "OFF" to store the config files here).