Apr 17, 2013

Compile Zotac MCE remote in Gentoo

Update (28/08/2013): This patch has been merged with the main portage tree as of lirc version 0.9.0-r3

If you own a Zotac ZBOX or similar hardware with the included MCE remote, you can find that upon compiling lirc in Gentoo, that the remote is not fully configured and not all buttons work. In this case you have two choices: configure the remote as default an map the buttons manually or use information in this post to compile lirc with zotac remote support and enable all buttons.


I've already filled a bug in Gentoo's Bugzilla to add the source to the main portage tree in order to avoid the following steps. The files you will need right now are: lirc_ebuild.patch and zotac.patch use left-click + save target as... These files will add the needed sources to compile the zotac remote and patch the actual portage ebuild of lirc, letting you reinstall it with the new added sources.
  • lirc_ebuild.patch: This patch needs to be applied to the current app-misc/lirc portage ebuild, you can find it in /usr/portage/app-misc/lirc, in order to apply the patch run the following:
    cd /usr/portage/app-misc/lirc
    patch -p1 lirc_ebuild.patch
    
  • zotac.patch: This patchs needs to be copied to the files folder in app-misc/lirc:
    cp zotac.patch
    /usr/portage/app-misc/lirc/files/zotac.patch
  • Manifest: Once the new files are copied, we need to rebuild the manifest file:
    cd /usr/portage/app-misc/lirc
    ebuild lirc-0.9.0-r2.ebuild manifest
    
Then we have the patches configured, we can define lirc devices as zotac in our make.conf file:
LIRC_DEVICES="zotac"

Once finished with the patchs and configuration, we can recompile lirc. The new version of lirc will have the zotac remote compiled and all the buttons mapped. This works almost out of the box on XBMC and I'm sure it works also in similar systems.

To avoid rewriting the modified version of lirc, add it to the masked packages:
echo "app-misc/lirc >> /etc/portage/package.mask"
This way it won't be recompiled when you update the portage tree.