如何将特征库(或任何其他仅限标题库)安装到Flatpak构建器环境中?

发布于 2025-02-09 14:19:00 字数 1587 浏览 2 评论 0 原文

我正在尝试将特征库纳入我的应用程序的Flatpak构建中,但无法弄清楚如何正确执行。到目前为止,我仅使用 cmake-Ninja 作为 buildsystem 使用库,而且效果很好。由于EIGEN是仅标题库,我想它应该以某种方式与 Simple buildSystem一起使用,但是我不知道如何从源指定 eigen subforter文件必须安装到/include 文件夹。到目前为止,我在清单中尝试的是:

{
   ...
   modules = [
        ...
        {
            "name": "eigen",
            "buildsystem": "simple",
            "build-commands": [ "install -d Eigen /include/Eigen" ] ,
            "sources": [
                {
                    "type": "archive",
                    "url": "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.zip",
                    "sha512": "3b06da583037649ad42190bd018ddf40b85179ad0877ebd7c1ca7b8498a1453eed25919de27d3bb737754086e1513408e7de4a2110d51912f2e5503e1ab7d838"
                }
            ]
        },
        ...
}

但是没有任何文件复制到/include 子文件夹中,并且我的应用程序的cmake build随后当然也没有找到eigen。我在这里一定有一些非常简单的东西。

我已经尝试在网络上查找几个小时,但是我什至不确定哪些文档在这里对我有帮助。 flatpak-builder命令命令参考在此上下文中以及在 install -d hello.sh ... 作为 simple buildsystem的构建命令;有些使用 npm 命令,这让我感到困惑 - 我尝试了 apt install ... ,但当然不可用 - 如果/哪个软件包管理器,是否有一些参考可以在哪个运行时间使用?

我了解在上述命令中,Flatpak Builder可能无法确定我要复制的 eigen 的路径(尽管输出中没有错误消息) - 但是我如何指定它是来自源文件夹的文件夹?

I'm trying to incorporate the eigen library into the flatpak build of my application, but can't figure out how to do it properly. So far, I've only used libraries using the cmake-ninja as buildsystem and that has worked quite well. Since eigen is a header only library, I suppose it should somehow work with the simple buildsystem, but I can't figure out how to specify that the Eigen subfolder from the source files has to be installed to the /include folder. What I've tried so far in my manifest:

{
   ...
   modules = [
        ...
        {
            "name": "eigen",
            "buildsystem": "simple",
            "build-commands": [ "install -d Eigen /include/Eigen" ] ,
            "sources": [
                {
                    "type": "archive",
                    "url": "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.zip",
                    "sha512": "3b06da583037649ad42190bd018ddf40b85179ad0877ebd7c1ca7b8498a1453eed25919de27d3bb737754086e1513408e7de4a2110d51912f2e5503e1ab7d838"
                }
            ]
        },
        ...
}

But no files get copied into the /include subfolder, and my application's CMake build subsequently then of course also doesn't find eigen. There must be something very simple I'm missing here.

I've tried looking this up on the web for some hours now, but I'm not even sure yet which documentation might help me here. The flatpak-builder command reference seems too brief on information to be useful in this context, and also in the flatpak documentation I didn't really find anything that fits my needs.
The tutorials I found only useinstall -D hello.sh ... as build-command for the simple buildsystem; some use npm commands, which got me confused - I tried apt install..., but of course apt isn't available - is there some reference if/which package managers are available in which runtime maybe?.

I understand that in my above command, flatpak builder probably cannot determine the path of the Eigen that I want to copy (though there is no error message in the output) - but how do I specify that it's the folder from the sources folder?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

﹏雨一样淡蓝的深情 2025-02-16 14:19:00

我猜我最初的问题很容易回答,因为我刚刚意识到eigen实际上支持Cmake。因此,更改我的模块:

{
   ...
   modules = [
        ...
        {
            "name": "eigen",
            "buildsystem": "cmake",
            "builddir": true,
            "sources": [
                {
                    "type": "archive",
                    "url": "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.zip",
                    "sha512": "3b06da583037649ad42190bd018ddf40b85179ad0877ebd7c1ca7b8498a1453eed25919de27d3bb737754086e1513408e7de4a2110d51912f2e5503e1ab7d838"
                }
            ]
        },
        ...
}

使一切正常。

I guess my original question can be answered easily, since I just realized that eigen actually supports cmake. So changing my module to this:

{
   ...
   modules = [
        ...
        {
            "name": "eigen",
            "buildsystem": "cmake",
            "builddir": true,
            "sources": [
                {
                    "type": "archive",
                    "url": "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.zip",
                    "sha512": "3b06da583037649ad42190bd018ddf40b85179ad0877ebd7c1ca7b8498a1453eed25919de27d3bb737754086e1513408e7de4a2110d51912f2e5503e1ab7d838"
                }
            ]
        },
        ...
}

makes everything work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文