Skip to content

Commit a405294

Browse files
Merge branch 'master' into artboard-gsr
2 parents 07eada0 + 86134c2 commit a405294

179 files changed

Lines changed: 6268 additions & 3960 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.

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ rustflags = [
99
"-C",
1010
"link-arg=--max-memory=4294967296",
1111
"--cfg=web_sys_unstable_apis",
12+
# TODO: Remove this and find a better way to stay within the 25MB limit of cloudflare pages
13+
"-C",
14+
"opt-level=s",
1215
]
1316

1417
[env]

.nix/default.nix

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ let
3131

3232
deps = {
3333
crane = lib.call ./deps/crane.nix;
34-
cef = lib.call ./deps/cef.nix;
3534
rustGPU = lib.call ./deps/rust-gpu.nix;
3635
};
3736

@@ -63,12 +62,9 @@ in
6362
graphite-bundle-dev = (lib.call ./pkgs/graphite-bundle.nix) { graphite = graphite-dev; };
6463
graphite-flatpak-manifest = (lib.call ./pkgs/graphite-flatpak-manifest.nix) { };
6564
graphite-flatpak-manifest-dev = (lib.call ./pkgs/graphite-flatpak-manifest.nix) { graphite-bundle = graphite-bundle-dev; };
65+
graphite-cef = lib.call ./pkgs/graphite-cef.nix;
6666

6767
# TODO: graphene-cli = lib.call ./pkgs/graphene-cli.nix;
68-
69-
tools = {
70-
third-party-licenses = lib.call ./pkgs/tools/third-party-licenses.nix;
71-
};
7268
}
7369
);
7470

.nix/deps/cef.nix

Lines changed: 0 additions & 27 deletions
This file was deleted.

.nix/deps/rust-gpu.nix

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
{ pkgs, ... }:
22

