Implement basic desktop app with chromium embeded framework (#2874)

* Remove tauri based desktop app

* Allow bzip-1.0.6 license

* Implement basic cef based desktop app

* Cleanup build setup

* Use wait until and execute cef loop more frequently

* Remove custom do browser work event

* Move WinitApp into its own module

* Cleanup event handling

* Cleanup + Scheudule cef message loop work

* Fix cpu overheating on idle: https://xkcd.com/1172/

* Use tracing crate for logging instead of println

* Rebase to main

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
Timon
2025-07-23 20:27:55 +02:00
committed by GitHub
co-authored by Dennis Kobert
parent 890da6a3c3
commit 30abc92900
48 changed files with 2725 additions and 2937 deletions
+3 -3
View File
@@ -65,11 +65,11 @@
]
},
"locked": {
"lastModified": 1748399823,
"narHash": "sha256-kahD8D5hOXOsGbNdoLLnqCL887cjHkx98Izc37nDjlA=",
"lastModified": 1753238793,
"narHash": "sha256-jmQeEpgX+++MEgrcikcwoSiI7vDZWLP0gci7XiWb9uQ=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d68a69dc71bc19beb3479800392112c2f6218159",
"rev": "0ad7ab4ca8e83febf147197e65c006dff60623ab",
"type": "github"
},
"original": {
+35 -21
View File
@@ -36,34 +36,50 @@
pkgs-unstable = import nixpkgs-unstable {
inherit system overlays;
};
rustc-wasm = pkgs.rust-bin.stable.latest.default.override {
targets = [ "wasm32-unknown-unknown" ];
extensions = [ "rust-src" "rust-analyzer" "clippy" "cargo" ];
};
libcef = pkgs.libcef.overrideAttrs (finalAttrs: previousAttrs: {
version = "138.0.26";
gitRevision = "84f2d27";
chromiumVersion = "138.0.7204.158";
srcHash = "sha256-d9jQJX7rgdoHfROD3zmOdMSesRdKE3slB5ZV+U2wlbQ=";
__intentionallyOverridingVersion = true;
postInstall = ''
strip $out/lib/*
'';
});
libcefPath = pkgs.runCommand "libcef-path" {} ''
mkdir -p $out
ln -s ${libcef}/include $out/include
find ${libcef}/lib -type f -name "*" -exec ln -s {} $out/ \;
find ${libcef}/libexec -type f -name "*" -exec ln -s {} $out/ \;
cp -r ${libcef}/share/cef/* $out/
echo '${builtins.toJSON {
type = "minimal";
name = builtins.baseNameOf libcef.src.url;
sha1 = "";
}}' > $out/archive.json
'';
# Shared build inputs - system libraries that need to be in LD_LIBRARY_PATH
buildInputs = with pkgs; [
# System libraries
wayland
wayland.dev
openssl
vulkan-loader
mesa
libraw
# Tauri dependencies: keep in sync with https://v2.tauri.app/start/prerequisites/#system-dependencies (under the NixOS tab)
at-spi2-atk
atkmm
cairo
gdk-pixbuf
glib
gtk3
harfbuzz
librsvg
libsoup_3
pango
webkitgtk_4_1
openssl
libGL
];
# Development tools that don't need to be in LD_LIBRARY_PATH
@@ -88,12 +104,11 @@
cargo-watch
cargo-nextest
cargo-expand
# Profiling tools
gnuplot
samply
cargo-flamegraph
];
in
{
@@ -101,10 +116,9 @@
devShells.default = pkgs.mkShell {
packages = buildInputs ++ buildTools ++ devTools;
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
GIO_MODULE_DIR="${pkgs.glib-networking}/lib/gio/modules/";
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}:${libcefPath}";
CEF_PATH = libcefPath;
XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS";
shellHook = ''
alias cargo='mold --run cargo'