Skip to content

Commit 4e1fb50

Browse files
authored
Merge branch 'master' into vector_mesh_fixes
2 parents 1dc87e4 + a1796db commit 4e1fb50

130 files changed

Lines changed: 5515 additions & 5121 deletions

File tree

Some content is hidden

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

.nix/flake.lock

Lines changed: 18 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: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
inputs.nixpkgs.follows = "nixpkgs";
2525
};
2626
flake-utils.url = "github:numtide/flake-utils";
27+
28+
# This is used to provide a identical development shell at `shell.nix` for users that do not use flakes
29+
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
2730
};
2831

2932
outputs = { nixpkgs, nixpkgs-unstable, rust-overlay, flake-utils, ... }:
@@ -36,34 +39,50 @@
3639
pkgs-unstable = import nixpkgs-unstable {
3740
inherit system overlays;
3841
};
39-
42+
4043
rustc-wasm = pkgs.rust-bin.stable.latest.default.override {
4144
targets = [ "wasm32-unknown-unknown" ];
4245
extensions = [ "rust-src" "rust-analyzer" "clippy" "cargo" ];
4346
};
4447

48+
libcef = pkgs.libcef.overrideAttrs (finalAttrs: previousAttrs: {
49+
version = "138.0.26";
50+
gitRevision = "84f2d27";
51+
chromiumVersion = "138.0.7204.158";
52+
srcHash = "sha256-d9jQJX7rgdoHfROD3zmOdMSesRdKE3slB5ZV+U2wlbQ=";
53+
54+
__intentionallyOverridingVersion = true;
55+
56+
postInstall = ''
57+
strip $out/lib/*
58+
'';
59+
});
60+
61+
libcefPath = pkgs.runCommand "libcef-path" {} ''
62+
mkdir -p $out
63+
64+
ln -s ${libcef}/include $out/include
65+
find ${libcef}/lib -type f -name "*" -exec ln -s {} $out/ \;
66+
find ${libcef}/libexec -type f -name "*" -exec ln -s {} $out/ \;
67+
cp -r ${libcef}/share/cef/* $out/
68+
69+
echo '${builtins.toJSON {
70+
type = "minimal";
71+
name = builtins.baseNameOf libcef.src.url;
72+
sha1 = "";
73+
}}' > $out/archive.json
74+
'';
75+
4576
# Shared build inputs - system libraries that need to be in LD_LIBRARY_PATH
4677
buildInputs = with pkgs; [
4778
# System libraries
79+
wayland
80+
wayland.dev
4881
openssl
4982
vulkan-loader
5083
mesa
5184
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
85+
libGL
6786
];
6887

6988
# Development tools that don't need to be in LD_LIBRARY_PATH
@@ -88,23 +107,21 @@
88107
cargo-watch
89108
cargo-nextest
90109
cargo-expand
91-
110+
92111
# Profiling tools
93112
gnuplot
94113
samply
95114
cargo-flamegraph
96-
97115
];
98116
in
99117
{
100118
# Development shell configuration
101119
devShells.default = pkgs.mkShell {
102120
packages = buildInputs ++ buildTools ++ devTools;
103121

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

109126
shellHook = ''
110127
alias cargo='mold --run cargo'

.nix/shell.nix

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This is a helper file for people using NixOS as their operating system.
2+
# If you don't know what this file does, you can safely ignore it.
3+
4+
# If you are using Nix as your package manager, you can run 'nix-shell .nix'
5+
# in the root directory of the project and Nix will open a bash shell
6+
# with all the packages needed to build and run Graphite installed.
7+
# A shell.nix file is used in the Nix ecosystem to define a development
8+
# environment with specific dependencies. When you enter a Nix shell using
9+
# this file, it ensures that all the specified tools and libraries are
10+
# available regardless of the host system's configuration. This provides
11+
# a reproducible development environment across different machines and developers.
12+
13+
# You can enter the Nix shell and run Graphite like normal with:
14+
# > npm start
15+
# Or you can run it like this without needing to first enter the Nix shell:
16+
# > nix-shell .nix --command "npm start"
17+
18+
# Uses flake compat to provide a development shell that is identical to the one defined in the flake
19+
(import
20+
(
21+
let
22+
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
23+
nodeName = lock.nodes.root.inputs.flake-compat;
24+
in
25+
fetchTarball {
26+
url = lock.nodes.${nodeName}.locked.url;
27+
sha256 = lock.nodes.${nodeName}.locked.narHash;
28+
}
29+
)
30+
{ src = ./.; }
31+
).shellNix

0 commit comments

Comments
 (0)