Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libcaca/, media-libs/libcaca/files/
Date: Mon, 01 Mar 2021 17:34:02
Message-Id: 1614620018.3fa25c71ca75f3f5353813553b61bd5c934dcad8.sam@gentoo
1 commit: 3fa25c71ca75f3f5353813553b61bd5c934dcad8
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 1 17:33:10 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 1 17:33:38 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3fa25c71
7
8 media-libs/libcaca: modernise ebuild, fix ncurses linkage
9
10 Closes: https://bugs.gentoo.org/601902
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 .../files/libcaca-0.99_beta18-fix-tests.patch | 12 +-
14 .../files/libcaca-0.99_beta18-latex_hacks.patch | 4 +-
15 media-libs/libcaca/libcaca-0.99_beta19-r2.ebuild | 167 +++++++++++++++++++++
16 3 files changed, 175 insertions(+), 8 deletions(-)
17
18 diff --git a/media-libs/libcaca/files/libcaca-0.99_beta18-fix-tests.patch b/media-libs/libcaca/files/libcaca-0.99_beta18-fix-tests.patch
19 index f9ff8090c21..1bfb931a75a 100644
20 --- a/media-libs/libcaca/files/libcaca-0.99_beta18-fix-tests.patch
21 +++ b/media-libs/libcaca/files/libcaca-0.99_beta18-fix-tests.patch
22 @@ -1,13 +1,13 @@
23 ---- test/Makefile.am
24 -+++ test/Makefile.am
25 +--- a/test/Makefile.am
26 ++++ b/test/Makefile.am
27 @@ -1,3 +1,5 @@
28 +AM_TESTS_ENVIRONMENT = \
29 + top_srcdir="$(top_srcdir)"
30
31 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/caca -I../caca
32
33 ---- test/check-copyright
34 -+++ test/check-copyright
35 +--- a/test/check-copyright
36 ++++ b/test/check-copyright
37 @@ -3,10 +3,11 @@
38 #
39 # Check that the copyright information is valid
40 @@ -30,8 +30,8 @@
41 echo "error: $dir/$x lacks proper copyright information"
42 nfails=$(($nfails + 1))
43 elif [ -d ../.git ]; then
44 ---- test/check-source
45 -+++ test/check-source
46 +--- a/test/check-source
47 ++++ b/test/check-source
48 @@ -3,6 +3,7 @@
49 #
50 # Check that we have no tabs or trailing spaces in the source code
51
52 diff --git a/media-libs/libcaca/files/libcaca-0.99_beta18-latex_hacks.patch b/media-libs/libcaca/files/libcaca-0.99_beta18-latex_hacks.patch
53 index 060822e6dcc..15e17d2f95e 100644
54 --- a/media-libs/libcaca/files/libcaca-0.99_beta18-latex_hacks.patch
55 +++ b/media-libs/libcaca/files/libcaca-0.99_beta18-latex_hacks.patch
56 @@ -1,8 +1,8 @@
57 Hack it a bit differently so that it works with texlive 2013, see http://bugs.gentoo.org/480862
58 Turns out this patch is required also for texlive 2012, see http://bugs.gentoo.org/517474
59
60 ---- doc/Makefile.am
61 -+++ doc/Makefile.am
62 +--- a/doc/Makefile.am
63 ++++ b/doc/Makefile.am
64 @@ -29,7 +29,7 @@ if BUILD_DOCUMENTATION
65 if USE_LATEX
66 rm -f latex/libcaca.tex latex/libcaca.pdf
67
68 diff --git a/media-libs/libcaca/libcaca-0.99_beta19-r2.ebuild b/media-libs/libcaca/libcaca-0.99_beta19-r2.ebuild
69 new file mode 100644
70 index 00000000000..c1ec14de152
71 --- /dev/null
72 +++ b/media-libs/libcaca/libcaca-0.99_beta19-r2.ebuild
73 @@ -0,0 +1,167 @@
74 +# Copyright 1999-2020 Gentoo Authors
75 +# Distributed under the terms of the GNU General Public License v2
76 +
77 +EAPI=7
78 +
79 +RUBY_OPTIONAL=yes
80 +#USE_RUBY=ruby20
81 +
82 +inherit autotools ruby-ng flag-o-matic mono-env java-pkg-opt-2 multilib-minimal toolchain-funcs
83 +
84 +MY_P=${P/_/.}
85 +DESCRIPTION="A library that creates colored ASCII-art graphics"
86 +HOMEPAGE="http://libcaca.zoy.org/"
87 +SRC_URI="http://libcaca.zoy.org/files/${PN}/${MY_P}.tar.gz"
88 +S="${WORKDIR}/${MY_P}"
89 +
90 +LICENSE="GPL-2 ISC LGPL-2.1 WTFPL-2"
91 +SLOT="0"
92 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
93 +IUSE="cxx doc imlib java mono ncurses opengl ruby slang static-libs test truetype X"
94 +RESTRICT="!test? ( test )"
95 +
96 +# ruby? ( ruby_targets_${USE_RUBY} )
97 +REQUIRED_USE=""
98 +
99 +COMMON_DEPEND="imlib? ( >=media-libs/imlib2-1.4.6-r2[${MULTILIB_USEDEP}] )
100 + mono? ( dev-lang/mono )
101 + ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
102 + opengl? (
103 + >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}]
104 + >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}]
105 + >=media-libs/freeglut-2.8.1[${MULTILIB_USEDEP}]
106 + truetype? ( >=media-libs/ftgl-2.1.3_rc5 )
107 + )
108 + slang? ( >=sys-libs/slang-2.2.4-r1[${MULTILIB_USEDEP}] )
109 + X? ( >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}] >=x11-libs/libXt-1.1.4[${MULTILIB_USEDEP}] )"
110 +# ruby? ( $(ruby_implementations_depend) )
111 +RDEPEND="${COMMON_DEPEND}
112 + java? ( >=virtual/jre-1.5 )"
113 +DEPEND="${COMMON_DEPEND}
114 + virtual/pkgconfig
115 + doc? (
116 + app-doc/doxygen
117 + virtual/latex-base
118 + >=dev-texlive/texlive-fontsrecommended-2012
119 + >=dev-texlive/texlive-latexextra-2012
120 + dev-texlive/texlive-latexrecommended
121 + )
122 + java? ( >=virtual/jdk-1.5 )
123 + test? ( dev-util/cppunit )"
124 +
125 +DOCS=( AUTHORS ChangeLog NEWS NOTES README THANKS )
126 +
127 +PATCHES=(
128 + # Removed 'has_version '>=dev-texlive/texlive-latex-2013' &&' that prefixed this
129 + # patch before wrt #517474
130 + "${FILESDIR}"/${PN}-0.99_beta18-latex_hacks.patch
131 + # Fix out of source tests
132 + "${FILESDIR}"/${PN}-0.99_beta18-fix-tests.patch
133 +)
134 +
135 +pkg_setup() {
136 + java-pkg-opt-2_pkg_setup
137 + use mono && mono-env_pkg_setup
138 +}
139 +
140 +src_unpack() {
141 + default
142 +}
143 +
144 +src_prepare() {
145 + # bug #339962
146 + sed -i -e '/doxygen_tests = check-doxygen/d' test/Makefile.am || die
147 +
148 + sed -i \
149 + -e 's:-g -O2 -fno-strength-reduce -fomit-frame-pointer::' \
150 + -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
151 + configure.ac || die
152 +
153 + sed -i \
154 + -e 's:$(JAVAC):$(JAVAC) $(JAVACFLAGS):' \
155 + -e 's:libcaca_java_la_CPPFLAGS =:libcaca_java_la_CPPFLAGS = -I$(top_srcdir)/caca:' \
156 + java/Makefile.am || die
157 +
158 + if ! use truetype; then
159 + sed -i -e '/PKG_CHECK_MODULES/s:ftgl:dIsAbLe&:' configure.ac || die
160 + fi
161 +
162 + if use imlib && ! use X; then
163 + append-cflags -DX_DISPLAY_MISSING
164 + fi
165 +
166 + # bug #653400
167 + append-cxxflags -std=c++11
168 +
169 + # bug #601902
170 + append-libs "$($(tc-getPKG_CONFIG) --libs ncurses)"
171 +
172 + default
173 + eautoreconf
174 +
175 + java-pkg-opt-2_src_prepare
176 +}
177 +
178 +multilib_src_configure() {
179 + if multilib_is_native_abi; then
180 + if use java; then
181 + export JAVACFLAGS="$(java-pkg_javac-args)"
182 + export JAVA_CFLAGS="$(java-pkg_get-jni-cflags)"
183 + fi
184 +
185 + # bug #44128
186 + export VARTEXFONTS="${T}/fonts"
187 +
188 + # bug #329651
189 + use mono && export CSC="$(type -P gmcs)"
190 + use ruby && use ruby_targets_${USE_RUBY} && export RUBY=$(ruby_implementation_command ${USE_RUBY})
191 + fi
192 +
193 + local myeconfargs=(
194 + $(use_enable static-libs static)
195 + $(use_enable slang)
196 + $(use_enable ncurses)
197 + $(use_enable X x11)
198 + $(use_with X x)
199 + --x-libraries=/usr/$(get_libdir)
200 + $(use_enable opengl gl)
201 + $(use_enable cxx)
202 + $(use_enable imlib imlib2)
203 + $(use_enable test cppunit)
204 + $(multilib_native_use_enable java)
205 + $(multilib_native_use_enable ruby)
206 + --disable-python
207 + $(multilib_native_use_enable mono csharp)
208 + $(multilib_native_use_enable doc)
209 + )
210 +
211 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
212 +}
213 +
214 +multilib_src_compile() {
215 + local _java_makeopts
216 +
217 + # bug #480864
218 + use java && _java_makeopts="-j1"
219 + emake V=1 ${_java_makeopts}
220 +}
221 +
222 +multilib_src_test() {
223 + emake V=1 -j1 check
224 +}
225 +
226 +multilib_src_install() {
227 + emake V=1 DESTDIR="${D}" install
228 +
229 + if multilib_is_native_abi && use java; then
230 + java-pkg_newjar java/libjava.jar
231 + fi
232 +}
233 +
234 +multilib_src_install_all() {
235 + einstalldocs
236 +
237 + rm -rf "${ED}"/usr/share/java || die
238 +
239 + find "${ED}" -name '*.la' -delete || die
240 +}