# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: S="${WORKDIR}/nedit-5.4RC1" DESCRIPTION="multi-purpose text editor for the X Window System" SRC_URI="http://www.nedit.org/ftp//nedit-5.4RC1.tar.bz2" HOMEPAGE="http://nedit.org" LICENSE="GPL-2" #KEYWORDS="~x86" KEYWORDS="-*" SLOT="0" RDEPEND="virtual/aspell-dict" DEPEND="${RDEPEND} dev-util/yacc virtual/motif" ALLOW_BAD_MOTIF=yes src_unpack() { unpack ${A} cd ${S} chmod -R +w ${S} epatch "${FILESDIR}/nedit-5.4RC1-gentoo_pre.diff" # # nedit-5.4RC1 is a bit picky about *tif-versions it prefers to # be built with. If it detects a known-bad version, we have to # define `BUILD_BROKEN_NEDIT', which will append `(KNOWN-BAD)' to # the version string and add a short paragraph explaining the # situation to "Help"->"Version". It also requires the user to # press a key before compiling begins. # (see `util/check_lin_tif.c' for a list of known-good versions). # LC_ALL="C" sed -i \ -e 's:\(fgets(buf, 2, stdin);\):/*\1*/\n\tfprintf(stderr,"\\n");:g'\ ${S}/util/check_lin_tif.c || die "patching check_lin_tif" } src_compile() { local cflags="${CFLAGS} -D_GENTOO_ -DHAVE__XMVERSIONSTRING" local ldflags= if [ "$ALLOW_BAD_MOTIF" = "yes" ]; then # no error checking here..this is supposed to return an error # if `check_lin_tif' complains about a `bad motif' version. make -C util -f ../makefiles/Makefile.linux \ E_CFLAGS="${cflags}" \ E_LDFLAGS="${ldflags}" \ check_tif_rule ; tif_check=$? make -C util -f ../makefiles/Makefile.linux clean if [ $tif_check -gt 0 ]; then einfo "bad motif detected, adding '-DBUILD_BROKEN_NEDIT'" cflags="${cflags} -DBUILD_BROKEN_NEDIT" fi unset tif_check fi make \ E_CFLAGS="${cflags}" \ E_LDFLAGS="${ldflags}" \ linux || die "make failed" } src_install() { into /usr dobin source/nedit exeinto /usr/bin newexe source/nc neditc newman doc/nedit.man nedit.1 newman doc/nc.man neditc.1 dodoc README ReleaseNotes ChangeLog COPYRIGHT cd doc dodoc *.txt nedit.doc README.FAQ NEdit.ad dohtml *.{dtd,xsl,xml,html,awk} }