diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..331d387 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +Dockerfile diff --git a/CMakeLists.txt b/CMakeLists.txt index 25b14f3..eb490c5 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 0000000..2a778d9 --- /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 -DCMAKE_INSTALL_PREFIX=/usr ../ && make VERBOSE=1 && make install +RUN strip --strip-unneeded /usr/bin/screengrab +ENTRYPOINT /usr/bin/screengrab diff --git a/README.md b/README.md index 5f0a781..608e20f 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).