Skip to content

Commit 30abc92

Browse files
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>
1 parent 890da6a commit 30abc92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2720
-2932
lines changed

.nix/flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.nix/flake.nix

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,50 @@
3636
pkgs-unstable = import nixpkgs-unstable {
3737
inherit system overlays;
3838
};
39-
39+
4040
rustc-wasm = pkgs.rust-bin.stable.latest.default.override {
4141
targets = [ "wasm32-unknown-unknown" ];
4242
extensions = [ "rust-src" "rust-analyzer" "clippy" "cargo" ];
4343
};
4444

45+
libcef = pkgs.libcef.overrideAttrs (finalAttrs: previousAttrs: {
46+
version = "138.0.26";
47+
gitRevision = "84f2d27";
48+
chromiumVersion = "138.0.7204.158";
49+
srcHash = "sha256-d9jQJX7rgdoHfROD3zmOdMSesRdKE3slB5ZV+U2wlbQ=";
50+
51+
__intentionallyOverridingVersion = true;
52+
53+
postInstall = ''
54+
strip $out/lib/*
55+
'';
56+
});
57+
58+
libcefPath = pkgs.runCommand "libcef-path" {} ''
59+
mkdir -p $out
60+
61+
ln -s ${libcef}/include $out/include
62+
find ${libcef}/lib -type f -name "*" -exec ln -s {} $out/ \;
63+
find ${libcef}/libexec -type f -name "*" -exec ln -s {} $out/ \;
64+
cp -r ${libcef}/share/cef/* $out/
65+
66+
echo '${builtins.toJSON {
67+
type = "minimal";
68+
name = builtins.baseNameOf libcef.src.url;
69+
sha1 = "";
70+
}}' > $out/archive.json
71+
'';
72+
4573
# Shared build inputs - system libraries that need to be in LD_LIBRARY_PATH
4674
buildInputs = with pkgs; [
4775
# System libraries
76+
wayland
77+
wayland.dev
4878
openssl
4979
vulkan-loader
5080
mesa
5181
libraw
52-
53-
54-
# Tauri dependencies: keep in sync with https://v2.tauri.app/start/prerequisites/#system-dependencies (under the NixOS tab)
55-
at-spi2-atk
56-
atkmm
57-
cairo
58-
gdk-pixbuf
59-
glib
60-
gtk3
61-
harfbuzz
62-
librsvg
63-
libsoup_3
64-
pango
65-
webkitgtk_4_1
66-
openssl
82+
libGL
6783
];
6884

6985
# Development tools that don't need to be in LD_LIBRARY_PATH
@@ -88,23 +104,21 @@
88104
cargo-watch
89105
cargo-nextest
90106
cargo-expand
91-
107+
92108
# Profiling tools
93109
gnuplot
94110
samply
95111
cargo-flamegraph
96-
97112
];
98113
in
99114
{
100115
# Development shell configuration
101116
devShells.default = pkgs.mkShell {
102117
packages = buildInputs ++ buildTools ++ devTools;
103118

104-
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
105-
GIO_MODULE_DIR="${pkgs.glib-networking}/lib/gio/modules/";
119+
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}:${libcefPath}";
120+
CEF_PATH = libcefPath;
106121
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";
107-
108122

109123
shellHook = ''
110124
alias cargo='mold --run cargo'

0 commit comments

Comments
 (0)