dev-python/pip: arm64 keyworded (bug #719700)
[gentoo.git] / dev-lang / icon / icon-9.5.1-r2.ebuild
1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit flag-o-matic toolchain-funcs
7
8 DESCRIPTION="very high level language"
9 HOMEPAGE="http://www.cs.arizona.edu/icon/"
10
11 MY_PV=${PV//./}
12 SRC_URI="http://www.cs.arizona.edu/icon/ftp/packages/unix/icon-v${MY_PV}src.tgz"
13
14 LICENSE="public-domain HPND"
15 SLOT="0"
16 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
17 IUSE="X iplsrc"
18
19 S="${WORKDIR}/icon-v${MY_PV}src"
20
21 RDEPEND="
22         X? ( x11-libs/libX11:= )"
23 DEPEND="
24         ${RDEPEND}
25         X? (
26                 x11-libs/libXpm
27                 x11-libs/libXt
28         )"
29
30 PATCHES=(
31         "${FILESDIR}"/${PN}-9.5.1-flags.patch
32         # https://bugs.gentoo.org/669330
33         # Fix glibc 2.28 problem.
34         # Patch has also been submitted for upstream approval
35         "${FILESDIR}"/${PN}-9.5.1-fpoll.patch
36 )
37
38 src_prepare() {
39         default
40
41         # do not prestrip files
42         find src -name 'Makefile' | xargs sed -i -e "/strip/d" || die
43 }
44
45 src_configure() {
46         # select the right compile target.  Note there are many platforms
47         # available
48         local mytarget;
49         if [[ ${CHOST} == *-darwin* ]]; then
50                 mytarget="macintosh"
51         else
52                 mytarget="linux"
53         fi
54
55         # Fails if more then one make job process.
56         # This is an upstream requirement.
57         emake -j1 $(usex X X-Configure Configure) name=${mytarget}
58
59         # sanitise the Makedefs file generated by Configure
60         sed -i \
61                 -e 's:-L/usr/X11R6/lib64::g' \
62                 -e 's:-L/usr/X11R6/lib::g' \
63                 -e 's:-I/usr/X11R6/include::g' \
64                 Makedefs || die "sed of Makedefs failed"
65
66         append-flags $(test-flags -fno-strict-aliasing -fwrapv)
67 }
68
69 src_compile() {
70         # Fails if more then one make job process.
71         # This is an upstream requirement.
72         emake -j1 CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
73 }
74
75 src_test() {
76         emake Samples
77         emake Test
78 }
79
80 src_install() {
81         # Needed for make Install
82         dodir /usr/$(get_libdir)
83
84         emake Install dest="${D}/usr/$(get_libdir)/icon"
85         dosym ../$(get_libdir)/icon/bin/icont /usr/bin/icont
86         dosym ../$(get_libdir)/icon/bin/iconx /usr/bin/iconx
87         dosym ../$(get_libdir)/icon/bin/icon  /usr/bin/icon
88         dosym ../$(get_libdir)/icon/bin/vib   /usr/bin/vib
89
90         cd "${S}/man/man1" || die
91         doman "${PN}"t.1
92         doman "${PN}".1
93
94         cd "${S}/doc" || die
95         DOCS=( *.txt ../README )
96
97         HTML_DOCS=( *.{htm,gif,jpg,css} )
98         einstalldocs
99
100         # Clean up items from make Install that get installed elsewhere
101         rm -rf "${ED}"/usr/$(get_libdir)/${PN}/man || die
102         rm -rf "${ED}"/usr/$(get_libdir)/icon/{doc,README} || die
103
104         # optional Icon Programming Library
105         if use iplsrc; then
106                 cd "${S}" || die
107
108                 # Remove unneeded files before copy
109                 rm -fv ipl/{BuildBin,BuildExe,CheckAll,Makefile} || die
110
111                 insinto /usr/$(get_libdir)/icon
112                 doins -r ipl
113         fi
114 }