summaryrefslogtreecommitdiff
blob: 63d0b64a05b2f6e9360dfb76b9db801c01fd08f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-util/rhide/rhide-1.5_pre-r1.ebuild,v 1.4 2003/02/13 11:59:57 vapier Exp $

IUSE="X"

SNAPSHOT="20020825"
TVISIONVER="1.1.4"
SETEDITVER="0.4.57"
# RHIDE is _very_ picky about the GDB used, so dont put GDB in DEPEND
GDBVER="5.2.1"

DESCRIPTION="RHIDE is a console IDE for various languages."
if [ -z "${SNAPSHOT}" ] ; then
	S="${WORKDIR}/${P}"
	SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
else
	S="${WORKDIR}/${P/_}-${SNAPSHOT}"
	SRC_URI="http://rhide.sourceforge.net/snapshots/${P/_}-${SNAPSHOT}.tar.gz
		mirror://gentoo/${P/_}-${SNAPSHOT}.tar.gz"
fi
SRC_URI="${SRC_URI}
	mirror://sourceforge/setedit/rhtvision-${TVISIONVER}.src.tar.gz
	mirror://sourceforge/setedit/setedit-${SETEDITVER}.tar.gz
	ftp://sourceware.cygnus.com/pub/gdb/releases/gdb-${GDBVER}.tar.gz"
HOMEPAGE="http://www.rhide.com/"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="x86"

DEPEND="virtual/glibc
	app-text/tetex
	>=app-text/recode-3.6
	>=dev-libs/libpcre-2.0.6
	>=sys-apps/bzip2-1.0.1
	>=sys-apps/texinfo-4.1
	>=sys-devel/gettext-0.11.0
	>=sys-devel/perl-5.6
	>=sys-libs/zlib-1.1.4
	>=sys-libs/gpm-1.20.0
	>=sys-libs/ncurses-5.2
	X? ( virtual/x11 )"

RDEPEND="${DEPEND}
	X? ( x11-terms/eterm )"


src_unpack() {
	
	unpack ${A}

	cd ${S}
	# Get it to compile with gdb-5.2.1
	# <azarah@gentoo.org> (22 Sep 2002)
	patch -p1 < ${FILESDIR}/${P}-gdb521-IS_FP_REGNUM.patch || die
	patch -p1 < ${FILESDIR}/${P}-gdb521-REGISTER_NAMES.patch || die

	cd ${WORKDIR}/tvision
	# Get tvision-1.1.4 to compile with gcc-3.1 or later
	# <azarah@gentoo.org> (22 Sep 2002)
	patch -p1 < ${FILESDIR}/tvision-1.1.4-gcc31-filebuf.patch || die
}

src_compile() {
	
	# Most of these use a _very_ weird build systems,
	# so please no comments ;/
	
# ************* TVision *************
	
	cd ${WORKDIR}/tvision/
	
	DUMMYFLAGS=""
	
	./configure --prefix=/usr \
		--fhs \
		--cflags='${DUMMYFLAGS}' \
		--cxxflags='${DUMMYFLAGS}' || die
	
	# Only build the static libs
	perl -pi -e 's/all: static-lib dynamic-lib/all: static-lib/' Makefile
	
	# -j breaks build
	make || die

	
# ************* SetEdit *************
	
	cd ${WORKDIR}/setedit/
	
	./configure --prefix=/usr \
		--fhs \
		--libset || die
	
	# -j breaks build
	make || die

	# Make the docs
	cd ${WORKDIR}/setedit/doc
	make || die
	
	
# ************* RHIDE ***************
	
	cd ${S}

	addpredict "/usr/share/rhide"

	# Update snapshot version
	if [ -n "${SNAPSHOT}" ]
	then
		perl -pi -e "s|1998-11-29|${SNAPSHOT}|" ${S}/idemain.cc
	fi
	
	# Fix invalid "-O2" in CFLAGS and CXXFLAGS
	for x in configure $(find . -name '*.mak') $(find . -name 'makefile.src')
	do
		if [ -f ${x} ]
		then
			perl -pi -e 's:-O2::g' ${x}
		fi
	done

	# Fix a dependency due to a broken .mak file
	perl -pi -e 's:../../../../::g' rh_comm.mak

	export RHIDESRC="${S}"
	export SETSRC="${WORKDIR}/setedit"
	export SETOBJ="${WORKDIR}/setedit/makes"
	export TVSRC="${WORKDIR}/tvision"
	export TVOBJ="${WORKDIR}/tvision/linux"
	export GDB_SRC="${WORKDIR}/gdb-${GDBVER}"

	econf || die
	
	#
	# *** DETECT XFREE86 with tvision-2.0 ***
	#
	# None of these packages have any way to specify XFree86 support,
	# thus we check if tvision compiled with xfree support or not.
	#
	# If it did compile with xfree support, we need to get rhide to link
	# against libX11 ...
	#
	local myLDFLAGS=""
	local have_xfree="$(gawk '/HAVE_X11/ { if (/yes/) print "Have XFree86" }' \
	                    ${WORKDIR}/tvision/configure.cache)"

	if [ "${have_xfree}" = "Have XFree86" ]
	then
		einfo "Compiling with XFree86 support..."
		myLDFLAGS="-L/usr/X11R6/lib -lX11"
	else
		einfo "Compiling without XFree86 support..."
	fi
	#
	# *** DETECT XFREE86 ***
	#
		
	# -j breaks build
	make prefix=/usr \
		install_docdir=share/doc/${PF} \
		install_infodir=share/info \
		LDFLAGS="${LDFLAGS} ${myLDFLAGS}" || die
	
	# Update and Fix DIR entry in .info files
	cd ${S}/share/setedit/
	sed -e 's:editor.inf:setedit.info:g' \
		${WORKDIR}/setedit/doc/editor.inf > setedit.inf
	sed -e 's:infeng.inf:infview.info:g' \
		${WORKDIR}/setedit/doc/infeng.inf > infview.inf
	cd ${S}
	
	# Update setedit macro's
	cp -f ${WORKDIR}/setedit/cfgfiles/*.pmc ${S}/share/setedit
}

src_install() {

	# Dont error out on sandbox violations.  I should really
	# try to track this down, but its a bit tougher than usually.
	addpredict "/:/usr/share/rhide:/libide:/libtvuti:/librhuti"
	
	make prefix=${D}/usr \
		install_docdir=share/doc/${PF} \
		install_infodir=share/info \
		install || die
	
	# Fix .info files
	for file in ${D}/usr/share/info/*.inf
	do
		if [ -f ${file} ]
		then
			mv -f ${file} ${file}o
		fi
	done

	# Install the manpages
	cd ${WORKDIR}/setedit/doc
	doman infview.1 setedit.1

	# Install default CFG file and fix the paths
	cd ${D}/usr/share/rhide
	sed -e 's:/usr/local/share:/usr/share:g' \
		rhide_.env >rhide.env
	echo 'INFOPATH=/usr/share/info' >> rhide.env

	# Install the terminfo file
	tic -o ${D}/usr/share/terminfo \
		${WORKDIR}/tvision/extra/eterm/xterm-eterm-tv

	# Install env file
	insinto /etc/env.d
	doins ${FILESDIR}/80rhide
}