From 8e1e4e3c9c023bf0f00e82ee2f7b199727127cbf Mon Sep 17 00:00:00 2001 From: Marek Paśnikowski Date: Wed, 27 Mar 2024 12:05:36 +0100 Subject: komodo: add Qaterial as dependency: compilation error --- packages/komodo/Qaterial.patch | 56 +++++++++ packages/komodo/googlefontcmake.scm | 72 +++++++++++ packages/komodo/komodo.scm | 2 +- packages/komodo/qaterial.scm | 235 ++++++++++++++++++++++++++++++++++++ 4 files changed, 364 insertions(+), 1 deletion(-) create mode 100644 packages/komodo/Qaterial.patch create mode 100644 packages/komodo/googlefontcmake.scm create mode 100644 packages/komodo/qaterial.scm (limited to 'packages/komodo') diff --git a/packages/komodo/Qaterial.patch b/packages/komodo/Qaterial.patch new file mode 100644 index 0000000..4298206 --- /dev/null +++ b/packages/komodo/Qaterial.patch @@ -0,0 +1,56 @@ +From 1c6b82f51a29f184727256da40c649bc46d81e57 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Pa=C5=9Bnikowski?= +Date: Wed, 27 Mar 2024 10:50:08 +0100 +Subject: [PATCH] Bug Fix + +--- + cmake/QaterialGenerateIcons.cmake | 27 ++++++++++++++++++++++++--- + 1 file changed, 24 insertions(+), 3 deletions(-) + +diff --git a/cmake/QaterialGenerateIcons.cmake b/cmake/QaterialGenerateIcons.cmake +index d28d45d..3b54ae9 100644 +--- a/cmake/QaterialGenerateIcons.cmake ++++ b/cmake/QaterialGenerateIcons.cmake +@@ -200,8 +200,8 @@ function(qaterial_generate_icons_class OUTPUT_FILE_HPP OUTPUT_FILE_CPP) + else() + + # Generate fake Qaterial.Impl.Icons.Icons.qml +- message(STATUS "Generate Fake ${OUTPUT_FILE}") +- file(WRITE ${OUTPUT_FILE} ++ message(STATUS "Generate Fake ${OUTPUT_FILE_HPP}") ++ file(WRITE ${OUTPUT_FILE_HPP} + "// Dummy file generated with CMake to mock the absence of Mdi icons.\n" + "// Everything written here will be lost.\n\n" + "#ifndef __QATERIAL_ICONS_HPP__\n" +@@ -221,6 +221,27 @@ function(qaterial_generate_icons_class OUTPUT_FILE_HPP OUTPUT_FILE_CPP) + "#endif" + ) + +- endif() ++ # Generate fake Qaterial.Impl.Icons.Icons.qml ++ message(STATUS "Generate Fake ${OUTPUT_FILE_CPP}") ++ file(WRITE ${OUTPUT_FILE_CPP} ++ "// Dummy file generated with CMake to mock the absence of Mdi icons.\n" ++ "// Everything written here will be lost.\n\n" ++ "#ifndef __QATERIAL_ICONS_HPP__\n" ++ "#define __QATERIAL_ICONS_HPP__\n\n" ++ "#include \n" ++ "#include \n\n" ++ "#include \n\n" ++ "namespace qaterial {\n\n" ++ "class QATERIAL_API_ Icons : public QObject\n" ++ "{\n" ++ " QATERIAL_SINGLETON_IMPL(Icons, icons, Icons);\n\n" ++ "public:\n" ++ " Icons(QObject* parent = nullptr) : QObject(parent) {}\n\n" ++ "};\n\n" ++ "}\n\n" ++ "#endif" ++ ) ++ ++endif() + + endfunction() +-- +2.41.0 + diff --git a/packages/komodo/googlefontcmake.scm b/packages/komodo/googlefontcmake.scm new file mode 100644 index 0000000..044817e --- /dev/null +++ b/packages/komodo/googlefontcmake.scm @@ -0,0 +1,72 @@ +(define-module (googlefontcmake) + #:use-module (guix build-system cmake) + #:use-module (guix git-download) + #:use-module ((guix licenses) + #:prefix license:) + #:use-module (guix packages)) + +;; DATA LAYER + +(define hash + (base32 "1lmbiv8hgbglaznv8dcsp92m8r9vdg1adg9qfyfinc92k8f5dyqq")) + +(define name + "googlefontcmake") + +(define description + (string-append "CMake function to download google fonts at configure time " + "from google/fonts.")) + +(define home-page + "https://github.com/OlivierLDff/FetchGoogleFontCMake/tree/master") + +(define synopsis + "CMake function to download google fonts at configure time.") + +(define tests? + #f) + +(define url + "https://github.com/OlivierLDff/FetchGoogleFontCMake.git") + +(define version + "master") + +;; ABSTRACTION LAYER -2 + +(define no-install-target + '(delete 'install)) + +;; ABSTRACTION LAYER -1 + +(define phases + `(modify-phases %standard-phases + ,no-install-target)) + +(define uri + (git-reference (url url) + (commit version))) + +;; ABSTRACTION LAYER -0 + +(define arguments + (list #:phases phases + #:tests? tests?)) + +(define source + (origin (uri uri) + (method git-fetch) + (sha256 hash))) + +;; SURFACE LAYER + +(define-public googlefontcmake + (package (name name) + (version version) + (source source) + (build-system cmake-build-system) + (arguments arguments) + (synopsis synopsis) + (description description) + (license license:expat) + (home-page home-page))) diff --git a/packages/komodo/komodo.scm b/packages/komodo/komodo.scm index 4abf2ca..9baa469 100644 --- a/packages/komodo/komodo.scm +++ b/packages/komodo/komodo.scm @@ -56,7 +56,7 @@ (define expected-src "expected-src/") -(define jl777-coins-hash "1icbd6f8nridzc93vz7hsr5dnkrf328zfsw6rrzifc7nvsr559w8") +(define jl777-coins-hash "1svwwly61qy41xcvyz529fcfz6j4h3fgac34v1r4bc7jhjk0wm8a") (define jl777-coins-src "jl777-coins-src/") diff --git a/packages/komodo/qaterial.scm b/packages/komodo/qaterial.scm new file mode 100644 index 0000000..a430c2d --- /dev/null +++ b/packages/komodo/qaterial.scm @@ -0,0 +1,235 @@ +(define-module (qaterial) + #:use-module (gnu packages qt) + #:use-module (googlefontcmake) + #:use-module (guix build utils) + #:use-module (guix build-system copy) + #:use-module (guix build-system cmake) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module ((guix licenses) + #:prefix license:) + #:use-module (guix packages) + #:use-module (qolm) + #:use-module (qtgeneratorcmake)) + +;; DATA LAYER + +(define cmake-fetchgooglefontcmake + "cmake/FetchGoogleFontCMake.cmake") + +(define cmakelists-fonts + "qml/Qaterial/Fonts/CMakeLists.txt") + +(define cmakelists-icons + "qml/Qaterial/Icons/CMakeLists.txt") + +(define cmakelists-root + "CMakeLists.txt") + +(define description + "A collection of Material Components to build faster UI using Qml.") + +(define disable-icons + "set(QATERIAL_ENABLE_ICONS OFF") + +(define disable-lato + "set(QATERIAL_ENABLE_LATO OFF") + +(define disable-roboto + "set(QATERIAL_ENABLE_ROBOTO OFF") + +(define disable-robotomono + "set(QATERIAL_ENABLE_ROBOTOMONO OFF") + +(define enable-build-shared + "set(QATERIAL_BUILD_SHARED ON") + +(define fetcher-fonts + "include\\(\\$\\{PROJECT_SOURCE_DIR\\}\\/cmake\\/FetchGoogleFontCMake.cmake\\)") + +(define fetcher-qolm + "include\\(cmake\\/FetchQOlm.cmake\\)") + +(define file-generateqrc + "cmake/GenerateQrc.cmake") + +(define fetcher-qtgeneratorcmake + "include\\(cmake\\/FetchQtGeneratorCMake.cmake\\)") + +(define hash + (base32 "19xvgk4h908x0zgxy63fqmrsb5df613vhr5h7cpsgg7nllglypss")) + +(define hook-enable-icons + "set\\(QATERIAL_ENABLE_ICONS ON") + +(define hook-qaterial-generate-icons-class + "qaterial_generate_icons_class\\(\\$\\{QATERIAL_ICONS_CLASS_FILE\\} \\$\\{QATERIAL_ICONS_SRC_FILE\\}\\)") + +(define head-hook + "include\\(cmake\\/Version.cmake\\)") + +(define home-page + "https://olivierldff.github.io/Qaterial") + +(define hook-icons + "include\\(\\$\\{PROJECT_SOURCE_DIR\\}\\/cmake\\/FetchMaterialDesignIcons.cmake\\)") + +(define name + "qaterial") + +(define null-string + "") + +(define setter-build-shared + "set\\(QATERIAL_BUILD_SHARED OFF") + +(define setter-lato + "set\\(QATERIAL_ENABLE_LATO ON") + +(define setter-roboto + "set\\(QATERIAL_ENABLE_ROBOTO ON") + +(define setter-robotomono + "set\\(QATERIAL_ENABLE_ROBOTOMONO ON") + +(define synopsis + "🧩 Collection of Material Components based on QtQuickControls2.") + +(define url + "https://github.com/OlivierLDff/Qaterial.git") + +(define version + "v1.4.9") + +;; ABSTRACTION LAYER -4 + +(define link-qtgeneratorcmake + '(string-append "include(cmake/Version.cmake)\n" + "include(" + path-qtgeneratorcmake + "/cmake/GenerateQrc.cmake" + ")\n" + "include(" + path-qtgeneratorcmake + "/cmake/GenerateQmldir.cmake" + ")\n" + "include(" + path-qtgeneratorcmake + "/cmake/GenerateQrcAliasQtObject.cmake" + ")\n")) + +;; ABSTRACTION LAYER -3 + +(define clause-delete-fetchers + `(lambda _ + (substitute* ,cmakelists-root + ((,fetcher-qolm) + ,null-string)) + (substitute* ,cmakelists-root + ((,fetcher-qtgeneratorcmake) + ,null-string)) + (substitute* ,cmakelists-root + ((,setter-roboto) + ,disable-roboto)) + (substitute* ,cmakelists-root + ((,setter-robotomono) + ,disable-robotomono)) + (substitute* ,cmakelists-root + ((,setter-lato) + ,disable-lato)) + (substitute* ,cmakelists-fonts + ((,fetcher-fonts) + ,null-string)) + (substitute* ,cmakelists-icons + ((,hook-icons) + ,null-string)) + (substitute* ,cmakelists-root + ((,hook-enable-icons) + ,disable-icons)) + (substitute* ,cmakelists-root + (("\\# ───── QATERIAL TARGET ─────") + "find_package(QOlm)")))) + +;; (define clause-hack-icon-generator +;; `(lambda _ +;; (invoke "echo" ,qaterial-fix ">" "cmake/QaterialGenerateIcons.cmake"))) + +(define clause-link-qtgenerator + `(lambda* (#:key inputs #:allow-other-keys) + (let ((path-qtgeneratorcmake (assoc-ref inputs "qtgeneratorcmake"))) + (substitute* ,cmakelists-root + ((,head-hook) + ,link-qtgeneratorcmake))))) + +(define clause-set-build-shared + `(lambda _ + (substitute* ,cmakelists-root + ((,setter-build-shared) + ,enable-build-shared)))) + +;; ABSTRACTION LAYER -2 + +(define phase-delete-fetchers + `(add-before 'configure + 'delete-fetchers + ,clause-delete-fetchers)) + +;; (define phase-hack-icon-generator +;; `(add-before 'configure +;; 'hack-icon-generator +;; ,clause-hack-icon-generator)) + +(define phase-link-qtgenerator + `(add-before 'configure + 'link-qtgenerator + ,clause-link-qtgenerator)) + +(define phase-set-build-shared + `(add-before 'configure + 'set-build-shared + ,clause-set-build-shared)) + +;; ABSTRACTION LAYER -1 + +(define phases + `(modify-phases %standard-phases + ,phase-delete-fetchers + ,phase-set-build-shared + ,phase-link-qtgenerator + ;; ,phase-hack-icon-generator + )) + +(define uri + (git-reference (url url) + (commit version))) + +;; ABSTRACTION LAYER -0 + +(define arguments + (list #:phases phases + #:tests? #f)) + +(define inputs + (list googlefontcmake qolm qtbase-5 qtdeclarative-5 + qtgeneratorcmake qtquickcontrols2-5 qtsvg-5)) + +(define source + (origin (uri uri) + (method git-fetch) + (sha256 hash) + (patches (list (local-file "Qaterial.patch"))))) + +;; SURFACE LAYER + +(define-public qaterial + (package (name name) + (version version) + (source source) + (build-system cmake-build-system) + (arguments arguments) + (inputs inputs) + (synopsis synopsis) + (description description) + (license license:expat) + (home-page home-page))) -- cgit v1.2.3