        ${extra_cmake_args}
        -Wno-dev
 -    PATCH_COMMAND
--      ${Patch_EXECUTABLE} -p1 -N < ${CMAKE_CURRENT_SOURCE_DIR}/install-patch.diff
+-      ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> git apply -p1 --ignore-space-change --whitespace=nowarn ${CMAKE_CURRENT_SOURCE_DIR}/install-patch.diff
    )
  
    # The external project will install to the build folder, but we'll install that on make install.

 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ebd9584..36f66f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,22 +37,14 @@ macro(build_uncrustify)
   endif()
 
   include(ExternalProject)
-  find_package(Patch REQUIRED)
 
-  # Pinning to tip of master at the time of a desired bugfix
-  set(uncrustify_version 45b836cff040594994d364ad6fd3f04adc890a26)
-  set(uncrustify_version_hash 7cc32ad800c8d639bdf145e2a113a66b)
   # Get uncrustify 0.68.1
   ExternalProject_Add(uncrustify-0.68.1
-    URL https://github.com/uncrustify/uncrustify/archive/${uncrustify_version}.tar.gz
-    URL_MD5 ${uncrustify_version_hash}
-    TIMEOUT 600
+    SOURCE_DIR ${CMAKE_SOURCE_DIR}/uncrustify-upstream
     CMAKE_ARGS

From 2661a731c10c745413fb33a69c5515e7f3dcfa4f Mon Sep 17 00:00:00 2001
From: Martin Jansa <martin.jansa@lge.com>
Date: Mon, 27 Jul 2020 09:56:44 -0700
Subject: [PATCH] CMakeLists.txt: fetch uncrustify with bitbake fetcher
