我如何更改Macports投资组合中的目录并运行makefile
投资组合现在看起来像这样:
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup github 1.0
PortGroup cargo 1.0
github.setup DominikWilkowski cfonts 1.0.2rust v
revision 0
categories textproc
license GPL-3+
maintainers {DominikWilkowski @DominikWilkowski}
description Sexy ANSI fonts for the console
long_description This is a silly little command line tool for sexy fonts in the console. \
Give your cli some love.
homepage https://github.com/dominikwilkowski/cfonts
checksums ${distfiles} \
rmd160 6f5bedcb0e1cb54faf9efb2b4e34dbe6105152ea \
sha256 33c14dda907c4f3c046a40644c8856f6debb87b58ee6fbaab2b8d7af14ce8b6e \
size 3312272
post-extract {
cd rust/
}
destroot {
xinstall -m 755 ${worksrcpath}/target/[cargo.rust_platform]/release/${name} \
${destroot}${prefix}/bin/
}
在存储库中,Rust源代码在/Rust
文件夹中,这意味着我必须进入该文件夹,然后运行cargo build build
(哪个我假设portgroup
为您提供)。 我还需要在构建 之前运行,因为它将工件移至正确的位置。
我发现这些文档很少,而且很难用谷歌搜索这个问题。
查看其他投资文件
s,我还注意到生锈软件包提到了依赖项及其哈希...任何帮助都将不胜感激。
Trying to add a Portfile
to Macports via this draft PR and can't figure out how I change directory in post-extract
.
The Portfile looks like this right now:
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup github 1.0
PortGroup cargo 1.0
github.setup DominikWilkowski cfonts 1.0.2rust v
revision 0
categories textproc
license GPL-3+
maintainers {DominikWilkowski @DominikWilkowski}
description Sexy ANSI fonts for the console
long_description This is a silly little command line tool for sexy fonts in the console. \
Give your cli some love.
homepage https://github.com/dominikwilkowski/cfonts
checksums ${distfiles} \
rmd160 6f5bedcb0e1cb54faf9efb2b4e34dbe6105152ea \
sha256 33c14dda907c4f3c046a40644c8856f6debb87b58ee6fbaab2b8d7af14ce8b6e \
size 3312272
post-extract {
cd rust/
}
destroot {
xinstall -m 755 ${worksrcpath}/target/[cargo.rust_platform]/release/${name} \
${destroot}${prefix}/bin/
}
In the repo the rust source code is in the /rust
folder which means I have to go into that folder before running cargo build
(which I assume the Portgroup
does for you).
I also need to run the Makefile
before building as it moves artifacts into the right place.
I find the docs very sparse and it seems difficult to google this issue.
Looking at other Portfile
s I also notice that rust packages mention the dependencies and their hashes... Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我在
答案归结为以下内容:
如何更改目录:
如何运行makefile(在子文件夹中):
如何最终链接所有内容:
以及如何创建依赖项及其哈希:有一个称为<<的端口a href =“ https://ports.macports.org/port/cargo2port/details/”为您输出。
因此,最终的投资组合是:
我希望以后对别人有所帮助
Ok I had a lot of help with this in the PR.
The answers boil down to this:
How to change directory:
How to run a Makefile (within a sub-folder):
How to link it all in the end:
And how to create the dependencies and their hashes: There is a port called cargo2port that uses the
Cargo.lock
file and generates the output for you.So with all that the final Portfile is:
I hope it helps someone else later