... | ... | @@ -149,6 +149,31 @@ config_h = declare_dependency( |
|
|
)
|
|
|
)
|
|
|
```
|
|
|
And make sure to add the config_h dependency to your project dependencies. Usually in the executable command:
|
|
|
```
|
|
|
executable(
|
|
|
...
|
|
|
...
|
|
|
dependencies: [
|
|
|
config_h,
|
|
|
gtk
|
|
|
],
|
|
|
)
|
|
|
```
|
|
|
|
|
|
Lately, add a meson option in the meson_options.txt file for the profile:
|
|
|
```
|
|
|
option(
|
|
|
'profile',
|
|
|
type: 'combo',
|
|
|
choices: [
|
|
|
'default',
|
|
|
'development'
|
|
|
],
|
|
|
value: 'default'
|
|
|
)
|
|
|
```
|
|
|
|
|
|
### Icons handling
|
|
|
Now to install icons properly it's a bit hacky, there are already issues created to eventually make it more convenient. Add the following to your data/meson.build:
|
|
|
```
|
... | ... | @@ -223,6 +248,11 @@ desktop = i18n.merge_file( |
|
|
```
|
|
|
Replace "AppName" by your application name.
|
|
|
|
|
|
And in the desktop.in.in file change to the following:
|
|
|
```
|
|
|
Icon=@icon@
|
|
|
```
|
|
|
|
|
|
### AppData handling
|
|
|
Similar to the desktop file, need to take application_id into account. Create the appdata file with:
|
|
|
```
|
... | ... | @@ -243,6 +273,11 @@ appdata = i18n.merge_file( |
|
|
```
|
|
|
Replace "AppName" by your application name.
|
|
|
|
|
|
In the xml.in.in file change to the following:
|
|
|
```
|
|
|
<id>@appid@.desktop</id>
|
|
|
```
|
|
|
|
|
|
### Service handling
|
|
|
Every GLib app registers as a service too. So similar to desktop file and appdata, let's take into account the application id:
|
|
|
|
... | ... | @@ -259,6 +294,11 @@ configure_file( |
|
|
```
|
|
|
Replace "AppName" by your application name.
|
|
|
|
|
|
In the service.in file change the following line:
|
|
|
```
|
|
|
Name=@appid@
|
|
|
```
|
|
|
|
|
|
### Shell search provider handling
|
|
|
Most of core apps have a shell search provider, we need to take into account the application id too for this.
|
|
|
|
... | ... | @@ -273,4 +313,27 @@ configure_file( |
|
|
output: '@0@.search-provider.ini'.format(application_id)
|
|
|
)
|
|
|
```
|
|
|
Replace "AppName" by your application name. |
|
|
\ No newline at end of file |
|
|
And in the search provider .ini.in file change the values to the following:
|
|
|
```
|
|
|
DesktopId=@appid@.desktop
|
|
|
BusName=@appid@
|
|
|
ObjectPath=/org/gnome/AppName@profile@/SearchProvider
|
|
|
```
|
|
|
Replace "AppName" by your application name.
|
|
|
|
|
|
### Flatpak manifest handling
|
|
|
Simply change the app id to the matching app id of the selected profile, for example:
|
|
|
```
|
|
|
"app-id": "org.gnome.AppNameDevel",
|
|
|
```
|
|
|
And in config-options of your module section add:
|
|
|
```
|
|
|
"config-opts": [
|
|
|
"-Dprofile=development"
|
|
|
],
|
|
|
|
|
|
```
|
|
|
|
|
|
For the stable flatpak branch, change the id to the regular one and the profile to the stable one.
|
|
|
|
|
|
# Adding a visual hint for development |