From e608f44c75858b8f32b27a0f5579fe194fa9fbdc Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Mon, 23 Oct 2023 09:20:44 -0500 Subject: [PATCH] updates to guix shell --- .envrc | 2 +- Cargo.lock | 8 ++-- Cargo.toml | 2 +- guix.scm | 105 +++++++++++++++++++++++++++++++---------------------- shell.nix | 5 ++- 5 files changed, 71 insertions(+), 51 deletions(-) diff --git a/.envrc b/.envrc index 6d52b20..048dfd8 100644 --- a/.envrc +++ b/.envrc @@ -6,7 +6,7 @@ export CXX=g++ export CC=gcc # export CXXQT_INCLUDE_PATH=$GUIX_ENVIRONMENT/include # export INCLUDEPATH="/gnu/store/pkjvij1f6rvx42xv2kygicr7fsch41dl-profile/include" -use flake . --impure +# use flake . --impure # eval $(guix shell -D --search-paths) # use guix --development -f guix.scm diff --git a/Cargo.lock b/Cargo.lock index ca5bc27..f3ff646 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,9 +46,9 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "ashpd" -version = "0.6.2" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3affe251686bd936a0afb74b9693e8bf2f193d51da1b9a45d3f1303a9bd2cc7" +checksum = "2c018490e423efb6f032ef575f873ea57b61d44bec763cfe027b8e8852a027cf" dependencies = [ "async-std", "enumflags2", @@ -1767,9 +1767,9 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "rfd" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241a0deb168c88050d872294f7b3106c1dfa8740942bcc97bc91b98e97b5c501" +checksum = "3c9e7b57df6e8472152674607f6cc68aa14a748a3157a857a94f516e11aeacc2" dependencies = [ "ashpd", "async-io", diff --git a/Cargo.toml b/Cargo.toml index 2859c3a..8f66b41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ tar = "0.4.40" zstd = "0.12.4" serde_json = "1.0.104" fastrand = "2.0.0" -rfd = { version = "0.12.0", features = ["xdg-portal"], default-features = false } +rfd = { version = "0.12.1", features = ["xdg-portal"], default-features = false } sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio"] } tokio = { version = "1.32.0", features = ["full"] } tracing-subscriber = { version = "0.3.17", features = ["fmt", "std", "time", "local-time", "env-filter"] } diff --git a/guix.scm b/guix.scm index 9c2655c..34af93d 100644 --- a/guix.scm +++ b/guix.scm @@ -23,8 +23,10 @@ (gnu packages pkg-config) (gnu packages kde-frameworks) (gnu packages kde) + (gnu packages python) (gnu packages video) (gnu packages cmake) + (gnu packages commencement) (gnu packages crates-io) (gnu services) (guix gexp) @@ -32,6 +34,7 @@ (guix git-download) (guix build-system qt) (guix build-system cmake) + (guix utils) ((guix licenses) #:prefix license:)) (define this-directory @@ -70,18 +73,33 @@ (synopsis "Adding rust to cmake projects") (description "idk")))) -(define-public qtfull +(define lumina-declarative (package - (inherit qtbase-5) - (propagated-inputs (modify-inputs - (package-inputs qtbase-5) - (append - qtdeclarative-5 - qtquickcontrols2-5 - qtx11extras - qtwayland-5 - qtwebengine-5 - qttools-5))))) + (inherit qtdeclarative-5) + (name "qtdeclarative") + (arguments + (substitute-keyword-arguments (package-arguments qtsvg-5) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'build 'fix-qt5core-install-prefix + (lambda _ + ;; The Qt5Core install prefix is set to qtbase, but qmlcachegen + ;; is provided by qtdeclarative-5. + (substitute* + "lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake" + (("\\$\\{_qt5Core_install_prefix\\}") #$output)) + + (substitute* "lib/headers" + (("\\$\\$\\[QT_INSTALL_HEADERS\\]") + "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))")) + (substitute* "lib" + (("\\$\\$\\[QT_INSTALL_LIBS\\]") + "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))") + (("\\$\\$\\[QT_HOST_LIBS\\]") + "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")) + (substitute* "bin" + (("\\$\\$\\[QT_INSTALL_BINS\\]") + "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))")))))))))) ;; (define-public rust-cxx-qt-1 ;; (package @@ -115,32 +133,32 @@ ;; (description "This package provides a safe interop between Rust and C++.") ;; (license (list license:expat license:asl2.0)))) -(define-public rust-youtube-dl-0.9 - (package - (name "rust-youtube-dl") - (version "0.9.0") - (source - (origin - (method url-fetch) - (uri (crate-uri "youtube_dl" version)) - (file-name (string-append name "-" version ".tar.gz")) - (sha256 - (base32 "1fas41jl0f2c3lmdfikvcqbagi5skg9mfnb8xa976p2l5fc1lygw")))) - (build-system cargo-build-system) - (arguments - `(#:cargo-inputs (("rust-log" ,rust-log-0.4) - ("rust-reqwest" ,rust-reqwest-0.11) - ("rust-serde" ,rust-serde-1) - ("rust-serde-json" ,rust-serde-json-1) - ("rust-tokio" ,rust-tokio-1) - ("rust-wait-timeout" ,rust-wait-timeout-0.2)) - #:cargo-development-inputs (("rust-env-logger" ,rust-env-logger-0.10) - ("rust-tempfile" ,rust-tempfile-3) - ("rust-tokio" ,rust-tokio-1)))) - (home-page "https://github.com/GyrosOfWar/youtube-dl-rs") - (synopsis "Runs yt-dlp and parses its JSON output.") - (description "Runs yt-dlp and parses its JSON output.") - (license (list license:expat license:asl2.0)))) +;; (define-public rust-youtube-dl-0.9 +;; (package +;; (name "rust-youtube-dl") +;; (version "0.9.0") +;; (source +;; (origin +;; (method url-fetch) +;; (uri (crate-uri "youtube_dl" version)) +;; (file-name (string-append name "-" version ".tar.gz")) +;; (sha256 +;; (base32 "1fas41jl0f2c3lmdfikvcqbagi5skg9mfnb8xa976p2l5fc1lygw")))) +;; (build-system cargo-build-system) +;; (arguments +;; `(#:cargo-inputs (("rust-log" ,rust-log-0.4) +;; ("rust-reqwest" ,rust-reqwest-0.11) +;; ("rust-serde" ,rust-serde-1) +;; ("rust-serde-json" ,rust-serde-json-1) +;; ("rust-tokio" ,rust-tokio-1) +;; ("rust-wait-timeout" ,rust-wait-timeout-0.2)) +;; #:cargo-development-inputs (("rust-env-logger" ,rust-env-logger-0.10) +;; ("rust-tempfile" ,rust-tempfile-3) +;; ("rust-tokio" ,rust-tokio-1)))) +;; (home-page "https://github.com/GyrosOfWar/youtube-dl-rs") +;; (synopsis "Runs yt-dlp and parses its JSON output.") +;; (description "Runs yt-dlp and parses its JSON output.") +;; (license (list license:expat license:asl2.0)))) (define-public lumina (package @@ -148,11 +166,11 @@ (version "0.0.1") (source source) (build-system qt-build-system) - (arguments `(#:phases - (modify-phases %standard-phases - (replace 'build - (lambda* (#:key outputs #:allow-other-keys) - (invoke "/bin/sh" "./build.sh" "-d")))))) + ;; (arguments `(#:phases + ;; (modify-phases %standard-phases + ;; (replace 'build + ;; (lambda* (#:key outputs #:allow-other-keys) + ;; (invoke "just" "build")))))) (inputs (list mpv ffmpeg)) @@ -163,6 +181,7 @@ clang-toolchain gdb pkg-config + lumina-declarative qtbase-5 qttools-5 qt-creator @@ -189,7 +208,7 @@ `(,rust "cargo") rust-analyzer rust-clippy-0.0 - rust-youtube-dl-0.9 + ;; rust-youtube-dl-0.9 rust-configparser-3 rust-serde-1 rust-quote-1 diff --git a/shell.nix b/shell.nix index aa56f2f..1b5331f 100644 --- a/shell.nix +++ b/shell.nix @@ -5,10 +5,10 @@ mkShell rec { nativeBuildInputs = [ # ffmpeg + gcc ]; buildInputs = [ - gcc stdenv gnumake gdb @@ -66,6 +66,8 @@ mkShell rec { LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; CMAKE_C_COMPILER = "${gcc}/bin/gcc"; CMAKE_CXX_COMPILER = "${gcc}/bin/g++"; + + CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = true; # QT_SCALE_FACTOR = 1; # QT_PLUGIN_PATH="${QT_PLUGIN_PATH/':''/nix/store/85jx8w2nh1ln4kb0hf3dc6ky0dh6ri24-lightly-qt-0.4.1/lib/qt-5.15.9/plugins'':'/':'}" # QML2_IMPORT_PATH=${QML2_IMPORT_PATH/':''/run/current-system/sw/lib/qt-5.15.10/qml'':'/':'} @@ -77,6 +79,5 @@ mkShell rec { makeQtWrapper "/bin/sh" "$setQtEnvironment" "''${qtWrapperArgs[@]}" sed "/^exec/d" -i "$setQtEnvironment" source "$setQtEnvironment" - export QT_PLUGIN_PATH="$QT_PLUGIN_PATH:/nix/store/85jx8w2nh1ln4kb0hf3dc6ky0dh6ri24-lightly-qt-0.4.1/lib/qt-5.15.9/plugins" ''; }