33
let
4-
extensions = [
5-
"rust-src"
6-
"rust-analyzer"
7-
"clippy"
8-
"cargo"
9-
"rustc-dev"
10-
"llvm-tools"
11-
];
12-
toolchain = pkgs.rust-bin.nightly."2025-06-23".default.override {
13-
inherit extensions;
4+
toolchain = pkgs.rust-bin.nightly."2026-04-11".default.override {
5+
extensions = [
6+
"rust-src"
7+
"rust-analyzer"
8+
"clippy"
9+
"cargo"
10+
"rustc-dev"
11+
"llvm-tools"
12+
];
1413
};
1514
cargo = pkgs.writeShellScriptBin "cargo" ''
1615
#!${pkgs.lib.getExe pkgs.bash}
@@ -32,14 +31,12 @@ let
3231
}).buildRustPackage
3332
(finalAttrs: {
3433
pname = "rustc_codegen_spirv";
35-
version = "0-unstable-2025-08-04";
36-
src = pkgs.fetchFromGitHub {
37-
owner = "Firestar99";
38-
repo = "rust-gpu-new";
39-
rev = "c12f216121820580731440ee79ebc7403d6ea04f";
40-
hash = "sha256-rG1cZvOV0vYb1dETOzzbJ0asYdE039UZImobXZfKIno=";
34+
version = "0.10.0-alpha.1";
35+
src = pkgs.fetchCrate {
36+
inherit (finalAttrs) pname version;
37+
sha256 = "sha256-zJEpExkPgYzwo7fR4ge4GxJNj7H5yo4bJ4eTOw36+7c=";
4138
};
42-
cargoHash = "sha256-AEigcEc5wiBd3zLqWN/2HSbkfOVFneAqNvg9HsouZf4=";
39+
cargoHash = "sha256-J1rtbfGqrL2NJ7Bu2pYfDwCdUmnECB/kzxrpYluA0kY=";
4340
cargoBuildFlags = [
4441
"-p"
4542
"rustc_codegen_spirv"

.nix/dev.nix

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
{ pkgs, deps, ... }:
1+
{
2+
pkgs,
3+
deps,
4+
self,
5+
system,
6+
...
7+
}:
28

39
let
410
libs = [
@@ -22,7 +28,6 @@ pkgs.mkShell (
2228

2329
pkgs.lld
2430
pkgs.nodejs
25-
pkgs.nodePackages.npm
2631
pkgs.binaryen
2732
pkgs.wasm-bindgen-cli_0_2_100
2833
pkgs.wasm-pack
@@ -52,13 +57,10 @@ pkgs.mkShell (
5257
pkgs.graphviz
5358
];
5459

55-
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath libs}:${deps.cef.env.CEF_PATH}";
60+
CEF_PATH = self.packages.${system}.graphite-cef;
61+
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath libs}:${self.packages.${system}.graphite-cef}";
5662
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";
5763

58-
shellHook = ''
59-
alias cargo='mold --run cargo'
60-
'';
6164
}
62-
// deps.cef.env
6365
// deps.rustGPU.env
6466
)

.nix/pkgs/graphite-bundle.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
pkgs,
3+
deps,
34
self,
45
system,
56
...
@@ -33,7 +34,7 @@ let
3334
cp -r ${graphite}/share out/share
3435
mkdir -p out/lib/cef
3536
mkdir -p ./cef
36-
tar -xvf ${pkgs.cef-binary.src} -C ./cef --strip-components=1
37+
tar -xvf ${self.packages.${system}.graphite-cef.src} -C ./cef --strip-components=1
3738
cp -r ./cef/Release/* out/lib/cef/
3839
cp -r ./cef/Resources/* out/lib/cef/
3940
find "out/lib/cef/locales" -type f ! -name 'en-US*' -delete

.nix/pkgs/graphite-cef.nix

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{ pkgs, ... }:
2+
3+
let
4+
version = "147.0.10+gd58e84d+chromium-147.0.7727.118";
5+
hashes = {
6+
aarch64-linux = "sha256-kaRijMDacPcoeCcS31zmRSNOvgozx+uq2M34mD28bu4=";
7+
x86_64-linux = "sha256-CHzPofBDhCniDZEpOxXK4I7p57SYjMAY1HVo3Vna0e8=";
8+
};
9+
10+
selectSystem =
11+
attrs:
12+
attrs.${pkgs.stdenv.hostPlatform.system}
13+
or (throw "Unsupported system ${pkgs.stdenv.hostPlatform.system}");
14+
15+
src = pkgs.fetchurl {
16+
url = "https://cef-builds.spotifycdn.com/cef_binary_${version}_${
17+
selectSystem {
18+
aarch64-linux = "linuxarm64";
19+
x86_64-linux = "linux64";
20+
}
21+
}_minimal.tar.bz2";
22+
hash = selectSystem hashes;
23+
};
24+
in
25+
pkgs.cef-binary.overrideAttrs (finalAttrs: {
26+
version = builtins.head (builtins.split "\\+" version);
27+
inherit src;
28+
postInstall = ''
29+
rm -r $out/* $out/.* || true
30+
strip ./Release/*.so*
31+
mv ./Release/* $out/
32+
find "./Resources/locales" -maxdepth 1 -type f ! -name 'en-US.pak' -delete
33+
mv ./Resources/* $out/
34+
mv ./include $out/
35+
36+
cat ./CREDITS.html | ${pkgs.xz}/bin/xz -9 -e -c > $out/CREDITS.html.xz
37+
38+
echo '${
39+
builtins.toJSON {
40+
type = "minimal";
41+
name = builtins.baseNameOf finalAttrs.src.url;
42+
sha1 = "";
43+
}
44+
}' > $out/archive.json
45+
'';
46+
})

.nix/pkgs/graphite.nix

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ let
5050
pkgs.pkg-config
5151
pkgs.lld
5252
];
53-
env = deps.cef.env;
53+
env.CEF_PATH = self.packages.${system}.graphite-cef;
5454
buildPhase =
5555
let
5656
profile = if dev then "dev" else "release";
@@ -82,7 +82,6 @@ deps.crane.lib.buildPackage (
8282
pkgs.pkg-config
8383
pkgs.lld
8484
pkgs.nodejs
85-
pkgs.nodePackages.npm
8685
pkgs.binaryen
8786
pkgs.wasm-bindgen-cli_0_2_100
8887
pkgs.wasm-pack
@@ -98,10 +97,11 @@ deps.crane.lib.buildPackage (
9897
npmConfigScript = "setup";
9998
makeCacheWritable = true;
10099

101-
env = deps.cef.env // {
100+
env = {
102101
RASTER_NODES_SHADER_PATH = self.packages.${system}.graphite-raster-nodes-shaders;
103102
GRAPHITE_GIT_COMMIT_HASH = self.rev or "unknown";
104103
GRAPHITE_GIT_COMMIT_DATE = self.lastModified or "unknown";
104+
CEF_PATH = self.packages.${system}.graphite-cef;
105105
};
106106

107107
postPatch = ''
@@ -150,8 +150,9 @@ deps.crane.lib.buildPackage (
150150
remove-references-to -t "${common.cargoVendorDir}" $out/bin/graphite
151151
152152
patchelf \
153-
--set-rpath "${pkgs.lib.makeLibraryPath libs}:${deps.cef.env.CEF_PATH}" \
153+
--set-rpath "${pkgs.lib.makeLibraryPath libs}:${self.packages.${system}.graphite-cef}" \
154154
--add-needed libGL.so \
155+
--add-needed libEGL.so \
155156
$out/bin/graphite
156157
'';
157158

.nix/pkgs/tools/third-party-licenses.nix

Lines changed: 0 additions & 31 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,6 @@
7070
"*.graphite": "json"
7171
},
7272
"editor.renderWhitespace": "boundary",
73-
"editor.minimap.markSectionHeaderRegex": "// ===+\\n\\s*//\\s*(?<label>[^\\n]{1,18})[^\\n]*(\\n\\s*//[^\\n]*)*\\n\\s*// ===+"
73+
"editor.minimap.markSectionHeaderRegex": "// ===+\\n\\s*//\\s*(?<label>[^\\n]{1,18})[^\\n]*(\\n\\s*//[^\\n]*)*\\n\\s*// ===+",
74+
"git.addAICoAuthor": "off"
7475
}

0 commit comments

Comments
 (0)