【发布时间】:2021-03-29 09:40:04
【问题描述】:
这是我的应用程序的 gschema.xml 代码:
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema path="/com/github/Suzie97/epoch"
id="com.github.Suzie97.epoch"
gettext-domain - "com.github.Suzie97.epoch">
<key name="pos-x" type="i">
<default>360</default>
<summary>Most recent x position of Epoch</summary>
<description>Most recent x position of Epoch</description>
</key>
<key name="pos-y" type="i">
<default>360</default>
<summary>Most recent y position of Epoch</summary>
<description>Most recent y position of Epoch</description>
</key>
</schema>
</schemalist>
这是安装 gschema 的 meson.build 文件:
install_data(
'gschema.xml',
install_dir: join_paths (get_option ('datadir'), 'glib-2.0', 'schemas'),
rename: meson.project_name() + '.gschema.xml'
)
当我编译时显示此错误:
Settings schema 'com.github.Suzie97.epoch' is not installed
这是 post_install.py 脚本:
#!/usr/bin/env python3
import os
import subprocess
install_prefix = os.environ['MESON_INSTALL_PREFIX']
schemadir = os.path.join(install_prefix, 'share/glib-2.0/schemas')
if not os.environ.get('DESTDIR'):
print('Compiling the gsettings schemas ... ')
subprocess.call(['glib-compile-schemas', schemadir])
为什么会这样?
【问题讨论】:
标签: settings glib meson-build