View | Details | Raw Unified
Collapse All | Expand All

(-) /usr/portage/app-editors/qemacs/qemacs-0.3.1-r1.ebuild (-12 / +61 lines)
 Lines 11-42    Link Here 
LICENSE="LGPL-2.1"
LICENSE="LGPL-2.1"
SLOT="0"
SLOT="0"
KEYWORDS="~x86 ~amd64 ~ppc"
KEYWORDS="~x86 ~amd64 ~ppc"
IUSE="X png unicode"
IUSE="X png unicode xv ffmpeg"
DEPEND="X? ( virtual/x11 )
DEPEND="X? ( virtual/x11 )
	png? ( =media-libs/libpng-1.2* )"
	png? ( =media-libs/libpng-1.2* )
	ffmpeg? ( media-video/ffmpeg )"
src_unpack() {
src_unpack() {
	unpack ${A}
	unpack ${A}
	cd ${S}
	cd ${S}
	epatch ${FILESDIR}/qemacs-Makefile-gentoo.patch
	# Add a patch to install to DESTDIR, make directories during install
	# and install the binary/man page using the qemacs name to avoid clash
	# with app-editors/qe.
	# Also removes forced march setting and align-functions on x86, as
	# they would override user's CFLAGS..
	epatch ${FILESDIR}/${P}-Makefile-gentoo.patch
	# Change the references to the qe binary to reflect the installed name
	# qemacs.
	epatch ${FILESDIR}/${P}-manpage-ref-fix.patch
	# Set the datadir to qemacs, upstream installs in to qe which conflicts
	# with files installed in app-editors/qe.  Currently no breakage
	# occurs, but it makes sense to change before that happens.
	epatch ${FILESDIR}/${P}-qemacs-datadir.patch
	# Use the installed version of ffmpeg, instead of forcing a static link
	# and requiring the ffmpeg source for the build.
	useq ffmpeg && epatch ${FILESDIR}/${P}-use-installed-ffmpeg.patch
	epatch ${FILESDIR}/${P}-configure-gentoo.patch
	epatch ${FILESDIR}/${P}-configure-gentoo.patch
	epatch ${FILESDIR}/${P}-make_backup.patch
	epatch ${FILESDIR}/${P}-make_backup.patch
	use unicode && epatch ${FILESDIR}/${P}-tty_utf8.patch
	useq unicode && epatch ${FILESDIR}/${P}-tty_utf8.patch
	# Change the manpage to reference a /real/ file instead of just an
	# approximation.  Purely cosmetic!
	sed -i "s,^/usr/share/doc/qemacs,&-${PV}," qe.1
}
}
src_compile() {
src_compile() {
	local myconf
	econf $(use_enable X x11) \
	use X && myconf="--enable-x11" || myconf="--disable-x11"
		$(use_enable png) \
	use png && myconf="${myconf} --enable-png" || myconf="${myconf} --disable-png"
		$(use_enable xv) \
	econf ${myconf} || die "econf failed"
		$(use_enable ffmpeg) \
		|| die "econf failed"
	emake -j1 || die
	emake -j1 || die
}
}
src_test() {
	# There are some files purporting to be tests in the tarball, however
	# there is no defined way to use them and I imagine even if there was
	# it would require user interaction.
	# The toplevel Makefile calls the test target from the non-existant 
	# tests/Makefile, so just noop to stop errors if maketest is set.
	:
}
src_install() {
src_install() {
	dodir /usr/bin
	make install DESTDIR=${D} || die
	einstall || die
	dodoc Changelog README TODO config.eg
	doman qe.1
	dodoc Changelog README TODO VERSION
	dohtml *.html
	dohtml *.html
	insinto /usr/share/doc/${PF}/plugin-example/
	dodoc plugin-example/*
	# Install headers so users can build their own plugins.
	insinto /usr/include/qemacs
	doins cfb.h config.h cutils.h display.h fbfrender.h libfbf.h qe.h \
		qeconfig.h qestyles.h qfribidi.h 
	cd libqhtml
	insinto /usr/include/qemacs/libqhtml
	doins {css{,id},htmlent}.h
}
pkg_postinst() {
	einfo "This version of qemacs is not entirely backwards compatible with"
	einfo "versions prior to 0.3.1-r1."
	echo
	einfo "The name of the binary has been changed to qemacs, to fix a name"
	einfo "clash with app-editors/qe."
	echo
	einfo "The location of user config files have been changed to ~/.qemacs, to"
	einfo "remove some ambiguity."
}
}