app-editors: Remove *-fbsd KEYWORDS
[gentoo.git] / app-editors / nedit / nedit-5.6-r1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit eutils toolchain-funcs
7
8 DESCRIPTION="Multi-purpose text editor for the X Window System"
9 HOMEPAGE="https://sourceforge.net/projects/nedit"
10 SRC_URI="
11         https://downloads.sourceforge.net/project/${PN}/${PN}-source/${P}a-src.tar.gz
12         https://dev.gentoo.org/~jlec/distfiles/${PN}.png.xz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="alpha amd64 ~mips ppc sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
17
18 RDEPEND=">=x11-libs/motif-2.3:0
19         x11-libs/libXt
20         x11-libs/libX11"
21 DEPEND="${RDEPEND}
22         || ( dev-util/yacc sys-devel/bison )
23         dev-lang/perl"
24
25 S="${WORKDIR}/${PN}-5.6"
26
27 src_prepare() {
28         #respecting LDFLAGS, bug #208189
29         epatch \
30                 "${FILESDIR}"/${P}-format.patch \
31                 "${FILESDIR}"/${P}-ldflags.patch \
32                 "${FILESDIR}"/${P}-40_Pointer_to_Integer.patch \
33                 "${FILESDIR}"/${P}-security.patch
34         sed \
35                 -e "s:bin/:${EPREFIX}/bin/:g" \
36                 -i Makefile source/preferences.c source/help_data.h source/nedit.c Xlt/Makefile || die
37         sed \
38                 -e "s:nc:neditc:g" -i doc/nc.pod || die
39         sed -i -e "s:CFLAGS=-O:CFLAGS=${CFLAGS}:" -e "s:check_tif_rule::" \
40                 makefiles/Makefile.linux || die
41         sed -i -e "s:CFLAGS=-O:CFLAGS=${CFLAGS}:"                  \
42                    -e "s:MOTIFDIR=/usr/local:MOTIFDIR=${EPREFIX}/usr:" \
43                    -e "s:-lX11:-lX11 -lXmu -liconv:"                   \
44                    -e "s:check_tif_rule::"                             \
45                 makefiles/Makefile.macosx || die
46
47         epatch_user
48 }
49
50 src_compile() {
51         case "${CHOST}" in
52                 *-darwin*)
53                         emake CC="$(tc-getCC)" AR="$(tc-getAR)" macosx
54                         ;;
55                 *-linux*)
56                         emake CC="$(tc-getCC)" AR="$(tc-getAR)" linux
57                         ;;
58         esac
59         emake VERSION="NEdit ${PV}" -C doc all
60 }
61
62 src_install() {
63         dobin source/nedit
64         newbin source/nc neditc
65
66         make_desktop_entry "${PN}"
67         doicon "${WORKDIR}/${PN}.png"
68
69         newman doc/nedit.man nedit.1
70         newman doc/nc.man neditc.1
71
72         dodoc README ReleaseNotes ChangeLog
73         dodoc doc/nedit.doc doc/NEdit.ad doc/faq.txt
74         dohtml doc/nedit.html
75 }