diff --git a/pkgs/applications/system/coolercontrol/coolercontrol-gui.nix b/pkgs/applications/system/coolercontrol/coolercontrol-gui.nix index 1460ea3e8e08..b9a2ae22ff67 100644 --- a/pkgs/applications/system/coolercontrol/coolercontrol-gui.nix +++ b/pkgs/applications/system/coolercontrol/coolercontrol-gui.nix @@ -1,16 +1,7 @@ { - lib, - rustPlatform, - dbus, - freetype, - gtk3, - libsoup_3, - openssl, - pkg-config, - webkitgtk_4_1, - libappindicator, - makeWrapper, - coolercontrol, + cmake, + stdenv, + qt6, }: { @@ -19,48 +10,26 @@ meta, }: -rustPlatform.buildRustPackage { +stdenv.mkDerivation { pname = "coolercontrol"; inherit version src; - sourceRoot = "${src.name}/coolercontrol-ui/src-tauri"; - - useFetchCargoVendor = true; - cargoHash = "sha256-C0oVtU6esXOkssKyJ4XzLV2vGCPbvVKgvf3wXo9L158="; - - buildFeatures = [ "custom-protocol" ]; + sourceRoot = "${src.name}/coolercontrol"; nativeBuildInputs = [ - makeWrapper - pkg-config + cmake + qt6.wrapQtAppsHook ]; buildInputs = [ - dbus - openssl - freetype - libsoup_3 - gtk3 - webkitgtk_4_1 - libappindicator + qt6.qtbase + qt6.qtwebengine ]; - checkFeatures = [ "custom-protocol" ]; - - # copy the frontend static resources to final build directory - # Also modify tauri.conf.json so that it expects the resources at the new location - postPatch = '' - mkdir -p ui-build - cp -R ${coolercontrol.coolercontrol-ui-data}/* ui-build/ - substituteInPlace tauri.conf.json --replace-fail '"frontendDist": "../dist"' '"frontendDist": "ui-build"' - ''; - postInstall = '' install -Dm644 "${src}/packaging/metadata/org.coolercontrol.CoolerControl.desktop" -t "$out/share/applications/" install -Dm644 "${src}/packaging/metadata/org.coolercontrol.CoolerControl.metainfo.xml" -t "$out/share/metainfo/" install -Dm644 "${src}/packaging/metadata/org.coolercontrol.CoolerControl.png" -t "$out/share/icons/hicolor/256x256/apps/" install -Dm644 "${src}/packaging/metadata/org.coolercontrol.CoolerControl.svg" -t "$out/share/icons/hicolor/scalable/apps/" - wrapProgram $out/bin/coolercontrol \ - --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libappindicator ]} ''; meta = meta // { diff --git a/pkgs/applications/system/coolercontrol/coolercontrol-ui-data.nix b/pkgs/applications/system/coolercontrol/coolercontrol-ui-data.nix index 19475bc7572e..0f687c9d5278 100644 --- a/pkgs/applications/system/coolercontrol/coolercontrol-ui-data.nix +++ b/pkgs/applications/system/coolercontrol/coolercontrol-ui-data.nix @@ -1,4 +1,4 @@ -{ buildNpmPackage, autoPatchelfHook }: +{ buildNpmPackage }: { version, @@ -11,15 +11,7 @@ buildNpmPackage { inherit version src; sourceRoot = "${src.name}/coolercontrol-ui"; - npmDepsHash = "sha256-t+QShKaXpQuEzeeu/ljBBEzeYsxqvMpx5waDZ2gyPAI="; - - preBuild = '' - autoPatchelf node_modules/sass-embedded-linux-x64/dart-sass/src/dart - ''; - - nativeBuildInputs = [ autoPatchelfHook ]; - - dontAutoPatchelf = true; + npmDepsHash = "sha256-FFVCE3/E+eiTvTeU53cc1Mdbrl5J3+YgYUYltpnGXz0="; postBuild = '' cp -r dist $out diff --git a/pkgs/applications/system/coolercontrol/coolercontrold.nix b/pkgs/applications/system/coolercontrol/coolercontrold.nix index ee9af95a0ddf..d1e5e43fc8c1 100644 --- a/pkgs/applications/system/coolercontrol/coolercontrold.nix +++ b/pkgs/applications/system/coolercontrol/coolercontrold.nix @@ -18,15 +18,14 @@ rustPlatform.buildRustPackage { sourceRoot = "${src.name}/coolercontrold"; useFetchCargoVendor = true; - cargoHash = "sha256-5gqtSZs/unFobEl1MHec2uhGDrWnO6ITlYbB78VasZg="; + cargoHash = "sha256-ZyYyQcaYd3VZ7FL0Hki33JO3LscPfBT5gl+nw2cXvUs="; buildInputs = [ libdrm ]; postPatch = '' # copy the frontend static resources to a directory for embedding mkdir -p ui-build - cp -R ${coolercontrol.coolercontrol-ui-data}/* ui-build/ - substituteInPlace build.rs --replace-fail '"./resources/app"' '"./ui-build"' + cp -R ${coolercontrol.coolercontrol-ui-data}/* resources/app/ # Hardcode a shell substituteInPlace src/repositories/utils.rs \ diff --git a/pkgs/applications/system/coolercontrol/default.nix b/pkgs/applications/system/coolercontrol/default.nix index 066be7abb8ff..35e138f5f195 100644 --- a/pkgs/applications/system/coolercontrol/default.nix +++ b/pkgs/applications/system/coolercontrol/default.nix @@ -5,13 +5,13 @@ }: let - version = "1.4.5"; + version = "2.1.0"; src = fetchFromGitLab { owner = "coolercontrol"; repo = "coolercontrol"; rev = version; - hash = "sha256-lRw5IcSrLM6aUajt2Ny1IUuGYcAjY1oUDZENyz0wVJI="; + hash = "sha256-xIc0ZecQGyjMQWVaucKomu7SbaHy+ymg5dkOjHjtJ9c="; }; meta = {