File: build-source-code.rst

package info (click to toggle)
copyq 13.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,964 kB
  • sloc: cpp: 63,306; sh: 992; xml: 452; python: 293; ruby: 152; makefile: 27; javascript: 25
file content (196 lines) | stat: -rw-r--r-- 5,247 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
Build from Source Code
======================

This page describes how to build the application from source code.

Get the Source Code
-------------------

Download the source code from git repository

::

    git clone https://github.com/hluk/CopyQ.git

or download the latest source code archive from:

- `latest release <https://github.com/hluk/CopyQ/releases>`__
- `master branch in zip <https://github.com/hluk/CopyQ/archive/master.zip>`__
- `master branch in tar.gz <https://github.com/hluk/CopyQ/archive/master.tar.gz>`__

Install Dependencies
--------------------

The build requires:

- `CMake <https://cmake.org/download/>`__
- `Qt <https://download.qt.io/archive/qt/>`__

Ubuntu
^^^^^^
On **Ubuntu** you can install all build dependencies with:

::

    sudo apt install \
      build-essential \
      cmake \
      extra-cmake-modules \
      git \
      libkf5notifications-dev \
      libqt5svg5 \
      libqt5svg5-dev \
      libqt5waylandclient5-dev \
      libqt5x11extras5-dev \
      libwayland-dev \
      libxfixes-dev \
      libxtst-dev \
      qtbase5-private-dev \
      qtdeclarative5-dev \
      qttools5-dev \
      qttools5-dev-tools \
      qtwayland5 \
      qtwayland5-dev-tools

Fedora / RHEL / Centos
^^^^^^^^^^^^^^^^^^^^^^
On **Fedora** and derivatives you can install all build dependencies with Qt 5:

::

    sudo yum install \
      cmake \
      extra-cmake-modules \
      gcc-c++ \
      git \
      kf5-knotifications-devel \
      libSM-devel \
      libXfixes-devel \
      libXtst-devel \
      qt5-qtbase-devel \
      qt5-qtbase-private-devel \
      qt5-qtdeclarative-devel \
      qt5-qtsvg-devel \
      qt5-qttools-devel \
      qt5-qtwayland-devel \
      qt5-qtx11extras-devel \
      wayland-devel

To build with Qt 6:

::

    sudo yum install \
      cmake \
      extra-cmake-modules \
      gcc-c++ \
      git \
      kf6-kguiaddons-devel \
      kf6-knotifications-devel \
      kf6-kstatusnotifieritem-devel \
      libSM-devel \
      libXfixes-devel \
      libXtst-devel \
      qt6-qtbase-devel \
      qt6-qtbase-private-devel \
      qt6-qtdeclarative-devel \
      qt6-qtsvg-devel \
      qt6-qttools-devel \
      qt6-qtwayland-devel \
      wayland-devel

Build and Install
-----------------

Build the source code with CMake and make or using an IDE of your choice (see next sections).

::

    cd CopyQ
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .
    make
    make install

Qt Creator
----------

Qt Creator is IDE focused on developing C++ and Qt applications.

Install Qt Creator from your package manager or by selecting it from Qt installation utility.

Set up Qt library, C++ compiler and CMake.

.. seealso::

    `Adding Kits <https://doc.qt.io/qtcreator/creator-targets.html>`__

Open file ``CMakeLists.txt`` in repository clone to create new project.

Visual Studio
-------------

You need to install Qt for given version Visual Studio.

In Visual Studio 2017 open folder containing repository clone using "File - Open - Folder".

In older versions, create solution manually by running ``cmake -G "Visual Studio 14 2015 Win64" .``
(select appropriate generator name) in repository clone folder.

.. seealso::

    `CMake - Visual Studio Generators <https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators>`__

Building and Packaging for OS X
-------------------------------

On OS X, required Qt 6 libraries and utilities can be easily installed with `Homebrew <https://brew.sh/>`__.

::

    cd CopyQ
    git -C "utils/github/homebrew" init .
    git -C "utils/github/homebrew" add .
    git -C "utils/github/homebrew" commit -m "Initial"

    brew tap copyq/kde utils/github/homebrew/
    # if the above "brew tap" command produces an error like
    #     "Error: Tap copyq/kde remote mismatch"
    # then run
    #     brew untap --force copyq/kde
    # and re-run the above "brew tap" command

    brew install qt6 copyq/kde/kf6-knotifications copyq/kde/kf6-kstatusnotifieritem

Build with the following commands:

::

    cmake -DCMAKE_PREFIX_PATH="$(brew --prefix qt6)" .
    cmake --build .
    cpack

To build with Qt 5 (make sure to install qt@5 yourself):

::


    cmake -DCMAKE_PREFIX_PATH="$(brew --prefix qt5)" -DWITH_QT6=OFF .
    cmake --build .
    cpack


This will produce a self-contained application bundle ``CopyQ.app``
which can then be copied or moved into ``/Applications``.

NOTE: If no Items are shown when you start CopyQ and open "File - Preferences - Items",
then your CopyQ plugins were not installed. If you saw warning messages like this::

     /<some_path>/install_name_tool: warning: changes being made to the file will invalidate the code signature in: /<some_path>/CopyQ/_CPack_Packages/Darwin/DragNDrop/copyq-6.2.0-Darwin/CopyQ.app/Contents/Plugins/<some_file>.dylib

when you ran the above "cpack" command, then you have likely encountered
`issue 1903 <https://github.com/hluk/CopyQ/issues/1903/>`__.

In that case you may codesign the CopyQ app again using the following command,
un-install the previous CopyQ app, and install the re-signed ``CopyQ.app``::

    codesign --force --deep --sign - $PWD/_CPack_Packages/Darwin/DragNDrop/copyq-*-Darwin/CopyQ.app