【问题标题】:Installing some files into /usr/share/ with cygport (Cygwin packaging utility)使用 cygport(Cygwin 打包实用程序)将一些文件安装到 /usr/share/
【发布时间】:2014-07-16 20:20:45
【问题描述】:

我一直在对 mintty 进行一些修改以使其支持主题。回购在这里https://github.com/PhilipDaniels/mintty

我的代码更改已完成,但我无法使用 cygport 进行打包。如果您查看存储库,您可以看到根级别有

pkg.cygport    # the cygport file
themes/*       # folder with lots of themes

这是完整的 pkg.cygport 文件

CATEGORY="Base Shells"
DEPEND="gcc-core"
HOMEPAGE="http://mintty.googlecode.com"
SRC_URI="http://mintty.googlecode.com/files/mintty-${PV}-src.tar.bz2"
SUMMARY="Terminal emulator with native Windows look and feel"
DESCRIPTION="\
Mintty is a terminal emulator for Cygwin. It is based on code
from PuTTY 0.60 by Simon Tatham and team.

Features include:
* Xterm-compatible terminal emulation.
* Full Unicode support.
* Native Windows user interface that tries to keep things simple.
* Graphical options dialog. Options stored in a text file.
* Themes.
* Drag & drop and copy & paste of text, files and folders.
* Extensive mouse support.
* Window transparency."

RESTRICT=postinst_doc

src_compile() {
  lndirs
  cd ${B}
  cygmake
}

src_install() {
  cd ${B}
  dobin mintty.exe
  doman docs/mintty.1
  dodoc COPYING LICENSE.Oxygen LICENSE.PuTTY

  # This fails with *** ERROR: file themes/* does not exist 
  # We appear to be in /c/Users/Phil/repos/mintty/mintty-1.3-alpha-1.3/build
  # during this step.
  insinto /usr/share/mintty/themes
  doins themes/*
}

带有 insinto/doins 的最后两行是我添加的唯一两行,它们不起作用,因为此时我们似乎在不同的文件夹中 - 我猜是 cd ${B}是罪魁祸首。但是如何解决呢?

【问题讨论】:

  • 你如何调用cygport 来构建这个?

标签: cygwin mintty


【解决方案1】:

您对 .cygport 文件的添加看起来正确。

我认为您的问题是由于您的主题文件不在 make pkg 制作的 tarball 中,然后由 cygport 解压缩以获取要构建和打包的源代码。

将主题/目录添加到 Makefile 中的文件列表非常简单:

 src_files := $(wildcard Makefile *.c *.h *.rc *.mft COPYING LICENSE* INSTALL)
 src_files += $(wildcard docs/$(NAME).1 docs/readme*.html scripts/* icon/*)
+src_files += $(wildcard themes/*)

不幸的是,一些主题名称当前包含空格,因此没有正确转义。我重命名了这些文件以检查构建,但您可能更喜欢更优雅的解决方案。

【讨论】:

  • 谢谢乔恩,这正是解决问题所需要的。显然 GNU Make 在涉及带有空格的文件名时从根本上被破坏了(也就是“不是为处理它们而设计的”),老实说这有点令人惊讶,所以我已经重命名了它们。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-04-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多