summaryrefslogtreecommitdiffstats
path: root/misc/rbutil
diff options
context:
space:
mode:
Diffstat (limited to 'misc/rbutil')
-rw-r--r--misc/rbutil/README3
-rw-r--r--misc/rbutil/doinst.sh10
-rw-r--r--misc/rbutil/patches/bundled-licenses.patch38
-rw-r--r--misc/rbutil/patches/rbutil-1.5.1-cmake.patch32
-rw-r--r--misc/rbutil/patches/rbutil-1.5.1-headers.patch17
-rw-r--r--misc/rbutil/patches/rbutil-1.5.1-system-quazip.patch150
-rw-r--r--misc/rbutil/patches/system-bzip2.patch12
-rw-r--r--misc/rbutil/patches/system-mspack.patch118
-rw-r--r--misc/rbutil/patches/system-tomcrypt.patch83
-rw-r--r--misc/rbutil/rbutil.SlackBuild136
-rw-r--r--misc/rbutil/rbutil.info10
-rw-r--r--misc/rbutil/slack-desc19
12 files changed, 628 insertions, 0 deletions
diff --git a/misc/rbutil/README b/misc/rbutil/README
new file mode 100644
index 0000000000..6659264264
--- /dev/null
+++ b/misc/rbutil/README
@@ -0,0 +1,3 @@
+This is the automated installer tool for Rockbox.
+
+Rockbox is a free replacement firmware for digital music players.
diff --git a/misc/rbutil/doinst.sh b/misc/rbutil/doinst.sh
new file mode 100644
index 0000000000..4a25de5e6f
--- /dev/null
+++ b/misc/rbutil/doinst.sh
@@ -0,0 +1,10 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
+
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.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
diff --git a/misc/rbutil/rbutil.SlackBuild b/misc/rbutil/rbutil.SlackBuild
new file mode 100644
index 0000000000..37cee5c07c
--- /dev/null
+++ b/misc/rbutil/rbutil.SlackBuild
@@ -0,0 +1,136 @@
+#!/bin/bash
+
+# Slackware build script for RockboxUtility
+
+# Copyright 2020-2022 Kyle Guinn <elyk03@gmail.com>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=rbutil
+SRCNAM=RockboxUtility
+VERSION=${VERSION:-1.5.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ case "$(uname -m)" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$(uname -m) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+DOCS="docs/COPYING docs/CREDITS utils/rbutilqt/changelog.txt"
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $SRCNAM-v$VERSION-src
+tar xvf $CWD/$SRCNAM-v$VERSION-src.tar.bz2
+cd $SRCNAM-v$VERSION-src
+chown -R root:root .
+chmod -R u+w,go-w,a+rX-st .
+
+# Use the system quazip. Thanks to gentoo.
+patch -p1 < $CWD/patches/rbutil-1.5.1-system-quazip.patch
+patch -p1 < $CWD/patches/rbutil-1.5.1-cmake.patch
+patch -p1 < $CWD/patches/rbutil-1.5.1-headers.patch
+
+# Use the system bzip2, only for use with bspatch
+# (another 3rd party program, modified by Rockbox
+# for use as a library, so cannot be unbundled).
+patch -p1 < $CWD/patches/system-bzip2.patch
+
+# Use the system mspack.
+patch -p1 < $CWD/patches/system-mspack.patch
+
+# Use the system tomcrypt.
+patch -p1 < $CWD/patches/system-tomcrypt.patch
+
+# Ensure we don't build/use these bundled libs.
+patch -p1 < $CWD/patches/bundled-licenses.patch
+rm -rf \
+ lib/rbcodec/codecs/libspeex \
+ utils/rbutilqt/mspack \
+ utils/rbutilqt/quazip \
+ utils/rbutilqt/zlib \
+ utils/bzip2 \
+ utils/tomcrypt \
+
+# Decrease the amount of log spam.
+sed -i 's/Logger::Debug/Logger::Warning/' utils/rbutilqt/logger/src/AbstractAppender.cpp
+
+mkdir -p utils/build
+cd utils/build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=None \
+ -DCMAKE_RULE_MESSAGES=OFF \
+ -DCMAKE_VERBOSE_MAKEFILE=TRUE \
+ -DBUILD_SHARED_LIBS=OFF \
+ -DCCACHE_PROGRAM=FALSE \
+ -DUSE_SYSTEM_QUAZIP=ON \
+ -DCMAKE_EXE_LINKER_FLAGS="-lgmp" \
+ ..
+ make
+ install -D -m 0755 -s rbutilqt/RockboxUtility $PKG/usr/bin/RockboxUtility
+cd ../..
+install -D -m 0644 utils/rbutilqt/RockboxUtility.desktop $PKG/usr/share/applications/RockboxUtility.desktop
+install -D -m 0644 docs/logo/rockbox-clef.svg $PKG/usr/share/icons/hicolor/scalable/apps/rockbox-clef.svg
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/misc/rbutil/rbutil.info b/misc/rbutil/rbutil.info
new file mode 100644
index 0000000000..2df31d939b
--- /dev/null
+++ b/misc/rbutil/rbutil.info
@@ -0,0 +1,10 @@
+PRGNAM="rbutil"
+VERSION="1.5.1"
+HOMEPAGE="https://www.rockbox.org/wiki/RockboxUtility"
+DOWNLOAD="https://download.rockbox.org/rbutil/source/RockboxUtility-v1.5.1-src.tar.bz2"
+MD5SUM="e995b21923a19975b5b10987de7af528"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="libmspack libtomcrypt"
+MAINTAINER="Kyle Guinn"
+EMAIL="elyk03@gmail.com"
diff --git a/misc/rbutil/slack-desc b/misc/rbutil/slack-desc
new file mode 100644
index 0000000000..15093b73b1
--- /dev/null
+++ b/misc/rbutil/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+rbutil: rbutil (Rockbox Utility)
+rbutil:
+rbutil: This is the automated installer tool for Rockbox.
+rbutil:
+rbutil: Rockbox is a free replacement firmware for digital music players.
+rbutil:
+rbutil:
+rbutil:
+rbutil:
+rbutil:
+rbutil: