1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7,8} )
9 GENTOO_DEPEND_ON_PERL="no"
10 inherit perl-module python-any-r1 cmake-multilib
12 DESCRIPTION="Library providing rendering capabilities for complex non-Roman writing systems"
13 HOMEPAGE="https://scripts.sil.org/cms/scripts/page.php?site_id=projects&item_id=graphite_home"
14 SRC_URI="mirror://sourceforge/silgraphite/${PN}/${P}.tgz"
18 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
20 RESTRICT="!test? ( test )"
23 perl? ( dev-lang/perl:= )
27 dev-perl/Locale-Maketext-Lexicon
33 $(python_gen_any_dep 'dev-python/fonttools[${PYTHON_USEDEP}]')
35 perl? ( virtual/perl-Test-Simple )
39 PATCHES=( "${FILESDIR}/${PN}-1.3.5-includes-libs-perl.patch" )
42 use perl && perl_set_version
43 use test && python-any-r1_pkg_setup
47 has_version "dev-python/fonttools[${PYTHON_USEDEP}]"
55 sed -e '/tests/d' -i CMakeLists.txt || die
59 multilib_src_configure() {
61 # Renamed VM_MACHINE_TYPE to GRAPHITE2_VM_TYPE
62 -DGRAPHITE2_VM_TYPE=direct
64 # https://sourceforge.net/p/silgraphite/bugs/49/
65 [[ ${CHOST} == powerpc*-apple* ]] && mycmakeargs+=(
66 -DGRAPHITE2_NSEGCACHE:BOOL=ON
72 if multilib_is_native_abi && use perl; then
73 # we rely on the fact that cmake_src_configure sets BUILD_DIR
74 sed -e "s:@BUILD_DIR@:\"${BUILD_DIR}/src\":" \
75 -i "${S}"/contrib/perl/Build.PL || die
80 cmake-multilib_src_compile
82 cd contrib/perl || die
83 perl-module_src_configure
84 perl-module_src_compile
89 if multilib_is_native_abi; then
92 einfo "Cannot test since python is not multilib."
97 cmake-multilib_src_test
99 # Perl tests fail due to missing POD coverage...
100 perl_rm_files "contrib/perl/t/pod.t" "contrib/perl/t/pod-coverage.t"
101 cd contrib/perl || die
107 cmake-multilib_src_install
109 cd contrib/perl || die
110 perl-module_src_install
114 find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die