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.
This commit is contained in:
Hugo Holgersson 2022-08-16 17:10:17 +02:00 committed by Romain Failliot
parent 993d8256da
commit bb998a8785
3 changed files with 46 additions and 28 deletions

View File

@ -1,34 +1,36 @@
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
desktop_file = i18n.merge_file( if build_machine.system() == 'linux'
input: 'io.github.mightycreak.Diffuse.desktop.in', desktop_file = i18n.merge_file(
output: 'io.github.mightycreak.Diffuse.desktop', input: 'io.github.mightycreak.Diffuse.desktop.in',
type: 'desktop', output: 'io.github.mightycreak.Diffuse.desktop',
po_dir: '../po', type: 'desktop',
install: true, po_dir: '../po',
install_dir: join_paths(get_option('datadir'), 'applications') install: true,
) install_dir: join_paths(get_option('datadir'), 'applications')
desktop_utils = find_program('desktop-file-validate', required: false)
if desktop_utils.found()
test('Validate desktop file', desktop_utils,
args: [desktop_file]
) )
endif
appstream_file = i18n.merge_file( desktop_utils = find_program('desktop-file-validate', required: false)
input: 'io.github.mightycreak.Diffuse.appdata.xml.in', if desktop_utils.found()
output: 'io.github.mightycreak.Diffuse.appdata.xml', test('Validate desktop file', desktop_utils,
po_dir: '../po', args: [desktop_file]
install: true, )
install_dir: join_paths(get_option('datadir'), 'appdata') endif
)
appstream_util = find_program('appstream-util', required: false) appstream_file = i18n.merge_file(
if appstream_util.found() input: 'io.github.mightycreak.Diffuse.appdata.xml.in',
test('Validate appstream file', appstream_util, output: 'io.github.mightycreak.Diffuse.appdata.xml',
args: ['validate', appstream_file] po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'appdata')
) )
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test('Validate appstream file', appstream_util,
args: ['validate', appstream_file]
)
endif
endif endif
# Diffuse config file # Diffuse config file

View File

@ -8,7 +8,7 @@ Diffuse depends on these projects:
* PyPi * PyPi
* Cairo and GObject Introspection development headers * Cairo and GObject Introspection development headers
* Meson * Meson
* Flatpak and Flatpak builder * Flatpak and Flatpak builder (Linux only)
### Install the distribution dependencies ### Install the distribution dependencies
@ -35,6 +35,20 @@ sudo dnf install python-pip cairo-devel cairo-gobject-devel meson flatpak flatpa
_Note: Tested on Fedora 34_ _Note: Tested on Fedora 34_
</details> </details>
<details>
<summary>Mac OS</summary>
On Mac, all deps can be fetched using [Homebrew](https://docs.brew.sh/).
```sh
brew install meson python3 py3cairo pygobject3 gtk+3
```
_Note: Tested on macOS 12.5 (Monterey)_
You don't need to use `pip` because the above `brew` command installs all dependencies.
</details>
### Install the project dependencies ### Install the project dependencies
To install the requirements just to execute the binary, run: To install the requirements just to execute the binary, run:
@ -72,7 +86,7 @@ To uninstall Diffuse:
flatpak remove io.github.mightycreak.Diffuse flatpak remove io.github.mightycreak.Diffuse
``` ```
### Build, test and install using Meson ## Build, test and install using Meson on Linux and Mac OS
Diffuse build system is meson. Diffuse build system is meson.

View File

@ -10,4 +10,6 @@ subdir('data')
subdir('src') subdir('src')
subdir('po') subdir('po')
meson.add_install_script('build-aux/meson/postinstall.py') if build_machine.system() == 'linux'
meson.add_install_script('build-aux/meson/postinstall.py')
endif