--- /usr/portage/app-misc/lirc/lirc-0.9.0.ebuild 2012-04-30 06:38:03.883981963 +0100 +++ lirc-0.9.0.ebuild 2012-04-30 07:54:19.173123527 +0100 @@ -225,11 +225,7 @@ fi fi - # Setup parameter for linux-mod.eclass - MODULE_NAMES="lirc(misc:${S})" - BUILD_TARGETS="all" - - ECONF_PARAMS=" --localstatedir=/var + EXTRA_ECONF=" --localstatedir=/var --with-syslog=LOG_DAEMON --enable-sandboxed --with-kerneldir=${KV_DIR} @@ -273,6 +269,9 @@ # respect CFLAGS sed -i -e 's:CFLAGS="-O2:CFLAGS=""\n#CFLAGS="-O2:' configure.ac + # Do not build drivers from the top-level Makefile + sed -i -e 's:\(SUBDIRS =\) drivers\(.*\):\1\2:' Makefile.am + # setting default device-node local f for f in configure.ac acconfig.h; do @@ -283,9 +282,39 @@ eautoreconf } +src_compile() { + # configure needs to be run with "kernel style" ABI to configure + # the drivers, but the lirc tree uses autoconf/libtool which has + # a different interpretation to the kernel tree of some things. In + # particular LDFLAGS. + local myABI="${ABI}" + set_arch_to_kernel + ABI="${KERNEL_ABI}" + + econf || die + + set_arch_to_portage + ABI="${myABI}" + + # The drivers subdir has been disabled from the top-level Makefile + # above to separate the libtool based stage from the kernel modules. + # Build everything but drivers + emake || die + + # Now build the drivers using linux-mod.eclass + # Setup parameter for linux-mod.eclass + MODULE_NAMES="lirc(misc:${S}/drivers)" + BUILD_TARGETS="all" + + linux-mod_src_compile || die +} + src_install() { emake DESTDIR="${D}" install || die "emake install failed" + # Install drivers + emake -C drivers DESTDIR="${D}" install || die "emake install drivers failed" + newinitd "${FILESDIR}"/lircd-0.8.6 lircd newinitd "${FILESDIR}"/lircmd lircmd newconfd "${FILESDIR}"/lircd.conf.2 lircd