Skip to content

Commit 594ae8f

Browse files
authored
Merge branch 'master' into fix/joining-paths-same-pointids
2 parents e0650ce + 02e3293 commit 594ae8f

File tree

26 files changed

+338
-182
lines changed

26 files changed

+338
-182
lines changed

.github/pull_request_template.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1-
<!-- Please reference any relevant issue number below, optionally with a "Closes"/"Resolves"/"Fixes" prefix -->
1+
<!--
2+
Graphite has ZERO-TOLERANCE for contributing undisclosed AI-generated content.
3+
If your PR involves AI, you must read our AI contribution policy (it's short):
4+
https://graphite.art/volunteer/guide/guide/starting-a-task/ai-contribution-policy
25
3-
Closes #
6+
REMEMBER:
7+
- You are responsible for thoroughly testing the successful implementation of your changes and ensuring no obvious regressions occur.
8+
- Egregiously dysfunctional PRs may be assumed to be undisclosed AI slop. If in doubt, ask on Discord before attempting a PR.
9+
- You are highly recommended to include a video showing the before-and-after behavior of your changes and screenshots of any new or modified UI.
10+
- Remember that Graphite maintains high standards for quality and the project is not a classroom for inexperienced developers to gain industry experience.
11+
- In this PR description, reference any relevant tasks by writing "Closes", "Resolves", or "Fixes" with the issue # or the URL of a Discord message documenting the task.
12+
- To acknowledge that you've read this, you must delete these rules and fill in the (strictly human-written) PR description in its place.
13+
-->
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build Linux Bundle
2+
3+
on:
4+
workflow_dispatch: {}
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: DeterminateSystems/nix-installer-action@main
17+
- uses: DeterminateSystems/magic-nix-cache-action@main
18+
19+
- name: Free disk space
20+
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
21+
22+
- name: Build Linux Bundle
23+
run: nix build .nix#graphite-bundle.tar.xz && cp ./result ./graphite-bundle.tar.xz
24+
25+
- name: Upload Linux Bundle
26+
uses: actions/upload-artifact@v4
27+
with:
28+
path: graphite-bundle.tar.xz

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
branding/
22
target/
33
result/
4+
.flatpak-builder/
45
*.spv
56
*.exrc
67
perf.data*

.nix/deps/cef.nix

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
{ pkgs, inputs, ... }:
22

33
let
4-
cef = pkgs.cef-binary.overrideAttrs (_: _: {
4+
cef = pkgs.cef-binary.overrideAttrs {
55
postInstall = ''
66
strip $out/Release/*.so*
77
'';
8-
});
8+
};
99

10-
cefPath = pkgs.runCommand "cef-path" {} ''
10+
cefPath = pkgs.runCommand "cef-path" { } ''
1111
mkdir -p $out
1212
1313
ln -s ${cef}/include $out/include
1414
find ${cef}/Release -name "*" -type f -exec ln -s {} $out/ \;
1515
find ${cef}/Resources -name "*" -maxdepth 1 -exec ln -s {} $out/ \;
1616
17-
echo '${builtins.toJSON {
18-
type = "minimal";
19-
name = builtins.baseNameOf cef.src.url;
20-
sha1 = "";
21-
}}' > $out/archive.json
17+
echo '${
18+
builtins.toJSON {
19+
type = "minimal";
20+
name = builtins.baseNameOf cef.src.url;
21+
sha1 = "";
22+
}
23+
}' > $out/archive.json
2224
'';
2325
in
2426
{

.nix/flake.nix

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
info = {
3434
pname = "graphite";
3535
version = "unstable";
36-
src = ./..;
36+
src = pkgs.lib.cleanSourceWith {
37+
src = ./..;
38+
filter = path: type: !(type == "directory" && builtins.baseNameOf path == ".nix");
39+
};
3740
};
3841

3942
pkgs = import inputs.nixpkgs {
@@ -129,6 +132,13 @@
129132
embeddedResources = false;
130133
dev = true;
131134
};
135+
graphite-bundle = import ./pkgs/graphite-bundle.nix {
136+
inherit pkgs graphite;
137+
};
138+
graphite-flatpak-manifest = import ./pkgs/graphite-flatpak-manifest.nix {
139+
inherit pkgs;
140+
archive = graphite-bundle.tar;
141+
};
132142
#TODO: graphene-cli = import ./pkgs/graphene-cli.nix { inherit info pkgs inputs deps libs tools; };
133143
raster-nodes-shaders = import ./pkgs/raster-nodes-shaders.nix {
134144
inherit

.nix/pkgs/graphite-bundle.nix

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
pkgs,
3+
graphite,
4+
}:
5+
let
6+
bundle =
7+
{
8+
pkgs,
9+
graphite,
10+
archive ? false,
11+
compression ? null,
12+
passthru ? {},
13+
}:
14+
(
15+
let
16+
tar = if compression == null then archive else true;
17+
nameArchiveSuffix = if tar then ".tar" else "";
18+
nameCompressionSuffix = if compression == null then "" else "." + compression;
19+
name = "graphite-bundle${nameArchiveSuffix}${nameCompressionSuffix}";
20+
build = ''
21+
mkdir -p out
22+
mkdir -p out/bin
23+
cp ${graphite}/bin/.graphite-wrapped out/bin/graphite
24+
chmod -v +w out/bin/graphite
25+
patchelf --set-rpath '$ORIGIN/../lib:$ORIGIN/../lib/cef' --set-interpreter '/lib64/ld-linux-x86-64.so.2' out/bin/graphite
26+
mkdir -p out/lib/cef
27+
mkdir -p ./cef
28+
tar -xvf ${pkgs.cef-binary.src} -C ./cef --strip-components=1
29+
cp -r ./cef/Release/* out/lib/cef/
30+
cp -r ./cef/Resources/* out/lib/cef/
31+
find "out/lib/cef/locales" -type f ! -name 'en-US*' -delete
32+
${pkgs.bintools}/bin/strip out/lib/cef/*.so*
33+
cp -r ${graphite}/share out/share
34+
'';
35+
install =
36+
if tar then
37+
''
38+
cd out
39+
tar -c \
40+
--sort=name \
41+
--mtime='@1' --clamp-mtime \
42+
--owner=0 --group=0 --numeric-owner \
43+
--mode='u=rwX,go=rX' \
44+
--format=posix \
45+
--pax-option=delete=atime,delete=ctime \
46+
--no-acls --no-xattrs --no-selinux \
47+
* ${
48+
if compression == "xz" then
49+
"| xz "
50+
else if compression == "gz" then
51+
"| gzip -n "
52+
else
53+
""
54+
}> $out
55+
''
56+
else
57+
''
58+
mkdir -p $out
59+
cp -r out/* $out/
60+
'';
61+
in
62+
63+
pkgs.runCommand name
64+
{
65+
inherit passthru;
66+
}
67+
''
68+
${build}
69+
${install}
70+
''
71+
);
72+
in
73+
bundle {
74+
inherit pkgs graphite;
75+
passthru = {
76+
tar = bundle {
77+
inherit pkgs graphite;
78+
archive = true;
79+
passthru = {
80+
gz = bundle {
81+
inherit pkgs graphite;
82+
compression = "gz";
83+
};
84+
xz = bundle {
85+
inherit pkgs graphite;
86+
compression = "xz";
87+
};
88+
};
89+
};
90+
};
91+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
pkgs,
3+
archive,
4+
}:
5+
6+
(pkgs.formats.json { }).generate "art.graphite.Graphite.json" {
7+
app-id = "art.graphite.Graphite";
8+
runtime = "org.freedesktop.Platform";
9+
runtime-version = "25.08";
10+
sdk = "org.freedesktop.Sdk";
11+
command = "graphite";
12+
finish-args = [
13+
"--device=dri"
14+
"--share=ipc"
15+
"--socket=wayland"
16+
"--socket=fallback-x11"
17+
"--share=network"
18+
];
19+
modules = [
20+
{
21+
name = "app";
22+
buildsystem = "simple";
23+
build-commands = [
24+
"mkdir -p /app"
25+
"cp -r ./* /app/"
26+
"chmod +x /app/bin/*"
27+
];
28+
sources = [
29+
{
30+
type = "archive";
31+
path = archive;
32+
strip-components = 0;
33+
}
34+
];
35+
}
36+
];
37+
}

.nix/pkgs/graphite.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ deps.crane.lib.buildPackage (
124124
cp $src/desktop/assets/*.desktop $out/share/applications/
125125
126126
mkdir -p $out/share/icons/hicolor/scalable/apps
127-
cp ${branding}/app-icons/graphite.svg $out/share/icons/hicolor/scalable/apps/
127+
cp ${branding}/app-icons/graphite.svg $out/share/icons/hicolor/scalable/apps/art.graphite.Graphite.svg
128128
'';
129129

130130
postFixup = ''

0 commit comments

Comments
 (0)