media-gfx/sane-backends: x86 stable (bug #653506)
[gentoo.git] / dev-lang / icon / icon-9.5.1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit eutils flag-o-matic multilib toolchain-funcs
7
8 MY_PV=${PV//./}
9 SRC_URI="http://www.cs.arizona.edu/icon/ftp/packages/unix/icon-v${MY_PV}src.tgz"
10 HOMEPAGE="http://www.cs.arizona.edu/icon/"
11 DESCRIPTION="very high level language"
12
13 LICENSE="public-domain HPND"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
16 IUSE="X iplsrc"
17
18 S="${WORKDIR}/icon-v${MY_PV}src"
19
20 DEPEND="X? ( x11-proto/xextproto
21                 x11-proto/xproto
22                 x11-libs/libX11
23                 x11-libs/libXpm
24                 x11-libs/libXt )
25         || ( sys-devel/gcc sys-devel/gcc-apple )"
26
27 PATCHES=( "${FILESDIR}"/${P}-flags.patch )
28
29 src_prepare() {
30         epatch "${PATCHES[@]}"
31
32         # do not prestrip files
33         find "${S}"/src -name 'Makefile' | xargs sed -i -e "/strip/d" || die
34 }
35
36 src_configure() {
37         # select the right compile target.  Note there are many platforms
38         # available
39         local mytarget;
40         if [[ ${CHOST} == *-darwin* ]]; then
41                 mytarget="macintosh"
42         else
43                 mytarget="linux"
44         fi
45
46         if use X; then
47                 emake X-Configure name=${mytarget} -j1 || die
48         else
49                 emake Configure name=${mytarget} -j1 || die
50         fi
51
52         # sanitise the Makedefs file generated by Configure
53         sed -i \
54                 -e 's:-L/usr/X11R6/lib64::g' \
55                 -e 's:-L/usr/X11R6/lib::g' \
56                 -e 's:-I/usr/X11R6/include::g' \
57                 Makedefs || die "sed of Makedefs failed"
58
59         append-flags $(test-flags -fno-strict-aliasing -fwrapv)
60 }
61
62 src_compile() {
63         emake -j1 CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
64 }
65
66 src_test() {
67         make Samples || die "Samples failed"
68         make Test || die "Test failed"
69 }
70
71 src_install() {
72         dodir /usr
73         dodir /usr/bin
74         dodir /usr/$(get_libdir)
75
76         make Install dest="${ED}/usr/$(get_libdir)/icon" || die "Make install failed"
77         dosym ../$(get_libdir)/icon/bin/icont /usr/bin/icont
78         dosym ../$(get_libdir)/icon/bin/iconx /usr/bin/iconx
79         dosym ../$(get_libdir)/icon/bin/icon  /usr/bin/icon
80         dosym ../$(get_libdir)/icon/bin/vib   /usr/bin/vib
81
82         cd "${S}/man/man1" || die
83         doman "${PN}"t.1
84         doman "${PN}".1
85         rm -rf "${ED}"/usr/$(get_libdir)/${PN}/man || die
86
87         cd "${S}/doc" || die
88         dodoc *.txt *.sed ../README
89         # dohtml ignores all anything except .html files, no use here
90         mkdir -p "${ED}"/usr/share/doc/${PF}/html
91         cp -dpR *.htm *.gif *.jpg *.css "${ED}"/usr/share/doc/${PF}/html || die
92         rm -rf "${ED}"/usr/$(get_libdir)/icon/{doc,README} || die
93
94         # optional Icon Programming Library
95         if use iplsrc; then
96                 cd "${S}" || die
97                 dodir /usr/$(get_libdir)/icon/ipl
98                 rm -fv ipl/{BuildBin,BuildExe,CheckAll,Makefile} || die
99                 insinto /usr/$(get_libdir)/icon
100                 doins -r ipl
101         fi
102 }