--- src/lib/fcitx-utils/Fcitx5Download.cmake.in.orig	2020-12-04 23:50:28 UTC
+++ src/lib/fcitx-utils/Fcitx5Download.cmake.in
@@ -1,11 +1,16 @@
+SET(FCITX5_DOWNLOAD_DISALLOWED $ENV{FCITX5_DOWNLOAD_DISALLOWED})
 if (NOT EXISTS "@FCITX5_DOWNLOAD_DEST@")
     message(STATUS "Downloading '@FCITX5_DOWNLOAD_URL@' to '@FCITX5_DOWNLOAD_DEST@'...")
-    file(DOWNLOAD
-         "@FCITX5_DOWNLOAD_URL@"
-         "@FCITX5_DOWNLOAD_DEST@"
-         EXPECTED_HASH SHA256=@FCITX5_DOWNLOAD_SHA256@
-         TLS_VERIFY ON
-         SHOW_PROGRESS)
+    if (NOT FCITX5_DOWNLOAD_DISALLOWED)
+        file(DOWNLOAD
+             "@FCITX5_DOWNLOAD_URL@"
+             "@FCITX5_DOWNLOAD_DEST@"
+             EXPECTED_HASH SHA256=@FCITX5_DOWNLOAD_SHA256@
+             TLS_VERIFY ON
+             SHOW_PROGRESS)
+    else()
+        message(FATAL_ERROR "Downloading is disallowed")
+    endif()
 else()
     file(SHA256 "@FCITX5_DOWNLOAD_DEST@" actual_value)
     if(NOT "${actual_value}" STREQUAL "@FCITX5_DOWNLOAD_SHA256@")
