Instead of patching build.rs to detect Portage, disable the check-x11 default feature on the tfc dependency in libs/enigo/Cargo.toml. This prevents tfc's build.rs from running loginctl at all during the build.