如何将 Git 存储库中可用的包添加到 Buildroot?

发布于 2024-12-13 18:39:47 字数 215 浏览 4 评论 0 原文

我正在制作一个嵌入式 Linux 系统,我想将 'bluez' 软件包(和蓝牙实用程序)添加到Buildroot 环境的软件包。

不幸的是,tar 球似乎不可用,但可以从 Git 存储库获取源代码,但我不确定如何将其包含在 .mk 文件中。

我可以这样做吗?如果可以的话怎么做?

I'm making an embedded Linux system and I wanted to add the 'bluez' package (and bluetooth utilities) to the packages of the Buildroot environment.

Unfortunately the tar ball seems to be unavailable but the source is available from Git repositiory but I'm not sure how I can include this in the .mk file.

Can I do this and if so how?

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

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

发布评论

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

评论(3

鹿童谣 2024-12-20 18:39:47

Buildroot 已经有一个 bluez 软件包,它将成为即将发布的 2011.11 版本的一部分。同时,您可以使用最新的 Git 版本的 Buildroot,或者将 bluez 包向后移植到旧版本的 Buildroot 中。

回到最初的问题,Buildroot 能够从 Git 存储库获取源代码。如文档中所述,您只需

MYPKG_VERSION = some_commit_id_or_tag_or_branch_name
MYPKG_SITE = git://thegitrepository
MYPKG_SITE_METHOD = git

.mk 文件中执行以下操作:

Buildroot already has a bluez package, which will be part of the upcoming 2011.11 release. In the mean time, you can either use the latest Git version of Buildroot, or back-port the bluez package into an older version of Buildroot.

Coming back to the initial question, Buildroot is capable of fetching source code from Git repositories. As stated in the documentation, you simply need to do:

MYPKG_VERSION = some_commit_id_or_tag_or_branch_name
MYPKG_SITE = git://thegitrepository
MYPKG_SITE_METHOD = git

in your .mk file.

ゝ杯具 2024-12-20 18:39:47

树内最小工作 2016.05 示例

https:// github.com/cirosantilli/buildroot/tree/git-package-2016.05

唯一有趣的文件是 package/hello/Config.in

HELLO_VERSION = branch2
HELLO_SITE = git://github.com/cirosantilli/hello-c.git

define HELLO_BUILD_CMDS
    $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D)
endef

define HELLO_INSTALL_TARGET_CMDS
        $(INSTALL) -D -m 0755 $(@D)/hello $(TARGET_DIR)/usr/bin
endef

$(eval $(generic-package))

它下载并构建: https://github.com/cirosantilli/hello-c

MYPKG_SITE_METHOD = git 是从 SITE 上的 git: 推断出来的。

git 子模块 + *_OVERRIDE_SRCDIR for git forks

如果您要修改存储库的源代码,我推荐这种方法:如何修改包开发的Buildroot包来源?

Minimal working in-tree 2016.05 example

https://github.com/cirosantilli/buildroot/tree/git-package-2016.05

The only interesting file is package/hello/Config.in:

HELLO_VERSION = branch2
HELLO_SITE = git://github.com/cirosantilli/hello-c.git

define HELLO_BUILD_CMDS
    $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D)
endef

define HELLO_INSTALL_TARGET_CMDS
        $(INSTALL) -D -m 0755 $(@D)/hello $(TARGET_DIR)/usr/bin
endef

$(eval $(generic-package))

It downloads and builds: https://github.com/cirosantilli/hello-c

MYPKG_SITE_METHOD = git is inferred from the git: on SITE.

git submodule + *_OVERRIDE_SRCDIR for git forks

If you are going to modify the source of the repository, I recommend this approach: How to modify the source of Buildroot packages for package development?

够钟 2024-12-20 18:39:47

看起来 bluez 软件包的 tarball 已经可用。在 Google 上搜索“bluez”会得到 http://www.bluez.org/download/,其中有几个 tarball 的链接。

如果由于某种原因您确实需要 Git 存储库中的代码,您可以对存储库进行本地克隆,然后使用 git archive 命令创建 tarball。请参阅 git archive --help 获取文档。

根据您的需要,您还可以直接从存储库的本地副本进行构建(而不是创建 tarball 只是为了在稍后的步骤中再次解压)。

It looks like there are tarballs of the bluez package already available. A Google search for "bluez" yields http://www.bluez.org/download/, which has links to several tarballs.

If for some reason you really want the code from the Git repository, you can make a local clone of the repository and then use the git archive command to create a tarball. See git archive --help for the documentation.

Depending on your needs, you may also be able to build directly from your local copy of the repository (rather than creating a tarball only to unpack it again in a later step).

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