diff options
Diffstat (limited to 'misc/rbutil/patches')
-rw-r--r-- | misc/rbutil/patches/bundled-licenses.patch | 38 | ||||
-rw-r--r-- | misc/rbutil/patches/rbutil-1.4.1-quazip.patch | 63 | ||||
-rw-r--r-- | misc/rbutil/patches/rbutil-1.5.1-cmake.patch | 32 | ||||
-rw-r--r-- | misc/rbutil/patches/rbutil-1.5.1-headers.patch | 17 | ||||
-rw-r--r-- | misc/rbutil/patches/rbutil-1.5.1-system-quazip.patch | 150 | ||||
-rw-r--r-- | misc/rbutil/patches/system-bzip2.patch | 12 | ||||
-rw-r--r-- | misc/rbutil/patches/system-mspack.patch | 118 | ||||
-rw-r--r-- | misc/rbutil/patches/system-tomcrypt.patch | 83 |
8 files changed, 450 insertions, 63 deletions
diff --git a/misc/rbutil/patches/bundled-licenses.patch b/misc/rbutil/patches/bundled-licenses.patch new file mode 100644 index 0000000000..1bb1b970ae --- /dev/null +++ b/misc/rbutil/patches/bundled-licenses.patch @@ -0,0 +1,38 @@ +diff --git a/utils/rbutilqt/rbutilqt.cpp b/utils/rbutilqt/rbutilqt.cpp +--- a/utils/rbutilqt/rbutilqt.cpp ++++ b/utils/rbutilqt/rbutilqt.cpp +@@ -303,21 +303,13 @@ + + QString html = "<p>" + tr("Libraries used") + "</p>"; + html += "<ul>"; +- html += "<li>Speex: <a href='#speex'>Speex License</a></li>"; + html += "<li>bspatch: <a href='#bspatch'>bspatch License</a></li>"; +- html += "<li>bzip2: <a href='#bzip2'>bzip2 License</a></li>"; +- html += "<li>mspack: <a href='#lgpl2'>LGPL v2.1 License</a></li>"; +- html += "<li>quazip: <a href='#lgpl2'>LGPL v2.1 License</a></li>"; +- html += "<li>tomcrypt: <a href='#tomcrypt'>Tomcrypt License</a></li>"; + html += "<li>CuteLogger: <a href='#lgpl2'>LGPL v2.1 License</a></li>"; + html += "</ul>"; + about.browserLicenses->insertHtml(html); + + QMap<QString, QString> licenses; +- licenses[":/docs/COPYING.SPEEX"] = "<a id='speex'>Speex License</a>"; + licenses[":/docs/lgpl-2.1.txt"] = "<a id='lgpl2'>LGPL v2.1</a>"; +- licenses[":/docs/LICENSE.TOMCRYPT"] = "<a id='tomcrypt'>Tomcrypt License</a>"; +- licenses[":/docs/LICENSE.BZIP2"] = "<a id='bzip2'>bzip2 License</a>"; + licenses[":/docs/LICENSE.BSPATCH"] = "<a id='bspatch'>bspatch License</a>"; + + for (auto it = licenses.keyBegin(); it != licenses.keyEnd(); ++it) { +diff --git a/utils/rbutilqt/rbutilqt.qrc b/utils/rbutilqt/rbutilqt.qrc +--- a/utils/rbutilqt/rbutilqt.qrc ++++ b/utils/rbutilqt/rbutilqt.qrc +@@ -3,9 +3,6 @@ + <file alias="docs/CREDITS">../../docs/CREDITS</file> + <file alias="docs/gpl-2.0.html">../../docs/gpl-2.0.html</file> + <file alias="docs/lgpl-2.1.txt">logger/LICENSE.LGPL</file> +- <file alias="docs/COPYING.SPEEX">../../lib/rbcodec/codecs/libspeex/COPYING</file> +- <file alias="docs/LICENSE.TOMCRYPT">../../utils/tomcrypt/LICENSE</file> +- <file alias="docs/LICENSE.BZIP2">../bzip2/LICENSE</file> + <file alias="docs/LICENSE.BSPATCH">../bspatch/LICENSE</file> + <file alias="docs/changelog.txt">changelog.txt</file> + </qresource> diff --git a/misc/rbutil/patches/rbutil-1.4.1-quazip.patch b/misc/rbutil/patches/rbutil-1.4.1-quazip.patch deleted file mode 100644 index 596127c340..0000000000 --- a/misc/rbutil/patches/rbutil-1.4.1-quazip.patch +++ /dev/null @@ -1,63 +0,0 @@ -This patch is a simplified version of a patch I have sent upstream. -http://gerrit.rockbox.org/1825 - --- Chewi - -diff -Naur a/base/ziputil.cpp b/base/ziputil.cpp ---- a/base/ziputil.cpp 2019-11-10 06:45:49.000000000 +0000 -+++ b/base/ziputil.cpp 2019-12-04 22:38:34.443112450 +0000 -@@ -22,9 +22,9 @@ - #include "progressloggerinterface.h" - #include "Logger.h" - --#include "quazip/quazip.h" --#include "quazip/quazipfile.h" --#include "quazip/quazipfileinfo.h" -+#include <quazip5/quazip.h> -+#include <quazip5/quazipfile.h> -+#include <quazip5/quazipfileinfo.h> - - - ZipUtil::ZipUtil(QObject* parent) : ArchiveUtil(parent) -diff -Naur a/base/ziputil.h b/base/ziputil.h ---- a/base/ziputil.h 2019-11-10 06:45:49.000000000 +0000 -+++ b/base/ziputil.h 2019-12-04 22:38:34.443112450 +0000 -@@ -21,9 +21,9 @@ - - #include <QtCore> - #include "archiveutil.h" --#include "quazip/quazip.h" --#include "quazip/quazipfile.h" --#include "quazip/quazipfileinfo.h" -+#include <quazip5/quazip.h> -+#include <quazip5/quazipfile.h> -+#include <quazip5/quazipfileinfo.h> - - class ZipUtil : public ArchiveUtil - { -diff -Naur a/rbutilqt.pro b/rbutilqt.pro ---- a/rbutilqt.pro 2019-11-10 06:45:50.000000000 +0000 -+++ b/rbutilqt.pro 2019-12-04 22:43:30.144259710 +0000 -@@ -131,7 +131,7 @@ - - DEPENDPATH = $$INCLUDEPATH - --LIBS += -L$$OUT_PWD -L$$MYLIBBUILDDIR -+LIBS += -L$$OUT_PWD -L$$MYLIBBUILDDIR -lquazip5 - # append all RBLIBS to LIBS - for(rblib, RBLIBS) { - LIBS += -l$$rblib -@@ -142,7 +142,6 @@ - - # on win32 libz is linked implicitly. - !win32 { -- LIBS += -lz - } - - # Add a (possibly found) libspeex now, don't do this before -lrbspeex! -@@ -271,5 +270,4 @@ - - # source files are separate. - include(rbutilqt.pri) --include(quazip/quazip.pri) - include(logger/logger.pri) diff --git a/misc/rbutil/patches/rbutil-1.5.1-cmake.patch b/misc/rbutil/patches/rbutil-1.5.1-cmake.patch new file mode 100644 index 0000000000..276dba7e61 --- /dev/null +++ b/misc/rbutil/patches/rbutil-1.5.1-cmake.patch @@ -0,0 +1,32 @@ +diff -Naur a/utils/CMakeLists.txt b/utils/CMakeLists.txt +--- a/utils/CMakeLists.txt 2022-04-18 20:05:44.073208000 +0100 ++++ b/utils/CMakeLists.txt 2022-07-07 16:19:17.378055916 +0100 +@@ -358,22 +358,6 @@ + ) + target_include_directories(rbtomcrypt PUBLIC ${CMAKE_CURRENT_LIST_DIR}/tomcrypt/src/headers) + +-add_library(skin_parser +- ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/skin_buffer.c +- ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/skin_buffer.h +- ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/skin_debug.c +- ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/skin_debug.h +- ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/skin_parser.c +- ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/skin_parser.h +- ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/skin_scan.c +- ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/skin_scan.h +- ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/symbols.h +- ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/tag_table.c +- ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/tag_table.h +- ) +-target_include_directories(skin_parser PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser) +-target_compile_definitions(skin_parser PUBLIC __PCTOOL__) +- + # target will always be build. File is only updated when contents change. + add_custom_target(gitversion.h + COMMENT "Updating gitversion.h" +@@ -391,5 +375,3 @@ + include(${CMAKE_CURRENT_LIST_DIR}/cmake/deploy.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/cmake/QtTest.cmake) + add_subdirectory(rbutilqt) +-add_subdirectory(themeeditor) +- diff --git a/misc/rbutil/patches/rbutil-1.5.1-headers.patch b/misc/rbutil/patches/rbutil-1.5.1-headers.patch new file mode 100644 index 0000000000..ff7ac8760f --- /dev/null +++ b/misc/rbutil/patches/rbutil-1.5.1-headers.patch @@ -0,0 +1,17 @@ +https://bugs.gentoo.org/830559 +https://www.rockbox.org/tracker/task/13358 + +Note: This may need tweaking for non-Linux platforms. + +diff --git a/utils/sansapatcher/sansaio.h b/utils/sansapatcher/sansaio.h +index 61e2f1d1b2..327f8fbd18 100644 +--- a/utils/sansapatcher/sansaio.h ++++ b/utils/sansapatcher/sansaio.h +@@ -23,6 +23,7 @@ + #define __SANSAIO_H + + #include <stdint.h> ++#include <sys/types.h> + #if !defined(_MSC_VER) + #include <unistd.h> /* not available on MSVC */ + #endif diff --git a/misc/rbutil/patches/rbutil-1.5.1-system-quazip.patch b/misc/rbutil/patches/rbutil-1.5.1-system-quazip.patch new file mode 100644 index 0000000000..84b9655c0c --- /dev/null +++ b/misc/rbutil/patches/rbutil-1.5.1-system-quazip.patch @@ -0,0 +1,150 @@ +From 930293a899825ae552370a060dd04117ebc5fdae Mon Sep 17 00:00:00 2001 +From: James Le Cuirot <chewi@gentoo.org> +Date: Thu, 7 Jul 2022 21:52:54 +0100 +Subject: [PATCH] rbutil: Add USE_SYSTEM_QUAZIP option to use system-wide + QuaZIP + +QuaZIP is included in several major Linux distributions and packaging +policies strongly oppose bundling of libraries. + +Change-Id: I8d454784dc4b244f4dd8aa18deb3350a29aaab77 +--- + docs/CREDITS | 1 + + utils/rbutilqt/CMakeLists.txt | 65 ++++++++++++++++++--------------- + utils/rbutilqt/base/ziputil.cpp | 6 +-- + utils/rbutilqt/base/ziputil.h | 6 +-- + 4 files changed, 43 insertions(+), 35 deletions(-) + +diff --git a/docs/CREDITS b/docs/CREDITS +index 6f7c23fc7e..3a6fcb83b9 100644 +--- a/docs/CREDITS ++++ b/docs/CREDITS +@@ -710,6 +710,7 @@ Marc Aarts + Fabrice Bellard + Selami Dinçer + Matej Golian ++James Le Cuirot + + The libmad team + The wavpack team +diff --git a/utils/rbutilqt/CMakeLists.txt b/utils/rbutilqt/CMakeLists.txt +index 41954cb9ee..350790109b 100644 +--- a/utils/rbutilqt/CMakeLists.txt ++++ b/utils/rbutilqt/CMakeLists.txt +@@ -255,9 +255,43 @@ if(APPLE) + ${CMAKE_CURRENT_LIST_DIR}/base/ttscarbon.h) + endif() + ++option(USE_SYSTEM_QUAZIP "Use system QuaZIP library" OFF) ++if(USE_SYSTEM_QUAZIP) ++ find_package(QuaZip-Qt5 REQUIRED) ++ set(QUAZIP_LIBRARY QuaZip::QuaZip) ++else() ++ # TODO: Upstream has cmake support, use that instead. ++ add_library(quazip ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/ioapi.h ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/minizip_crypt.h ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/qioapi.cpp ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip.cpp ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfile.cpp ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfile.h ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfileinfo.cpp ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfileinfo.h ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip_global.h ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip.h ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipnewinfo.cpp ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipnewinfo.h ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/unzip.c ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/unzip.h ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/zip.c ++ ${CMAKE_CURRENT_LIST_DIR}/quazip/zip.h ++ ) ++ target_include_directories(quazip PUBLIC ${CMAKE_CURRENT_LIST_DIR}/quazip) ++ target_link_libraries(quazip z Qt${QT_VERSION_MAJOR}::Core) ++ if(QT_VERSION_MAJOR EQUAL 6) ++ target_link_libraries(quazip Qt${QT_VERSION_MAJOR}::Core5Compat) ++ endif() ++ target_compile_definitions(quazip PUBLIC QUAZIP_STATIC) ++ set_property(TARGET quazip PROPERTY AUTOMOC ON) ++ set(QUAZIP_LIBRARY quazip) ++endif() ++ + target_link_libraries(rbbase +- cutelogger quazip mspack bspatch rbspeex voicefont +- sansapatcher ipodpatcher chinachippatcher ++ cutelogger ${QUAZIP_LIBRARY} mspack bspatch rbspeex ++ voicefont sansapatcher ipodpatcher chinachippatcher + mkamsboot mkimxboot mkmpioboot mktccboot mks5lboot + Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network) + target_include_directories(rbbase PUBLIC ${CMAKE_CURRENT_LIST_DIR}/base) +@@ -298,33 +332,6 @@ target_link_libraries(cutelogger PUBLIC Qt${QT_VERSION_MAJOR}::Core) + target_compile_definitions(cutelogger PUBLIC CUTELOGGER_STATIC) + set_property(TARGET cutelogger PROPERTY AUTOMOC ON) + +-# TODO: Upstream has cmake support, use that instead. +-add_library(quazip +- ${CMAKE_CURRENT_LIST_DIR}/quazip/ioapi.h +- ${CMAKE_CURRENT_LIST_DIR}/quazip/minizip_crypt.h +- ${CMAKE_CURRENT_LIST_DIR}/quazip/qioapi.cpp +- ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip.cpp +- ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfile.cpp +- ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfile.h +- ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfileinfo.cpp +- ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfileinfo.h +- ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip_global.h +- ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip.h +- ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipnewinfo.cpp +- ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipnewinfo.h +- ${CMAKE_CURRENT_LIST_DIR}/quazip/unzip.c +- ${CMAKE_CURRENT_LIST_DIR}/quazip/unzip.h +- ${CMAKE_CURRENT_LIST_DIR}/quazip/zip.c +- ${CMAKE_CURRENT_LIST_DIR}/quazip/zip.h +- ) +-target_include_directories(quazip PUBLIC ${CMAKE_CURRENT_LIST_DIR}/quazip) +-target_link_libraries(quazip z Qt${QT_VERSION_MAJOR}::Core) +-if(QT_VERSION_MAJOR EQUAL 6) +- target_link_libraries(quazip Qt${QT_VERSION_MAJOR}::Core5Compat) +-endif() +-target_compile_definitions(quazip PUBLIC QUAZIP_STATIC) +-set_property(TARGET quazip PROPERTY AUTOMOC ON) +- + add_library(mspack + #mspack/cabc.c + mspack/cabd.c +diff --git a/utils/rbutilqt/base/ziputil.cpp b/utils/rbutilqt/base/ziputil.cpp +index e285446711..877a861253 100644 +--- a/utils/rbutilqt/base/ziputil.cpp ++++ b/utils/rbutilqt/base/ziputil.cpp +@@ -22,9 +22,9 @@ + #include "progressloglevels.h" + #include "Logger.h" + +-#include "quazip/quazip.h" +-#include "quazip/quazipfile.h" +-#include "quazip/quazipfileinfo.h" ++#include <quazip.h> ++#include <quazipfile.h> ++#include <quazipfileinfo.h> + + + ZipUtil::ZipUtil(QObject* parent) : ArchiveUtil(parent) +diff --git a/utils/rbutilqt/base/ziputil.h b/utils/rbutilqt/base/ziputil.h +index 73a87a820a..ea32ca42c3 100644 +--- a/utils/rbutilqt/base/ziputil.h ++++ b/utils/rbutilqt/base/ziputil.h +@@ -21,9 +21,9 @@ + + #include <QtCore> + #include "archiveutil.h" +-#include "quazip/quazip.h" +-#include "quazip/quazipfile.h" +-#include "quazip/quazipfileinfo.h" ++#include <quazip.h> ++#include <quazipfile.h> ++#include <quazipfileinfo.h> + + class ZipUtil : public ArchiveUtil + { +-- +2.35.1 + diff --git a/misc/rbutil/patches/system-bzip2.patch b/misc/rbutil/patches/system-bzip2.patch new file mode 100644 index 0000000000..98189d2566 --- /dev/null +++ b/misc/rbutil/patches/system-bzip2.patch @@ -0,0 +1,12 @@ +diff --git a/utils/bspatch/bspatch.c b/utils/bspatch/bspatch.c +--- a/utils/bspatch/bspatch.c ++++ b/utils/bspatch/bspatch.c +@@ -30,7 +30,7 @@ + #include <stdarg.h> + #include <sys/types.h> + #endif +-#include "../bzip2/bzlib.h" ++#include <bzlib.h> + #include <stdlib.h> + #include <stdio.h> + #include <string.h> diff --git a/misc/rbutil/patches/system-mspack.patch b/misc/rbutil/patches/system-mspack.patch new file mode 100644 index 0000000000..cd7e3d0045 --- /dev/null +++ b/misc/rbutil/patches/system-mspack.patch @@ -0,0 +1,118 @@ +diff --git a/utils/rbutilqt/CMakeLists.txt b/utils/rbutilqt/CMakeLists.txt +--- a/utils/rbutilqt/CMakeLists.txt ++++ b/utils/rbutilqt/CMakeLists.txt +@@ -289,8 +289,53 @@ + set(QUAZIP_LIBRARY quazip) + endif() + ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(MSPACK libmspack) ++if(NOT ${MSPACK_FOUND}) ++ add_library(mspack ++ #mspack/cabc.c ++ mspack/cabd.c ++ mspack/cab.h ++ #mspack/chmc.c ++ #mspack/chmd.c ++ #mspack/chm.h ++ mspack/des.h ++ #mspack/hlpc.c ++ #mspack/hlpd.c ++ #mspack/hlp.h ++ #mspack/kwajc.c ++ #mspack/kwajd.c ++ #mspack/kwaj.h ++ #mspack/litc.c ++ #mspack/litd.c ++ #mspack/lit.h ++ #mspack/lzssd.c ++ #mspack/lzss.h ++ mspack/lzxc.c ++ mspack/lzxd.c ++ mspack/lzx.h ++ mspack/mspack.h ++ mspack/mszipc.c ++ mspack/mszipd.c ++ mspack/mszip.h ++ mspack/qtmd.c ++ mspack/qtm.h ++ mspack/readbits.h ++ mspack/readhuff.h ++ mspack/sha.h ++ mspack/system-mspack.c ++ mspack/system-mspack.h ++ #mspack/szddc.c ++ #mspack/szddd.c ++ #mspack/szdd.h ++ ) ++ ++ target_include_directories(mspack PUBLIC ${CMAKE_CURRENT_LIST_DIR}/mspack) ++ set(MSPACK_LIBRARIES mspack) ++endif() ++ + target_link_libraries(rbbase +- cutelogger ${QUAZIP_LIBRARY} mspack bspatch rbspeex ++ cutelogger ${QUAZIP_LIBRARY} ${MSPACK_LIBRARIES} bspatch rbspeex + voicefont sansapatcher ipodpatcher chinachippatcher + mkamsboot mkimxboot mkmpioboot mktccboot mks5lboot + Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network) +@@ -332,47 +377,6 @@ target_link_libraries(cutelogger PUBLIC Qt${QT_VERSION_MAJOR}::Core) + target_compile_definitions(cutelogger PUBLIC CUTELOGGER_STATIC) + set_property(TARGET cutelogger PROPERTY AUTOMOC ON) + +-add_library(mspack +- #mspack/cabc.c +- mspack/cabd.c +- mspack/cab.h +- #mspack/chmc.c +- #mspack/chmd.c +- #mspack/chm.h +- mspack/des.h +- #mspack/hlpc.c +- #mspack/hlpd.c +- #mspack/hlp.h +- #mspack/kwajc.c +- #mspack/kwajd.c +- #mspack/kwaj.h +- #mspack/litc.c +- #mspack/litd.c +- #mspack/lit.h +- #mspack/lzssd.c +- #mspack/lzss.h +- mspack/lzxc.c +- mspack/lzxd.c +- mspack/lzx.h +- mspack/mspack.h +- mspack/mszipc.c +- mspack/mszipd.c +- mspack/mszip.h +- mspack/qtmd.c +- mspack/qtm.h +- mspack/readbits.h +- mspack/readhuff.h +- mspack/sha.h +- mspack/system-mspack.c +- mspack/system-mspack.h +- #mspack/szddc.c +- #mspack/szddd.c +- #mspack/szdd.h +- ) +- +-target_include_directories(mspack PUBLIC ${CMAKE_CURRENT_LIST_DIR}/mspack) +- +- + # Unit tests + add_executable(test_compareversion + base/utils.cpp +diff --git a/utils/rbutilqt/base/mspackutil.h b/utils/rbutilqt/base/mspackutil.h +--- a/utils/rbutilqt/base/mspackutil.h ++++ b/utils/rbutilqt/base/mspackutil.h +@@ -21,7 +21,7 @@ + + #include <QtCore> + #include "archiveutil.h" +-#include "mspack/mspack.h" ++#include <mspack.h> + + class MsPackUtil : public ArchiveUtil + { diff --git a/misc/rbutil/patches/system-tomcrypt.patch b/misc/rbutil/patches/system-tomcrypt.patch new file mode 100644 index 0000000000..cdff54f832 --- /dev/null +++ b/misc/rbutil/patches/system-tomcrypt.patch @@ -0,0 +1,83 @@ +diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt +--- a/utils/CMakeLists.txt ++++ b/utils/CMakeLists.txt +@@ -264,7 +264,7 @@ + ) + + target_include_directories(sbtools PUBLIC ${CMAKE_CURRENT_LIST_DIR}/imxtools/sbtools) +-target_link_libraries(sbtools PUBLIC rbtomcrypt) ++target_link_libraries(sbtools PUBLIC tomcrypt) + + add_library(mkmpioboot + mkmpioboot/mkmpioboot.c +@@ -328,35 +328,41 @@ else() + message("-- Found libbz2: ${LIBBZ2}") + endif() + +-add_library(rbtomcrypt +- tomcrypt/src/ciphers/aes/aes.c +- tomcrypt/src/ciphers/aes/aes_tab.c +- tomcrypt/src/misc/crypt/crypt_argchk.c +- tomcrypt/src/misc/crypt/crypt_register_cipher.c +- tomcrypt/src/misc/crypt/crypt_cipher_is_valid.c +- tomcrypt/src/misc/crypt/crypt_cipher_descriptor.c +- tomcrypt/src/misc/zeromem.c +- tomcrypt/src/misc/compare_testvector.c +- tomcrypt/src/modes/cbc/cbc_start.c +- tomcrypt/src/modes/cbc/cbc_decrypt.c +- tomcrypt/src/modes/cbc/cbc_encrypt.c +- tomcrypt/src/hashes/sha1.c +- tomcrypt/src/headers/tomcrypt_argchk.h +- tomcrypt/src/headers/tomcrypt_cfg.h +- tomcrypt/src/headers/tomcrypt_cipher.h +- tomcrypt/src/headers/tomcrypt_custom.h +- tomcrypt/src/headers/tomcrypt.h +- tomcrypt/src/headers/tomcrypt_hash.h +- tomcrypt/src/headers/tomcrypt_mac.h +- tomcrypt/src/headers/tomcrypt_macros.h +- tomcrypt/src/headers/tomcrypt_math.h +- tomcrypt/src/headers/tomcrypt_misc.h +- tomcrypt/src/headers/tomcrypt_pkcs.h +- tomcrypt/src/headers/tomcrypt_pk.h +- tomcrypt/src/headers/tomcrypt_private.h +- tomcrypt/src/headers/tomcrypt_prng.h +- ) +-target_include_directories(rbtomcrypt PUBLIC ${CMAKE_CURRENT_LIST_DIR}/tomcrypt/src/headers) ++find_library(LIBTOMCRYPT tomcrypt) ++if(${LIBTOMCRYPT} STREQUAL "LIBTOMCRYPT-NOTFOUND") ++ message("-- tomcrypt not found, building our own") ++ add_library(tomcrypt ++ tomcrypt/src/ciphers/aes/aes.c ++ tomcrypt/src/ciphers/aes/aes_tab.c ++ tomcrypt/src/misc/crypt/crypt_argchk.c ++ tomcrypt/src/misc/crypt/crypt_register_cipher.c ++ tomcrypt/src/misc/crypt/crypt_cipher_is_valid.c ++ tomcrypt/src/misc/crypt/crypt_cipher_descriptor.c ++ tomcrypt/src/misc/zeromem.c ++ tomcrypt/src/misc/compare_testvector.c ++ tomcrypt/src/modes/cbc/cbc_start.c ++ tomcrypt/src/modes/cbc/cbc_decrypt.c ++ tomcrypt/src/modes/cbc/cbc_encrypt.c ++ tomcrypt/src/hashes/sha1.c ++ tomcrypt/src/headers/tomcrypt_argchk.h ++ tomcrypt/src/headers/tomcrypt_cfg.h ++ tomcrypt/src/headers/tomcrypt_cipher.h ++ tomcrypt/src/headers/tomcrypt_custom.h ++ tomcrypt/src/headers/tomcrypt.h ++ tomcrypt/src/headers/tomcrypt_hash.h ++ tomcrypt/src/headers/tomcrypt_mac.h ++ tomcrypt/src/headers/tomcrypt_macros.h ++ tomcrypt/src/headers/tomcrypt_math.h ++ tomcrypt/src/headers/tomcrypt_misc.h ++ tomcrypt/src/headers/tomcrypt_pkcs.h ++ tomcrypt/src/headers/tomcrypt_pk.h ++ tomcrypt/src/headers/tomcrypt_private.h ++ tomcrypt/src/headers/tomcrypt_prng.h ++ ) ++target_include_directories(tomcrypt PUBLIC ${CMAKE_CURRENT_LIST_DIR}/tomcrypt/src/headers) ++else() ++ message("-- Found libtomcrypt: ${LIBTOMCRYPT}") ++endif() + + add_library(skin_parser + ${CMAKE_CURRENT_LIST_DIR}/../lib/skin_parser/skin_buffer.c |