From fe53f82377e2a9d4e09ed99958fcb2a2e7b9d302 Mon Sep 17 00:00:00 2001 From: Marek Paśnikowski Date: Fri, 22 Mar 2024 17:16:57 +0100 Subject: komodo-wallet: reorganize the module: bottom->data layer --- packages/komodo/komodo.scm | 183 ++++++++++++++++++++++++++------------------- 1 file changed, 107 insertions(+), 76 deletions(-) (limited to 'packages/komodo/komodo.scm') diff --git a/packages/komodo/komodo.scm b/packages/komodo/komodo.scm index eadb608..cbde448 100644 --- a/packages/komodo/komodo.scm +++ b/packages/komodo/komodo.scm @@ -24,112 +24,106 @@ #:use-module (libsodium-komodo) #:use-module (refl-cpp)) -;;; BOTTOM LAYER +;;; DATA LAYER (define build-deps-prefix "../build/_deps/") -(define expected-file-name - (git-file-name "libexpected" "1.1.0")) - -(define expected-git-reference - (git-reference (url "https://github.com/TartanLlama/expected") - (commit "v1.1.0") - (recursive? #t))) - -(define expected-hash - (content-hash "17akrv80h0n4cfmxwvlvbb8ycqza7y3qqygjyphv95rrabqm9r02")) - -(define expected-patches - (search-patches "libexpected-use-provided-catch2.patch")) +(define expected-hash "17akrv80h0n4cfmxwvlvbb8ycqza7y3qqygjyphv95rrabqm9r02") (define expected-src "expected-src/") -(define fix-date - `(substitute* "cmake/dependencies.cmake" - (("date-tz") - "date"))) - -(define fix-doom-meta - `(substitute* (list "vendor/antara-gaming_sdk/modules/event/CMakeLists.txt" - "vendor/antara-gaming_sdk/modules/ecs/CMakeLists.txt") - (("doom::meta") - "doom"))) - -(define jl777-coins-hash - (content-hash "1icbd6f8nridzc93vz7hsr5dnkrf328zfsw6rrzifc7nvsr559w8")) +(define jl777-coins-hash "1icbd6f8nridzc93vz7hsr5dnkrf328zfsw6rrzifc7nvsr559w8") (define jl777-coins-src "jl777-coins-src/") -(define komodo-wallet-configure-flags - '(list "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" - "-Wno-dev")) - (define komodo-wallet-hash - (content-hash "0pfkgas0xkixf99zqzyri80ksp89b7dw7hbcgpp60ni2cnchxk2n")) + "0pfkgas0xkixf99zqzyri80ksp89b7dw7hbcgpp60ni2cnchxk2n") -(define komodo-wallet-description - (string-append "Komodo Wallet is a secure wallet and non-custodial " - "decentralized exchange rolled into one application. Store " - "your coins, trade peer-to-peer with minimal fees and never " - "give up control over your digital assets.")) +(define komodo-wallet-home-page "https://atomicdex.io/") -(define komodo-wallet-native-inputs - (list boost cpprestsdk date doctest doom-meta entt fmt git libsodium-komodo - nlohmann-json openssl qtcharts qtdeclarative-5 qttools-5 qtsvg-5 - qtwebengine-5 range-v3 refl-cpp spdlog zlib)) +(define komodo-wallet-description-lines + (list "Komodo Wallet is a secure wallet and non-custodial decentralized " + "exchange rolled into one application. Store your coins, trade " + "peer-to-peer with minimal fees and never give up control over your " + "digital assets.")) + +(define komodo-wallet-name "komodo-wallet") + +(define komodo-wallet-synopsis-lines + (list "Komodo Wallet Desktop GUI")) (define komodo-wallet-version "0.7.0-beta") -(define mm2-hash - (content-hash "1bn2sjcrp9ih44h3p96prnwg74aids7fgzcnlv3c68nan6y2lysi")) +(define mm2-hash "1bn2sjcrp9ih44h3p96prnwg74aids7fgzcnlv3c68nan6y2lysi") (define mm2-src "mm2-src/") -;;; ABSTRACTION LAYER -7 +;;; ABSTRACTION LAYER -8 + +(define expected-file-name + (git-file-name "libexpected" "1.1.0")) + +(define expected-git-reference + (git-reference (url "https://github.com/TartanLlama/expected") + (commit "v1.1.0") + (recursive? #t))) + +(define expected-patches + (search-patches "libexpected-use-provided-catch2.patch")) (define komodo-wallet-git-reference (git-reference (url "https://github.com/KomodoPlatform/komodo-wallet-desktop") (commit komodo-wallet-version))) -;;; ABSTRACTION LAYER -6 +(define expected-content-hash + (content-hash (base32 expected-hash))) + +(define jl777-coins-content-hash + (content-hash (base32 jl777-coins-hash))) + +(define komodo-wallet-content-hash + (content-hash (base32 komodo-wallet-hash))) + +(define mm2-content-hash + (content-hash (base32 mm2-hash))) + +;;; ABSTRACTION LAYER -7 + +(define build-path-mm2 + (string-append build-deps-prefix + mm2-src)) + +(define build-path-jl777-coins + (string-append build-deps-prefix + jl777-coins-src)) + +(define build-path-expected + (string-append build-deps-prefix + expected-src)) (define expected-origin (origin (uri expected-git-reference) (method git-fetch) - (hash expected-hash) + (hash expected-content-hash) (file-name expected-file-name) (patches expected-patches))) (define jl777-coins-origin (origin (uri "https://github.com/KomodoPlatform/coins/archive/master.zip") (method url-fetch) - (hash jl777-coins-hash))) + (hash jl777-coins-content-hash))) (define komodo-wallet-origin (origin (uri komodo-wallet-git-reference) (method git-fetch) - (hash komodo-wallet-hash))) + (hash komodo-wallet-content-hash))) (define mm2-origin (origin (uri "https://sdk.devbuilds.komodo.earth/main/mm2_b0fd99e-linux-x86-64.zip") (method url-fetch) - (hash mm2-hash))) - -;;; ABSTRACTION LAYER -5 - -(define build-path-mm2 - (string-append build-deps-prefix - mm2-src)) - -(define build-path-jl777-coins - (string-append build-deps-prefix - jl777-coins-src)) + (hash mm2-content-hash))) -(define build-path-expected - (string-append build-deps-prefix - expected-src)) - -;;; ABSTRACTION LAYER -4 +;;; ABSTRACTION LAYER -6 (define prepare-build-paths `(string-append "file(MAKE_DIRECTORY \"" ,build-path-expected "\")\n" @@ -151,7 +145,7 @@ `(string-append "file(ARCHIVE_EXTRACT INPUT " ,mm2-origin " " "DESTINATION " ,build-path-mm2 ")\n")) -;;; ABSTRACTION LAYER -3 +;;; ABSTRACTION LAYER -5 (define vcpkg-replacement `(string-append "\n" @@ -161,23 +155,49 @@ ,prepare-mm2-src "\n")) -;;; ABSTRACTION LAYER -2 + +;;; ABSTRACTION LAYER -4 + +(define fix-date + `(substitute* "cmake/dependencies.cmake" + (("date-tz") + "date"))) + +(define fix-doom-meta + `(substitute* (list "vendor/antara-gaming_sdk/modules/event/CMakeLists.txt" + "vendor/antara-gaming_sdk/modules/ecs/CMakeLists.txt") + (("doom::meta") + "doom"))) (define replace-vcpkg `(substitute* "CMakeLists.txt" (("include\\(vcpkg_prerequisites\\)") ,vcpkg-replacement))) +;;; ABSTRACTION LAYER -3 + +(define cmake-modification + `(lambda _ + ,replace-vcpkg + ,fix-date + ,fix-doom-meta)) + +;;; ABSTRACTION LAYER -2 + +(define modify-cmake-configuration + `(add-after 'unpack + 'delete-vcpkg + ,cmake-modification)) + ;;; ABSTRACTION LAYER -1 +(define komodo-wallet-configure-flags + '(list "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" + "-Wno-dev")) + (define komodo-wallet-phases - #~ (modify-phases %standard-phases - (add-after 'unpack - 'delete-vcpkg - (lambda _ - #+ replace-vcpkg - #+ fix-date - #+ fix-doom-meta)))) + #~(modify-phases %standard-phases + #+modify-cmake-configuration)) ;;; ABSTRACTION LAYER 0 @@ -185,16 +205,27 @@ (list #:phases komodo-wallet-phases #:configure-flags komodo-wallet-configure-flags)) +(define komodo-wallet-description + (string-concatenate komodo-wallet-description-lines)) + +(define komodo-wallet-native-inputs + (list boost cpprestsdk date doctest doom-meta entt fmt git libsodium-komodo + nlohmann-json openssl qtcharts qtdeclarative-5 qttools-5 qtsvg-5 + qtwebengine-5 range-v3 refl-cpp spdlog zlib)) + +(define komodo-wallet-synopsis + (string-concatenate komodo-wallet-synopsis-lines)) + ;;; SURFACE LAYER (define-public komodo-wallet - (package (name "komodo-wallet") + (package (name komodo-wallet-name) (version komodo-wallet-version) (source komodo-wallet-origin) (build-system qt-build-system) (arguments komodo-wallet-arguments) (native-inputs komodo-wallet-native-inputs) - (synopsis "Komodo Wallet Desktop GUI") + (synopsis komodo-wallet-synopsis) (description komodo-wallet-description) (license license:gpl2) - (home-page "https://atomicdex.io/"))) + (home-page komodo-wallet-home-page))) -- cgit v1.2.3