summaryrefslogtreecommitdiffstats
path: root/INSTALL.md
blob: eb3f668c85353a1c7b405360f839cc3426df6dde (plain)
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# Installation guide

This guide explains how to install rofi using its build system and how you can
make debug builds.

Rofi uses autotools (GNU Build system), for more information see
[here](https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html).
You can also use [Meson](https://mesonbuild.com/) as an alternative.

## DEPENDENCY

### For building

-   C compiler that supports the c99 standard. (gcc or clang)

-   make

-   autoconf

-   automake (1.11.3 or up)

-   pkg-config

-   flex 2.5.39 or higher

-   bison

-   check (Can be disabled using the `--disable-check` configure flag)
    check is used for build-time tests and does not affect functionality.

-   Developer packages of the external libraries

-   glib-compile-resources

### External libraries

-   libpango >= 1.50

-   libpangocairo

-   libcairo

-   libcairo-xcb

-   libglib2.0 >= 2.72
    - gmodule-2.0
    - gio-unix-2.0

-   libgdk-pixbuf-2.0

-   libstartup-notification-1.0

-   libxkbcommon >= 0.4.1

-   libxkbcommon-x11

-   libxcb (sometimes split, you need libxcb, libxcb-xkb and libxcb-randr
    libxcb-xinerama)

-   xcb-util

-   xcb-util-wm (sometimes split as libxcb-ewmh and libxcb-icccm)

-   xcb-util-cursor

-   xcb-imdkit  (optional, 1.0.3 or up preferred)

On debian based systems, the developer packages are in the form of:
`<package>-dev` on rpm based `<package>-devel`.

## Install from a release

When downloading from the github release page, make sure to grab the archive
`rofi-{version}.tar.[g|x]z`. The auto-attached files `source code (zip|tar.gz)`
by github do not contain a valid release. It misses a setup build system and
includes irrelevant files.

### Autotools

Create a build directory and enter it:

```bash
    mkdir build && cd build
```

Check dependencies and configure build system:

```bash
    ../configure
```

Build Rofi:

```bash
    make
```

The actual install, execute as root (if needed):

```bash
    make install
```

The default installation prefix is: `/usr/local/` use `./configure
--prefix={prefix}` to install into another location.

### Meson

Check dependencies and configure build system:

```bash
    meson setup build
```

Build Rofi:

```bash
    ninja -C build
```

The actual install, execute as root (if needed):

```bash
    ninja -C build install
```

The default installation prefix is: `/usr/local/` use `meson setup build
--prefix={prefix}` to install into another location.

## Install a checkout from git

The GitHub Pages version of these directions may be out of date.  Please use
[INSTALL.md from the online repo][master-install] or your local repository.

If you don't have a checkout:

```bash
    git clone --recursive https://github.com/DaveDavenport/rofi
    cd rofi/
```

If you already have a checkout:

```bash
    cd rofi/
    git pull
    git submodule update --init
```

For Autotools you have an extra step, to generate build system:

```bash
    autoreconf -i
```

From this point, use the same steps you use for a release.

## Options for configure

When you run the configure step there are several options you can configure.

For Autotools, you can see the full list with `./configure --help`.

For Meson, before the initial setup, you can see rofi options in
`meson_options.txt` and Meson options with `meson setup --help`. Meson's
built-in options can be set using regular command line arguments, like so:
`meson setup build --option=value`. Rofi-specific options can be set using the
`-D` argument, like so: `meson setup build -Doption=value`. After the build dir
is set up by `meson setup build`, the `meson configure build` command can be
used to configure options, by the same means.

The most useful one to set is the installation prefix:

```bash
    # Autotools
    ../configure --prefix=<installation path>

    # Meson
    meson setup build --prefix <installation path>
```

f.e.

```bash
    # Autotools
    ../configure --prefix=/usr/

    # Meson
    meson setup build --prefix /usr
```

### Install locally

or to install locally:

```bash
    # Autotools
    ../configure --prefix=${HOME}/.local/

    # Meson
    meson setup build --prefix ${HOME}/.local
```

## Options for make

When you run make you can tweak the build process a little.

### Verbose output

Show the commands called:

```bash
    # Autotools
    make V=1

    # Meson
    ninja -C build -v
```

### Debug build

Compile with debug symbols and no optimization, this is useful for making
backtraces:

```bash
    # Autotools
    make CFLAGS="-O0 -g3" clean rofi

    # Meson
    meson configure build --debug
    ninja -C build
```

### Get a backtrace

Getting a backtrace using GDB is not very handy. Because if rofi get stuck, it
grabs keyboard and mouse. So if it crashes in GDB you are stuck. The best way
to go is to enable core file. (ulimit -c unlimited in bash) then make rofi
crash. You can then load the core in GDB.

```bash
    # Autotools
    gdb rofi core

    # Meson (because it uses a separate build directory)
    gdb build/rofi core
```

> Where the core file is located and what its exact name is different on each
> distributions. Please consult the relevant documentation.

For more information see the rofi-debugging(5) manpage.

## Install distribution

### Debian or Ubuntu

```bash
    apt install rofi
```

### Fedora

```bash
    dnf install rofi
```

### ArchLinux

```bash
    pacman -S rofi
```

### Gentoo

An ebuild is available, `x11-misc/rofi`. It's up to date, but you may need to
enable ~arch to get the latest release:

```bash
    echo 'x11-misc/rofi ~amd64' >> /etc/portage/package.accept_keywords
```

for amd64 or:

```bash
    echo 'x11-misc/rofi ~x86' >> /etc/portage/package.accept_keywords
```

for i386.

To install it, simply issue `emerge rofi`.

### openSUSE

On both openSUSE Leap and openSUSE Tumbleweed rofi can be installed using:

```bash
    sudo zypper install rofi
```

### FreeBSD

```bash
    sudo pkg install rofi
```

### macOS

On macOS rofi can be installed via [MacPorts](https://www.macports.org):

```bash
    sudo port install rofi
```

[master-install]: https://github.com/DaveDavenport/rofi/blob/master/INSTALL.md#install-a-checkout-from-git