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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8014991/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 06:08:28  来源:igfitidea点击:

How do I Add a A Package To Buildroot Which Is Available In A Git Repository?

gitbluetoothembeddedembedded-linuxbuildroot

提问by Kerry

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.

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

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.

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

Can I do this and if so how?

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

回答by Thomas Petazzoni

Buildroot already has a bluezpackage, 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.

Buildroot 已经有一个bluez包,它将成为即将发布的 2011.11 版本的一部分。同时,您可以使用 Buildroot 的最新 Git 版本,或者将 bluez 包向后移植到旧版本的 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:

回到最初的问题,Buildroot 能够从 Git 存储库中获取源代码。如文档中所述,您只需要执行以下操作:

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

in your .mkfile.

在您的.mk文件中。

回答by larsks

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

看起来bluez包的压缩包已经可用。在 Google 上搜索“bluez”会得到http://www.bluez.org/download/,其中包含指向多个 tarball 的链接。

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 archivecommand to create a tarball. See git archive --helpfor the documentation.

如果出于某种原因您确实需要 Git 存储库中的代码,您可以创建存储库的本地克隆,然后使用该git archive命令创建一个 tarball。有关git archive --help文档,请参阅。

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).

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