glib - GLib-GIO-ERROR **:未安装设置架构“com.github.mfru.vala-todo”
问题描述
首先,我是和的新手Vala
,所以我可能正在寻找完全错误的方向。Gtk
Meson
我在 Pop_OS 上运行!20.10。
我想编译一个支持 GSettings 的小示例 Vala 应用程序。
但是,当编译ninja
,安装sudo ninja install
然后执行时,我得到了标题中提到的错误。
似乎即使我的 gschema 文件被复制到/usr/share/glib-2.0/schemas
,glib-compile-schemas
在我的安装后脚本中运行也没有做任何事情。
我还可以通过glib-compile-schemas
手动运行然后使用 dconf Editor 检查我的设置是否可用来确认。
数据/gschema.xml
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema path="/com/github/mfru/vala-todo" id="com.github.mfru.vala-todo">
<key name="pos-x" type="i">
<default>360</default>
<summary>Horizontal position</summary>
<description>The saved horizontal position of our window</description>
</key>
<key name="pos-y" type="i">
<default>360</default>
<summary>Vertical position</summary>
<description>The saved vertical position of our window</description>
</key>
<key name="window-width" type="i">
<default>600</default>
<summary>Window width</summary>
<description>The saved width of our window</description>
</key>
<key name="window-height" type="i">
<default>400</default>
<summary>Window height</summary>
<description>The saved height of our window</description>
</key>
</schema>
</schemalist>
数据/介子.build
install_data(
'gschema.xml',
install_dir: join_paths (get_option ('datadir'), 'glib-2.0', 'schemas'),
rename: meson.project_name () + '.geschema.xml'
)
介子/安装后.py
#!/usr/bin/env python3
import os
import subprocess
schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
print("Schemadir is", schemadir)
if 'DESTDIR' not in os.environ:
print("Compiling the gsettings schemas...")
subprocess.call(['glib-compile-schemas', schemadir])
meson build --prefix=/usr --reconfigure
我还用最初指向的前缀重新配置了介子前缀,/usr/local
但我系统上的所有现有模式都在/usr/share
最后,我期望发生的是我的示例应用程序启动时不会因为缺少 GSettings 而崩溃。
我研究的资源:
https://mesonbuild.com/Configuring-a-build-directory.html
https://developer.gnome.org/gio/stable/glib-compile-schemas.html
解决方案
您的build.meson
文件中有错字。
它应该.gschema.xml
代替.geschema.xml
.
推荐阅读
- node.js - Ionic Cordova Angular 在 gif 上添加文本
- java - 如何在 android 中使用 WiFi 打印机打印自定义尺寸的纸张?
- node.js - 使用 npm install 安装 node_packages 时出现代码 ELIFECYCLE 错误
- node.js - UnhandledPromiseRejectionWarning: MongoError: Unrecognized pipeline stage name: '$setWindowFields'
- c# - Dropbox.net 获取用户最喜欢的文件夹内容
- r - 更改集群 geom_col 中的填充顺序?
- encryption - 哈希的意义何在?
- angular - Angular - 错误的包版本?
- algorithm - 为什么在恢复最长递增子序列时需要祖先数组?
- wordpress - 手动调用 Gravity Forms Product Add-ons Plugin