Boot: Use the PyPI version of imgtool

Modifies the Python wrapper for imgtool in TF-M to use the PyPI
version instead of the one in the MCUBoot repository.

Signed-off-by: Balint Matyi <Balint.Matyi@arm.com>
Change-Id: I0b3fb9c802c59628cced0962241a1b4573a00cfc
diff --git a/bl2/ext/mcuboot/scripts/requirements.txt b/bl2/ext/mcuboot/scripts/requirements.txt
index d3c54b4..14bbb18 100644
--- a/bl2/ext/mcuboot/scripts/requirements.txt
+++ b/bl2/ext/mcuboot/scripts/requirements.txt
@@ -2,4 +2,5 @@
 pyasn1
 pyyaml
 cbor>=1.0.0
+imgtool>=1.6.0
 click
\ No newline at end of file
diff --git a/bl2/ext/mcuboot/scripts/wrapper.py b/bl2/ext/mcuboot/scripts/wrapper/wrapper.py
similarity index 95%
rename from bl2/ext/mcuboot/scripts/wrapper.py
rename to bl2/ext/mcuboot/scripts/wrapper/wrapper.py
index 14ad07a..0944336 100644
--- a/bl2/ext/mcuboot/scripts/wrapper.py
+++ b/bl2/ext/mcuboot/scripts/wrapper/wrapper.py
@@ -11,13 +11,12 @@
 import os
 import sys
 import click
-import macro_parser
-# Import the external MCUBoot repo's imgtool script
-scripts_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
-                                            '../../../../../mcuboot/scripts'))
-sys.path.insert(0, scripts_path)
 import imgtool
 import imgtool.main
+# Import macro_parser script
+parser_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
+sys.path.append(parser_path)
+import macro_parser
 
 sign_bin_size_re = re.compile(r"^\s*RE_SIGN_BIN_SIZE\s*=\s*(.*)")
 load_addr_re = re.compile(r"^\s*RE_IMAGE_LOAD_ADDRESS\s*=\s*(.*)")