Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added isolated build in docker #253

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
Dockerfile
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down