Skip to content

Commit 0806b05

Browse files
Implement basic cef based desktop app
1 parent 292b0d4 commit 0806b05

21 files changed

+2657
-80
lines changed

.nix/flake.nix

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,49 @@
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
6782
];
6883

6984
# Development tools that don't need to be in LD_LIBRARY_PATH
@@ -88,23 +103,21 @@
88103
cargo-watch
89104
cargo-nextest
90105
cargo-expand
91-
106+
92107
# Profiling tools
93108
gnuplot
94109
samply
95110
cargo-flamegraph
96-
97111
];
98112
in
99113
{
100114
# Development shell configuration
101115
devShells.default = pkgs.mkShell {
102116
packages = buildInputs ++ buildTools ++ devTools;
103117

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

109122
shellHook = ''
110123
alias cargo='mold --run cargo'

0 commit comments

Comments
 (0)