dev-lang/php: Drop olc revision
[gentoo.git] / dev-lang / icon / icon-9.4.3-r5.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 inherit eutils flag-o-matic multilib toolchain-funcs
5
6 MY_PV=${PV//./}
7 SRC_URI="http://www.cs.arizona.edu/icon/ftp/packages/unix/icon.v${MY_PV}src.tgz"
8 HOMEPAGE="http://www.cs.arizona.edu/icon/"
9 DESCRIPTION="very high level language"
10
11 LICENSE="public-domain HPND"
12 SLOT="0"
13 KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86"
14 IUSE="X iplsrc"
15
16 S="${WORKDIR}/icon.v${MY_PV}src"
17
18 DEPEND="X? ( x11-proto/xextproto
19                         x11-proto/xproto
20                         x11-libs/libX11
21                         x11-libs/libXpm
22                         x11-libs/libXt )
23         sys-devel/gcc"
24
25 src_unpack() {
26         unpack ${A}
27
28         epatch "${FILESDIR}"/${P}-flags.patch
29
30         # Patch the tests so that they do not fail
31         # The following files in tests/standard are patched..
32         # io.icn - change /etc/motd to /etc/gentoo-release
33         # io.std - change /etc/motd to /etc/gentoo-release
34         # kwds.std - add two lines for the two new added keywords
35         # nargs.std - a couple of functions picked up additional parameters
36         epatch "${FILESDIR}/tests-${MY_PV}.patch"
37
38         # do not prestrip files
39         find "${S}"/src -name 'Makefile' | xargs sed -i -e "/strip/d" || die
40 }
41
42 src_compile() {
43         # select the right compile target.  Note there are many platforms
44         # available
45         local mytarget;
46         if [[ ${CHOST} == *-darwin* ]]; then
47                 mytarget="macintosh"
48         else
49                 mytarget="linux"
50         fi
51
52         if use X; then
53                 emake X-Configure name=${mytarget} -j1 || die
54         else
55                 emake Configure name=${mytarget} -j1 || die
56         fi
57
58         echo "#define MultiThread 1" >> src/h/define.h
59         echo "#define EventMon 1" >> src/h/define.h
60         echo "#define Eve 1" >> src/h/define.h
61
62         append-flags $(test-flags -fno-strict-aliasing -fwrapv)
63
64         emake -j1 CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "Make Failed"
65 }
66
67 src_test() {
68         make Samples || die "Samples failed"
69         make Test || die "Test failed"
70 }
71
72 src_install() {
73         dodir /usr
74         dodir /usr/bin
75         dodir /usr/$(get_libdir)
76
77         make Install dest="${D}/usr/$(get_libdir)/icon" || die "Make install failed"
78         dosym /usr/$(get_libdir)/icon/bin/icont /usr/bin/icont
79         dosym /usr/$(get_libdir)/icon/bin/iconx /usr/bin/iconx
80         dosym /usr/$(get_libdir)/icon/bin/icon  /usr/bin/icon
81         dosym /usr/$(get_libdir)/icon/bin/vib   /usr/bin/vib
82
83         cd "${S}/man/man1"
84         doman icont.1
85         doman icon.1
86         rm -rf "${D}"/usr/$(get_libdir)/icon/man
87
88         cd "${S}/doc"
89         dodoc *.txt *.sed ../README
90         # dohtml ignores all anything except .html files, no use here
91         mkdir -p "${D}"/usr/share/doc/${PF}/html
92         cp -dpR *.htm *.gif *.jpg *.css "${D}"/usr/share/doc/${PF}/html
93         rm -rf "${D}"/usr/$(get_libdir)/icon/{doc,README}
94
95         # optional Icon Programming Library
96         if use iplsrc; then
97                 cd "${S}"
98                 dodir /usr/$(get_libdir)/icon/ipl
99                 rm ipl/BuildBin
100                 rm ipl/BuildExe
101                 rm ipl/CheckAll
102                 rm ipl/Makefile
103                 insinto /usr/$(get_libdir)/icon
104                 doins -r ipl
105         fi
106 }