Skip to content

Commit bb998a8

Browse files
hugoholgerssonMightyCreak
authored andcommitted
Docs and build fixes to run Diffuse on macOS
Here we strip away Linux-only stuff so devs can create a local "Mac build". There might be other Linux-only stuff that are not needed on Mac still. Follow-ups are welcome.
1 parent 993d825 commit bb998a8

File tree

3 files changed

+47
-29
lines changed

3 files changed

+47
-29
lines changed

data/meson.build

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
22

3-
desktop_file = i18n.merge_file(
4-
input: 'io.github.mightycreak.Diffuse.desktop.in',
5-
output: 'io.github.mightycreak.Diffuse.desktop',
6-
type: 'desktop',
7-
po_dir: '../po',
8-
install: true,
9-
install_dir: join_paths(get_option('datadir'), 'applications')
10-
)
11-
12-
desktop_utils = find_program('desktop-file-validate', required: false)
13-
if desktop_utils.found()
14-
test('Validate desktop file', desktop_utils,
15-
args: [desktop_file]
3+
if build_machine.system() == 'linux'
4+
desktop_file = i18n.merge_file(
5+
input: 'io.github.mightycreak.Diffuse.desktop.in',
6+
output: 'io.github.mightycreak.Diffuse.desktop',
7+
type: 'desktop',
8+
po_dir: '../po',
9+
install: true,
10+
install_dir: join_paths(get_option('datadir'), 'applications')
1611
)
17-
endif
1812

19-
appstream_file = i18n.merge_file(
20-
input: 'io.github.mightycreak.Diffuse.appdata.xml.in',
21-
output: 'io.github.mightycreak.Diffuse.appdata.xml',
22-
po_dir: '../po',
23-
install: true,
24-
install_dir: join_paths(get_option('datadir'), 'appdata')
25-
)
26-
27-
appstream_util = find_program('appstream-util', required: false)
28-
if appstream_util.found()
29-
test('Validate appstream file', appstream_util,
30-
args: ['validate', appstream_file]
13+
desktop_utils = find_program('desktop-file-validate', required: false)
14+
if desktop_utils.found()
15+
test('Validate desktop file', desktop_utils,
16+
args: [desktop_file]
17+
)
18+
endif
19+
20+
appstream_file = i18n.merge_file(
21+
input: 'io.github.mightycreak.Diffuse.appdata.xml.in',
22+
output: 'io.github.mightycreak.Diffuse.appdata.xml',
23+
po_dir: '../po',
24+
install: true,
25+
install_dir: join_paths(get_option('datadir'), 'appdata')
3126
)
27+
28+
appstream_util = find_program('appstream-util', required: false)
29+
if appstream_util.found()
30+
test('Validate appstream file', appstream_util,
31+
args: ['validate', appstream_file]
32+
)
33+
endif
3234
endif
3335

3436
# Diffuse config file

docs/developers/developers-setup.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Diffuse depends on these projects:
88
* PyPi
99
* Cairo and GObject Introspection development headers
1010
* Meson
11-
* Flatpak and Flatpak builder
11+
* Flatpak and Flatpak builder (Linux only)
1212

1313
### Install the distribution dependencies
1414

@@ -35,6 +35,20 @@ sudo dnf install python-pip cairo-devel cairo-gobject-devel meson flatpak flatpa
3535
_Note: Tested on Fedora 34_
3636
</details>
3737

38+
<details>
39+
<summary>Mac OS</summary>
40+
41+
On Mac, all deps can be fetched using [Homebrew](https://docs.brew.sh/).
42+
43+
```sh
44+
brew install meson python3 py3cairo pygobject3 gtk+3
45+
```
46+
47+
_Note: Tested on macOS 12.5 (Monterey)_
48+
49+
You don't need to use `pip` because the above `brew` command installs all dependencies.
50+
</details>
51+
3852
### Install the project dependencies
3953

4054
To install the requirements just to execute the binary, run:
@@ -72,7 +86,7 @@ To uninstall Diffuse:
7286
flatpak remove io.github.mightycreak.Diffuse
7387
```
7488

75-
### Build, test and install using Meson
89+
## Build, test and install using Meson on Linux and Mac OS
7690

7791
Diffuse build system is meson.
7892

meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ subdir('data')
1010
subdir('src')
1111
subdir('po')
1212

13-
meson.add_install_script('build-aux/meson/postinstall.py')
13+
if build_machine.system() == 'linux'
14+
meson.add_install_script('build-aux/meson/postinstall.py')
15+
endif

0 commit comments

Comments
 (0)