File: developers-setup.md

package info (click to toggle)
diffuse 0.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,160 kB
  • sloc: python: 7,689; xml: 5,993; sh: 61; makefile: 9
file content (196 lines) | stat: -rw-r--r-- 4,054 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
# Developers setup

## Requirements

Diffuse depends on these projects:

* Python 3.8+
* PyPi
* Cairo and GObject Introspection development headers
* Meson
* Flatpak and Flatpak builder (Linux only)

## Install the dependencies

### Install the system dependencies

It's a bit difficult to get the command lines for all the systems, but these
examples should be enough to find the packages on most systems.

<details>
    <summary>Debian/Ubuntu</summary>

```sh
sudo apt install python3-pip libcairo2-dev libgirepository1.0-dev meson flatpak flatpak-builder
```

_Note: Tested on Debian 11 (Buster) and Ubuntu 20.04 (Focal)_
</details>
<details>
    <summary>Fedora</summary>

```sh
sudo dnf install python-pip cairo-devel cairo-gobject-devel meson flatpak flatpak-builder
```

_Note: Tested on Fedora 36_
</details>

<details>
    <summary>macOS</summary>

On Mac, all dependencies can be installed using [Homebrew](https://docs.brew.sh/):

```sh
brew install meson python3 py3cairo pygobject3 gtk+3 librsvg
```

_Note: Tested on macOS 12.5 (Monterey)_
</details>

### Install the project dependencies

To install the requirements just to execute the binary, run:

```sh
pip3 install -r requirements.txt
```

For developer tools, run this one instead (it includes requirements.txt):

```sh
pip3 install -r requirements.dev.txt
```

## Setup

### Setup on Linux using Flatpak

#### Build, test and install

To build, test and install Diffuse locally:

```sh
flatpak install runtime/org.gnome.Sdk/$(uname -p)/44
flatpak-builder --user --install build-flatpak io.github.mightycreak.Diffuse.yml
```

#### Run

To run Diffuse through Flatpak:

```sh
flatpak run --user io.github.mightycreak.Diffuse
```

#### Uninstall

To uninstall Diffuse:

```sh
flatpak remove --user io.github.mightycreak.Diffuse
```

### Setup on Linux using Meson

#### Build and test

Diffuse is using Meson as its build system.

To build and test Diffuse:

```sh
meson setup build
meson compile -C build
meson test -C build
```

#### Install on system and run

To install Diffuse on your system (e.g. `/usr/local/`):

```sh
meson install -C build  # requires admin privileges
```

To run Diffuse:

```sh
diffuse
```

#### Install in a custom directory and run

Meson allows to change the default installation directories, see
[command-line documentation](https://mesonbuild.com/Commands.html#configure).

To install Diffuse in a custom directory (e.g. `~/bin/diffuse`):

```sh
meson install -C build --destdir ~/bin/diffuse
```

To run Diffuse:

```sh
export PYTHONPATH=$HOME/bin/diffuse/usr/local/share/diffuse
cd ~/bin/diffuse/usr/local/bin
./diffuse
```

#### Uninstall

To uninstall Diffuse afterwards:

```sh
sudo ninja uninstall -C build
sudo rm -v /usr/local/share/locale/*/LC_MESSAGES/diffuse.mo
```

### Setup on macOS

#### Build and test

Diffuse is using Meson as its build system, this is the only supported system
on macOS.

To build and test Diffuse:

```sh
meson setup build
meson compile -C build
meson test -C build
```

#### Install on system and run

To install Diffuse on your system (e.g. `/Applications/` and `/opt/homebrew/`
or `/usr/local/`):

```sh
meson install -C build  # requires admin privileges
```

To run Diffuse:

```sh
diffuse
```

_Note: The `diffuse` command can be used to launch Diffuse as a native Mac app_
_that is installed into `/Applications/Diffuse.app`._

### Setup on Windows (deprecated)

_Note:_ The Windows port is not maintained and would need some love.
Contributions are very welcome! 😉

The `windows-installer` directory contains scripts for building an installable
package for Windows that includes all dependencies.

Diffuse can be packaged as a portable application by copying the installation
directory to a pen drive and creating a front end that sets the
`XDG_CONFIG_HOME` and `XDG_DATA_DIR` environment variables prior to launching
Diffuse.  The `XDG_CONFIG_HOME` and `XDG_DATA_DIR` environment variables
indicate where Diffuse should store persistent settings (eg. the path to a
writable directory on the pen drive).