如何在具有Freetype支持的R(Termux)上安装Cairo

时间:2019-04-03 05:59:40

标签: r linux termux

我无法通过以下方式在R(Termux)上安装Cairo软件包:

install.packages('Cairo')

因为它找不到自由类型支持:

configure: error: Cannot use cairo-ft backend, 
although cairo claims it is working. Please check 
your caito installation and/or update cairo if 
necessary or set CAIRO_CFLAGS/CAIRO_LIBS 
accordingly.
ERROR: configuration failed for package ‘Cairo’
* removing  
 ‘/data/data/com.termux/files/usr/lib/R/library/Cairo’
sh: ȫ�: not found

我在这里Install Cairo on R中读到,OP必须使用--enable-ft = yes重新编译cairo。 '。我需要知道这是否可以解决R上的安装失败以及如何在Termux上完成安装。

2 个答案:

答案 0 :(得分:0)

尝试一下:

export LD_LIBRARY_PATH=$PREFIX/lib
export CAIRO_INCLUDE_PATH=$PREFIX/include/cairo
export CAIRO_CFLAGS=-I$PREFIX/include/cairo
export CAIRO_LIBS='-L$PREFIX/lib -lcairo'

答案 1 :(得分:0)

我想为不同的目的构建cairo,但是也遇到了找不到自由类型库的问题。

首先,开罗的configure正在打印checking for FREETYPE...,但实际上并不是在寻找FREETYPEfreetype,而是在寻找freetype2

第二,自由类型库具有2个版本控制系统(一个返回2.X,另一个返回9.Y)。

configure内,第30659行附近有一个这样的片段:

# We use pkg-config to look for freetype2, but fall back to
# freetype-config if it fails.  We prefer pkg-config, since we can
# then just put freetype2 >= $FREETYPE_MIN_VERSION in
# Requires.private, but at least up to 2003-06-07, there was no
# freetype2.pc in the release.
#
# FreeType versions come in three forms:
#   release (such as 2.1.9)
#   libtool (such as 9.7.3) (returned by freetype-config and pkg-config)
#   platform-specific/soname (such as 6.3.4)
# and they recommend you never use the platform-specific version
# (see docs/VERSION.DLL in freetype2 sources)
#
# Set these as appropriate:

# release number - for information only
FREETYPE_MIN_RELEASE=2.1.9
# libtool-specific version - this is what is checked
FREETYPE_MIN_VERSION=9.7.3

在我的情况下,pkg-config使用的是2.X版本。将FREETYPE_MIN_VERSION的值更改为FREETYPE_MIN_RELEASE的值可以解决此问题。