[Android Q&A, Help & Troubleshooting] s0f0s:
I did the following

In x-roomservice.xml I added section

<!-- Recovery -->
<remove-project name="platform/bootable/recovery" />
<project name="android_bootable_recovery" path="bootable/recovery-twrp" remote="omnirom" revision="android-8.1" />

In the end of device/sony/z3/BoardConfig.mk I appended

# TWRP
RECOVERY_VARIANT := twrp
TW_THEME := portrait_hdpi

then

repo sync
//upd: here i picked the patches 65/28265/3 and 72/28672/1
make clean
. build/envsetup.sh
breakfast z3
mka recoveryimage

and got the error

$ mka recoveryimage
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=8.1.0
TARGET_PRODUCT=omni_z3
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.13.0-21-generic-x86_64-with-Ubuntu-17.10-artful
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=OPM3.171019.013
OUT_DIR=/home/user/Android/roms/OmniROM/8.1/out
============================================
[44/44] bootstrap /home/user/Android/r...ut/soong/.minibootstrap/build.ninja.in
[4/4] /home/user/Android/roms/OmniROM/...M/8.1/out/soong/.bootstrap/build.ninja
[870/871] glob vendor/*/*/*/*/*/*/Android.bp
[54/54] /home/user/Android/roms/OmniRO...roms/OmniROM/8.1/out/soong/build.ninja
/home/user/Android/roms/OmniROM/8.1/out/build-omni_z3.ninja is missing, regenerating...
[120/1001] including ./device/sony/msm8974-common/Android.mk ...
device-sony-common-init: init_sony for "z3", platform "shinano", with ' -DDEV_BLOCK_FOTA_NUM="16" -DDEV_BLOCK_FOTA_MAJOR="179" -DDEV_BLOCK_FOTA_MINOR="16" -DFOTA_RAMDISK_CHECK="0" -DKEYCHECK_ENABLED="1" -DKEYCHECK_NO_DOWN="1"'
[1001/1001] including ./vendor/sony/shinano-common-caf/proprietary/Android.mk ..
system/core/adb/Android.mk: error: adbd (EXECUTABLES android-arm) missing libbootloader_message (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: libhealthd_draw (STATIC_LIBRARIES android-arm) missing libminui (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: libhealthd_charger (STATIC_LIBRARIES android-arm) missing libminui (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/healthd/Android.mk: error: charger (EXECUTABLES android-arm) missing libminui (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/core/init/Android.mk: error: init (EXECUTABLES android-arm) missing libbootloader_message (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/extras/slideshow/Android.mk: error: slideshow (EXECUTABLES android-arm) missing libminui (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: libvold (STATIC_LIBRARIES android-arm) missing libbootloader_message (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
system/vold/Android.mk: error: vold (EXECUTABLES android-arm) missing libbootloader_message (STATIC_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/core/main.mk:728: error: exiting from previous errors.
02:15:48 ckati failed with: exit status 1

#### failed to build some targets (54 seconds) ####

then I tested that suggestion

export ALLOW_MISSING_DEPENDENCIES=true
make clean
. build/envsetup.sh
breakfast z3
mka recoveryimage

and got another error

$ mka recoveryimage
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=8.1.0
TARGET_PRODUCT=omni_z3
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.13.0-21-generic-x86_64-with-Ubuntu-17.10-artful
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=OPM3.171019.013
OUT_DIR=/home/user/Android/roms/OmniROM/8.1/out
============================================
[44/44] bootstrap /home/user/Android/r...ut/soong/.minibootstrap/build.ninja.in
[4/4] /home/user/Android/roms/OmniROM/...M/8.1/out/soong/.bootstrap/build.ninja
[870/871] glob vendor/*/*/*/*/*/*/Android.bp
[54/54] /home/user/Android/roms/OmniRO...roms/OmniROM/8.1/out/soong/build.ninja
/home/user/Android/roms/OmniROM/8.1/out/build-omni_z3.ninja is missing, regenerating...
[120/1001] including ./device/sony/msm8974-common/Android.mk ...
device-sony-common-init: init_sony for "z3", platform "shinano", with ' -DDEV_BLOCK_FOTA_NUM="16" -DDEV_BLOCK_FOTA_MAJOR="179" -DDEV_BLOCK_FOTA_MINOR="16" -DFOTA_RAMDISK_CHECK="0" -DKEYCHECK_ENABLED="1" -DKEYCHECK_NO_DOWN="1"'
[1001/1001] including ./vendor/sony/shinano-common-caf/proprietary/Android.mk ..
PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/VideoRecord_48k.ogg:system/media/audio/ui/VideoRecord.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/VideoStop_48k.ogg:system/media/audio/ui/VideoStop.ogg ignored.
PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/camera_click_48k.ogg:system/media/audio/ui/camera_click.ogg ignored.
build/core/Makefile:1146: error: FindEmulator: find: `bootable/recovery/res-xhdpi': No such file or directory
02:13:28 ckati failed with: exit status 1

#### failed to build some targets (52 seconds) ####

It looks like build system does not recognize the TWRP recovery because res-xhdpi present but under bootable/recovery-twrp But why?

I am not familiar with IRC. Is it normal to post there a message like this one?