To build twrp lollipop:
First, download the source and add it to cm12 sources. (If you have omnirom sources you already have twrp in bootable/recovery. just use mka recoveryimage to build it instead of mka recoveryimage RECOVERY_VARIANT=twrp.) You could also apply the follwing to philz recovery builds.
https://github.com/omnirom/android_bootable_recovery/tree/android-5.1
use the "Download ZIP" button on the bottom right to download the source zip. You can also add the above to a local_manifest.xml if you wish to recieve updates with every repo sync.
Unzip the contents to ~/pathtocm12source/bootable/recovery-twrp
Finally to compile:
if you already have a build ran, unfortunately you will have to clobber it. I know theres a way around it, and a google search will explain what i dont feel like explaining here, how to run a new recovery build with cm12 already built.
run the following in terminal:
cd ~/pathtocm12source
make clobber
. build/envsetup.sh
prebuilts/misc/linux-x86/ccache/ccache -M 50G
export USE_CCACHE=1
lunch (choose cm_x5-userdebug)
mka recoveryimage RECOVERY_VARIANT=twrp
That will produce a bumped twrp img in /out/target/product/x5 if you are using bad_mofo's cm12 sources. You can boot it and test it out without flashing by rebooting to fastboot and entering the following:
fastboot boot whateveryourtwrpimgiscalled.img
to make sure everything works nicely. Alternatively you can flash it using:
fastboot flash recovery whateveryourtwrpimgiscalled.img
and when everything is good upload it to androidforums for all of us to enjoy.